Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

State.Historical

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    State.Historical

    I would have expected things like Bars.Count to be the same when OnStateChanged() is called for State.Historical as they are in OnBarUpdate(). They are not.

    I don't know whether that is a bug or a feature. It does inhibit moving some calculations from OnBarUpdate() to Historical, where they would be done only once.

    --EV

    #2
    This is a consequence of the improved architecture. In NinjaTrader 7 there was a 'transition' period where ticks could come inflight while the indicator/strategy was starting and we would essentially miss these data points. This has been addressed in NinjaTrader 8, but as a result it's expected that you can run into a situation (depending on market conditions) that there are more bars added to the bars array between the time it is processing OnStateChange() and the OnBarUpdate() method, etc.

    For example, this is something from a test case worked recently where this behavior was noted:

    OnStateChange(): State.Historical: Bars.Count=572
    OnBarUpdate(): State.Historical: Bars.Count=576
    ...
    OnStateChange(): State.Realtime: Bars.Count=576
    OnBarUpdate(): State.Realtime: Bars.Count=577
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Welovethelibrary, Today, 11:44 AM
    0 responses
    1 view
    0 likes
    Last Post Welovethelibrary  
    Started by goodknight777, Today, 11:39 AM
    0 responses
    2 views
    0 likes
    Last Post goodknight777  
    Started by MohammedAmine, Today, 10:44 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by Nolyn, Today, 10:59 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by Gkomi, Today, 10:02 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jim  
    Working...
    X