"An extremely common scenario is starting a NinjaScript strategy in the middle of a trading session, such as one hour after the session has begun.. The NinjaScript strategy is run on each historical bar for the 1st hour of the session (it will actually run on all historical data loaded in a chart) to determine the current position state it would be in if it had been running live since the start of the session. This position state then becomes the Strategy Position for your strategy. Let us assume that during the historical hour your strategy would have entered a LONG 1 position and the position is still open. This would mean the Strategy Position is LONG 1 and since this trade was not actually executed on an account your Account Position is FLAT."
As far as I understand, it will pre-calculate the program state using the bars since session began. Is there any way to control the number of bars to use?
Another question: I tried to start a strategy and monitor the OnBarUpdate event, but it does not behave like specified in the document. It loads much more bars (two weeks) than it should (since session began).
Thanks,
Jason
Comment