Using the sample MAStrategy to narrow problem.
Using Market Replay to test
Using 2 days of data
TEST 1:
Using Market Replay, I sllide the bar to just after 9am. I then kick to 500x and let it roll.
Orders start to come on, everything is normal. I get a result, say +500.00
I then let it continue through the overnight session all the way to the next day's session. It begins firing orders again (on the 9-4 standard session btw). And I get another end of day result, say -400.
So I am net 100.00
TEST 2:
I start off same as 1, but after the end of the first day, I then slide the bar to the next day and stop just before 9:30 open. It runs and I get a different result for that day. Say +100 instead of -400.
QUESTION:
Am I getting different results because when I let it run overnight and through the next day, there are bars that can be looked at to calculate the MA crosses, etc. and as such fire orders perhaps earlier or at different time because the MA will be using prior bars to work off?
If so, is there a code snippet or something I can do so that when I let it run through say a weeks worth of data or whatever, it will simulate the effect of starting from a clean slate at 9:30am without looking at prior bars?
At first I thought it was a bug, but logically I think it has to do with what I am saying herein.
Please advise.
Thank you

Comment