I am switching from TradeStation (EasyLanguage) to NT. One thing I'd like to understand is how OnBarUpdate() works.
When I set "CalculateOnBarClose = true;" I was under the impression that the strategy code segment "OnBarUpdate()" would execute AFTER the bar closed. What appears to happen in reality is that the strategy executes only when a new tick arrives that will go into a new bar.
Please clearify when that code segment is executed:
a) after the last tick of the bar arrived
b) when the first tick for the next bar arrived
c) after the time for a time based bar has ended
Is there a difference for tick-based (i.e., 150 tick bars) or volume based (i.e., 1000 shares per bar) bars when compared to time based bars as it is already known after the tick arrived whether any more ticks can go into the bar?
One consequence is that the strategy does NOT execute after the very last bar in the chart. If I run a strategy while the exchange is closed (=> no new ticks are coming in) I will not see any results from calculations that should run on the close of the last bar of the previous session.
Is there a way to force the execution of the "OnBarUpdate()" section for the last bar in the chart after the session has ended?
Thanks,
NutFlush
Comment