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

Indicators in the MarketAnalyzer, State and OnBarUpdate

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

    Indicators in the MarketAnalyzer, State and OnBarUpdate

    Indicator's have some unexpected behavior when used in a MarketAnalyzer column.

    For normal indicator behavior, once the data is loaded
    1. State changes to State.Historical
    2. OnBarUpdate is called for all historical data.
    3. State changes to State.Realtime
    4. OnBarUpdate is called as new market data comes in to complete bars (depending on the type of bar, time frame etc..)
    When used by the Indicator MarketAnalyzer column in the MarketAnalyzer there are two potential behaviors.

    A.) The indicator has no plots available. An indicator like this has no options in the drop down in the UI to select from the plots. No call to AddPlot occurs in the indicator. In this case the behavior is
    1. State changes to State.Historical
    2. OnBarUpdate is called for all historical data.
    3. State changes to State.Realtime
    And that is it. OnBarUpdate is never called after the state reaches Realtime.

    This was discovered when I built an indicator to trigger alerts. The indicator used other indicators to perform calculations and under certain conditions will trigger alerts. A useful lightweight solution if one wants to monitor a list of instruments, but not have a chart for every instrument in the list.

    B.) The indicator has plots available. In this case the behavior is
    1. State Changes to State.Historical
    2. State Changes to State.Realtime
    3. All bars, including historical bars are processed in State.Realtime.
    I would be curious why a plot causes B to execute all historical data in the Realtime state instead of the expected Historical state. This is particularly problematic for an indicator that triggers alerts as it will now trigger alerts for every historical bar, when the desired behavior would be for it to only trigger alerts as new data comes in.
    Last edited by ntbone; 11-28-2023, 09:01 AM.

    #2
    Hello ntbone,

    Thanks for your post.

    We have received your inquiry and are researching this matter to provide you with the best information we can.

    Once we are finished investigating this inquiry, we will update this forum thread with our findings.

    Thanks for your patience.​
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      A simple indicator that prints out the State, the CurrentBar and the Time[0] in OnBarUpdate and a output message when the State changes to RealTime in OnStateChange illustrates the behavior. I can provide code if it helps.

      Comment


        #4
        Hello ntbone,

        Thanks for your patience.

        I was able to reproduce the reported behavior and have informed the Development team of this behavior so that they may look into it further.

        The tracking ID for this is TS-3001.

        Once I hear back from the Development team on this matter I will update this forum thread with their findings.​
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hi NinjaTrader_BrandonH ,

          Any update on when will this issue with MarketAnalyzer be fix? This is a serious problem which makes MarketAnalyzer unusable with indicators.

          Thanks,
          Bogdan.

          Comment


            #6
            Hello bperes2003,

            Thanks for your notes.

            A fix for this is expected to be implemented in NinjaTrader version 8.1.3.0 when it is released.

            We do not have an ETA for when this version will be released at this time.
            Brandon H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by poplagelu, Today, 05:00 AM
            0 responses
            3 views
            0 likes
            Last Post poplagelu  
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,407 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by Shai Samuel, 07-02-2022, 02:46 PM
            4 responses
            98 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by DJ888, Yesterday, 10:57 PM
            0 responses
            8 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            160 views
            0 likes
            Last Post loganjarosz123  
            Working...
            X