Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnStateChange() not called when bar properties are changed

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

    OnStateChange() not called when bar properties are changed

    NinjaTrader 8.0.5.2

    I think that there is an inconsistency about when OnStateChange() is called.


    First case :

    I have a simple chart with a single indicator. Now I add a secondary bar series via the DataSeries menu.

    Result: The new bar series appears on a second panel below the old bar series. The indicator on the upper panel is recalculated. Both OnStateChange() and OnBarUpdate() are called.

    Second case:

    I have the same simple chart with a single indicator. Now I change the bar properties from "equidistant bar spacing" to "non-equidistant bar spacing".

    Result: The indicator is only partly recalculated. OnStateChange() is not being executed, while OnBarUpdate() is called.

    Inconsistency:

    In both cases the bar spacing of the primary bars is changed. However,

    - when a secondary bar series is added to the chart, both OnStateChange() and OnBarUpdate() are called for the indicator applied to the primary bars

    - when the bar spacing is changed only OnBarUpdate() is called for the same indicator

    I think that it is necessary to call both OnStateChange() and OnBarUpdate(), when the bar spacing property is changed. This is necessary as it is best practice to test for bar properties when State == State.Historical within OnStateChange(). Not calling OnStateChange() in this case is a major omission.

    #2
    Hello Harry,

    Thank you for your patience.

    I will forward your suggestion to our development team.

    Comment


      #3
      Hello Harry,

      Thank you for your patience.

      The internal tracking number for your feature request is SFT-2091. Please reference this internal tracking number if you ever have questions regarding this feature request.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      245 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      157 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      165 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      250 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      201 views
      0 likes
      Last Post CarlTrading  
      Working...
      X