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 kempotrader, Today, 08:56 AM
      0 responses
      6 views
      0 likes
      Last Post kempotrader  
      Started by kempotrader, Today, 08:54 AM
      0 responses
      4 views
      0 likes
      Last Post kempotrader  
      Started by mmenigma, Today, 08:54 AM
      0 responses
      2 views
      0 likes
      Last Post mmenigma  
      Started by halgo_boulder, Today, 08:44 AM
      0 responses
      1 view
      0 likes
      Last Post halgo_boulder  
      Started by drewski1980, Today, 08:24 AM
      0 responses
      4 views
      0 likes
      Last Post drewski1980  
      Working...
      X