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 algospoke, Yesterday, 06:40 PM
      2 responses
      23 views
      0 likes
      Last Post algospoke  
      Started by ghoul, Today, 06:02 PM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      45 views
      0 likes
      Last Post jeronymite  
      Started by Barry Milan, Yesterday, 10:35 PM
      7 responses
      22 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by AttiM, 02-14-2024, 05:20 PM
      10 responses
      181 views
      0 likes
      Last Post jeronymite  
      Working...
      X