Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT 8090 - Playback -MR - OnBarUpdate not called?

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

    NT 8090 - Playback -MR - OnBarUpdate not called?

    I had a successful run in 8080 from a month ago. I disconnected from replay, installed MS updates on Win7, upgraded NT8.0.9.0.
    I updated my data on my machine, and it is playing back correctly.

    My custom indicator is working correctly in the chart. OnBarUpdate is being called and it is plotting.

    It is also used in a strategy. It is not working at all there.

    I removed the indicator from the chart, I see "State.SetDefaults" and "State.Configure" are both being called. I have a print in the very first line of the indicator in OnBarUpdate() -and we are never reaching that.

    The strategy is running - and it sees the defaulted values of the indicator.

    I'll upgrade another machine to 8.0.9.0, without any other changes and see what happens there.

    I've restarted the machine already to no affect.

    #2
    Attached is some stripped down code.

    The indicator plots on a chart just fine and OnBarUpdate is called.

    The strategy/indicator combo does not work. The indicator's OnBarUpdate is never called.

    2 of my machines now have this problem with 8.0.9.0.

    I have used this method successfully in NT7 and all through NT 8.0.8.0.

    I attached the strategy to the chart on ES in Playback-MR.
    Attached Files

    Comment


      #3
      Hello Sledge,

      Thank you for your note.

      Within your strategy you should add the additional data series in State.Configure and set your indicator object in State.DataLoaded.

      Code:
      else if (State == State.DataLoaded)
      {
      fail  = indicatorfail ( BarsArray[ES] );
      }
      Please let us know if that fails to resolve the issue.
      Alan P.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_AlanP View Post
        Hello Sledge,

        Thank you for your note.

        Within your strategy you should add the additional data series in State.Configure and set your indicator object in State.DataLoaded.

        Code:
        else if (State == State.DataLoaded)
        {
        fail  = indicatorfail ( BarsArray[ES] );
        }
        Please let us know if that fails to resolve the issue.
        Since I had no additional series to load in this case - I changed the State.Configure to State.DataLoaded.

        It FAILED to resolve the issue in the test case code, and failed to resolve the issue in the original strategy code on my other machine.

        Comment


          #5
          Hello sledge,

          I was able to replicate and have submitted a bug report.

          Nice catch and thank you for reporting this.
          Alan P.NinjaTrader Customer Service

          Comment


            #6
            Hello sledge,

            This can be corrected through the use of Update(). For example, before you call the Print in the strategy:

            Code:
            fail.Update();
            Print ( "highprice=" + fail.highprice + " lowprice="+ fail.lowprice );
            I cannot explain why this was not needed in 8.0.8.0 but this is the expected behavior and required function based on the documentation at the following link: https://ninjatrader.com/support/help...-us/update.htm

            Specifically:
            "When indicators are embedded (called) within a NinjaScript strategy, they are optimized to calculate only when they are called upon in a historical backtest. Since the NinjaTrader indicator model is very flexible, it is possible to create public properties on a custom indicator that return values of internal user defined variables. If these properties require that the OnBarUpdate() method is called before returning a value, include a call to this Update() method in the property getter."

            Please let us know if you need further assistance.
            Last edited by NinjaTrader_AlanP; 10-02-2017, 01:44 PM.
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              I'll check it out and see what happens.

              I've never needed it before in any beta market replay where market replay was working.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              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
              44 views
              0 likes
              Last Post jeronymite  
              Started by Barry Milan, Yesterday, 10:35 PM
              7 responses
              20 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by AttiM, 02-14-2024, 05:20 PM
              10 responses
              180 views
              0 likes
              Last Post jeronymite  
              Started by DanielSanMartin, Yesterday, 02:37 PM
              2 responses
              13 views
              0 likes
              Last Post DanielSanMartin  
              Working...
              X