I was reading the following in the help guide:
"Should you have multiple Bars objects of the same instrument while using SetStopLoss() in your strategy, you should only submit orders for this instrument to the first Bars context of that instrument. This is to ensure your order logic is processed correctly and any necessary order amendments are done properly"
I have a strategy that has multiple Bars Objects of the same instrument. One is shorter term bars (eg. 2550 Tick Bars) and longer term bars (eg. 10000 Tick Bars). I open and manage trades from both Bars Objects.
In the above scenario, If I enter an order on BarsInProgress = 1 and have to wait till the next OnBarsUpdate event associated with BarsInProgress = 0 to place my SetStopLoss(string fromEntrySignal, CalculationMode mode, double value, bool isSimulatedStop) calls, then doesn't this mean that I will not have a Stop Loss order active until the next OnBarUpdate() for BarsInProgress = 0?
Or if I place all Entry Orders only on the first Bars Object (i.e. BarsInProgress = 0) so that I can place my SetStopLoss() and my entry logic is say a second Leg (multiple entries on same position) then I still have to wait for next OnBarUpdate() for BarsInProgress = 0;
Also, if the two Bars Objects were multiples of the other (meaning 2000 Ticks and 10000 Ticks) there would still be two seperate calls to OnBarUpdate() and my strategy would be waiting till the next OnBarUpdate() associated with BarsInProgress=0. And therefore, which event is called first? The event associated with 10000 Ticks or 2000 Ticks? Assuming that the Tick count would start on same Tick meaning that if OnBarsUpdate() fires for the 10000 Tick bars would the OnBarsUpdate() for the 2000 Tick bars fire immediately after?
Confusion has set in. Please help best understand how to use SetStopLoss() with multiple Bars objects.
Thanks,
Comment