I developed a strategy that works with multiple instruments, adding DataSeries in State.Configure, like below:
AddDataSeries("MES 06-20", BarsPeriodType.Minute, 5);
AddDataSeries("MNQ 06-20", BarsPeriodType.Minute, 5);
AddDataSeries("M2K 06-20", BarsPeriodType.Minute, 5);
In OnBarUpdate() event I have a condition for the strategy to work only with the added instruments:
if (BarsInProgress > 0)
ExecuteStrategy();
Through the ExecuteStrategy() method, my strategy performs all scheduled operations. In some tests that I'm doing, the BarsInProgress variable is 0 (zero), inside the ExecuteStrategy() method. However, if I have a condition to execute the ExecuteStrategy() method only if the BarsInProgress is greater than 0 (zero), why is this variable changing value after the condition (if (BarsInProgress > 0) )?
Tks.
Comment