I am creating a backtesting strategy & need some help.
I need to issue a BUY order if the high of the current bar exceeds the high of previous bar by 1 pt (min move in case of Euro Stoxx 50 futures contract) and I am using this peice of code to do it:
if (high() > high(-1)) {
Strategy.doLong("Long Entry",Strategy.LIMIT,Strategy.THISBAR,Strategy.DE FAULT,high(-1)+1);
}
so when will the fill occur? will it occur if the price falls back to high(-1)+1 again? how does this work in backtesting? If I just want to issue an immediate buy once the previous high is breached, can I use Strategy.STOP instead? If not how do I do it? I need to go LONG immediately after current high exceeds previous high.
Thanks in advance!
I need to issue a BUY order if the high of the current bar exceeds the high of previous bar by 1 pt (min move in case of Euro Stoxx 50 futures contract) and I am using this peice of code to do it:
if (high() > high(-1)) {
Strategy.doLong("Long Entry",Strategy.LIMIT,Strategy.THISBAR,Strategy.DE FAULT,high(-1)+1);
}
so when will the fill occur? will it occur if the price falls back to high(-1)+1 again? how does this work in backtesting? If I just want to issue an immediate buy once the previous high is breached, can I use Strategy.STOP instead? If not how do I do it? I need to go LONG immediately after current high exceeds previous high.
Thanks in advance!
Comment