Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 alifarahani, Today, 09:40 AM
      6 responses
      27 views
      0 likes
      Last Post alifarahani  
      Started by Waxavi, Today, 02:10 AM
      1 response
      17 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by Kaledus, Today, 01:29 PM
      5 responses
      13 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Waxavi, Today, 02:00 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by gentlebenthebear, Today, 01:30 AM
      3 responses
      17 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X