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 pechtri, 06-22-2023, 02:31 AM
    8 responses
    122 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by frankthearm, 04-18-2024, 09:08 AM
    16 responses
    64 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by habeebft, Today, 01:18 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by benmarkal, Today, 12:52 PM
    2 responses
    13 views
    0 likes
    Last Post benmarkal  
    Started by f.saeidi, Today, 01:38 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X