Since it's likely to be asked in this context, assume COBC == true;
The order triggering is done something like this:
// where hOset is the bar offset for historical chart
bar1 = BOP(sellBOPPeriod, sellBOPSmooth).TheBOP[1 + hOset];
bar2 = BOP(sellBOPPeriod, sellBOPSmooth).TheBOP[2 + hOset];
if(Close[1 + hOset] > High[2 + hOset] && bar1 > bar2)
EnterShort();
The symptoms:
If I load the strategy to a running replay or live connection (inside the session time frame, IE bars are plotting). None of the historical order timing is correct, none of the plotting that tracks those orders is correct because the orders are not correct. The timing of the orders is wrong and in some cases the tracking of if orders are open or closed seems to break down. I know this because I basically plot(and output window) everything related to execution.
Under ALL other circumstances everything is working correctly.
So, I have these questions:
1. Help me understand what is going on here. Why is this happening?
2. What approaches are practical to getting a strategy to load onto a running chart and not have the sequencing or whatever issue?
3. Is this issue a limitation of NT? Meaning it's just not possible to load a strategy historically onto a "live" chart and have everything happen and plot correctly both historically and from then on?
My thinking is that in the above condition (loading to a plotting chart) I need to "hold" the datafeed back until the first tick of the NEXT bar. That is the only thing I see different here (data comes in mid bar vs. on first tick as with session startup). My attempts at forcing the sync of the datafeed to the first tick of the next bar in live chart have proved futile....
MANY MANY thanks in advance!
JohnQ
Comment