Using either hard-coded time values or a SessionIterator in attempt to place an order and/or do some operation in code at a certain time, to begin with OnBarUpdate has to be called, which it doesn't when there is no market action during that bar. This is the case in Historical state.
1) Preliminary Q: is the behavior in real time similar to that in historical? If Calculate.OnBarClose, and there is no market action during a certain bar, would OnBarUpdate get called for that bar in real time or not?
I'm referring to a secondary series here, if it makes a difference. Primary series is daily, secondary is either 1-minute or 1-second.
2) Main Q: in both historical and real time states, how to make sure a time-based operation always takes place, given that On BarUpdate is not guaranteed to always be called at that time? Think instrument with less liquidity.
I see an example of using a timer in the BarTimer indicator but to place an order from within a timer callback doesn't strike me as safe or advised, if at all possible.
Thanks. Good day.
Comment