I have a multi time frame strat. using 5min, 15 min, hourly, 4hr, daily, and weekly. I have good results from the backtest but I fear they are inacurrate.
I want to wait till say 1 hour has pasted and use the high and low of that bar. However I am ordering in the 15 min time frame.
So essentially my code looks something like this:
if (BarsInProgress == 1) if(onehourhigh > fourhourhigh) Enterlong... Setprofittarget... if (BarsInProgress == 3) { if (High[0] >= High[1]+x) { onehourhigh = High[0]; } if (BarsInProgress == 4) { if (High[0] >= High[1+y) { fourhourhigh = High[0] }
Because I thought if I just used Highs[4][0] inside of BarsInProgress=0 it would just update that bar every time it updated the primary time series.. Or would this way produce a more accurate backtest result?
Also I noticed when I change the primary bars from 15 to 30 mins it changes some of my entry price on bars when backtesting even though I only have reset profittargets in my primary barsinprogress code and I'm not calling for the primary series in any other barinprogress any of the code.
When I changed my primary bars with CalculateBarsOnClose=true during market replay my entries stayed the same between 15 min 30 min but changed on 60 mins.
If I run my strat in real time with the Sim account with CalculateBarsOnClose=true, shouldn't my market replay results be very similar as my backtest results?
Thanks!
Comment