• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnMarketData - Replay for indicators referenced by a strategy.

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

    OnMarketData - Replay for indicators referenced by a strategy.

    We have an indicator that relies on tick replay for historical calculations, and does its work using OnMarketData to get the latest bid and ask for each trade tick.

    We want to call this indicator from a strategy, but find that while the indicator receives OnMarketData for each tick during a tick replay if it is directly on the chart, when the strategy calls it from NinjaScript code it does not receive any OnMarketData calls until it reaches realtime data.

    The strategy and the indicator are set to update on each tick, and the data series is set to do a tick replay.

    Still, the OnMarketData only fires during the replay for indicators directly on the chart, not for indicators referenced by a strategy.

    How can this be resolved?

    #2
    Hello TapeReader,

    Thank you for your post.

    We are looking into this. I will respond here when I have further information for you.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      I have confirmed the same behavior you see and I am working with the development team concerning this matter. Thank you for your patience.
      Patrick H.NinjaTrader Customer Service

      Comment


        #4
        This has been reported to development as it is not expected behavior.
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          Hi

          I do not see mention of this in the .9 release notes.

          Is there a status update available for this issue?

          Thanks,
          T

          Comment


            #6
            Hello TapeReader,

            Thank you for your post.

            No update on this item at this time.
            Patrick H.NinjaTrader Customer Service

            Comment


              #7
              Hi,

              Is there a status update available for this issue?

              Thanks,
              C

              Comment


                #8
                Hi Patrick,
                This is an issue for me as well. I was wondering if there is a tracking number for this issue yet?

                Comment


                  #9
                  No update at this time. It is still being investigated.
                  Patrick H.NinjaTrader Customer Service

                  Comment


                    #10
                    I can provide some insight here, depending on exactly how you are referencing the indicator in your strategy code.

                    Am I correct in assuming that you are referencing the indicator in OnBarUpdate() or another event-driven method, and not referencing it in OnStateChange when State == Configure? If so, then that would cause the issue that you are seeing. Without a reference to the indicator in State.Configure (either by instantiating it or using AddChartIndicator()), the strategy will not know that it needs to use Tick Replay to process historical bars, which will cause it to run without any historical calls to OnMarketData().

                    If this applies in your instance, you can use one of the following ways to reference the indicator in State.Configure:

                    Code:
                    if (State == State.Configure)
                    {
                        MyTickReplayInidcator = TickReplayIndicator();  // storing a reference
                    
                       AddChartIndicator(TickReplayIndicator(); // add a chart indicator through strategy
                    }
                    With that in place, you should see your historical OnMarketData() iterations, and should see the indicator behave the same as it does when applied directly on a chart.
                    Dave I.NinjaTrader Product Management

                    Comment


                      #11
                      Dave,

                      Thank you for suggesting this as a way to get it to work. I will re-test the issue with a reference as you have suggested.

                      Comment


                        #12
                        Dave,

                        I have tested this here today, and it does work. Thank you for posting the explanation.

                        Comment


                          #13
                          Thanks for confirming. We have some documentation changes pending under 'Developing for tick replay' that will help address this policy as well as several others.
                          MatthewNinjaTrader Product Management

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by brian meade, Today, 01:39 PM
                          1 response
                          4 views
                          0 likes
                          Last Post NinjaTrader_PaulH  
                          Started by Johnny Santiago, Today, 12:20 PM
                          1 response
                          5 views
                          0 likes
                          Last Post NinjaTrader_ChrisL  
                          Started by NinjaTrader_Brandon, Today, 10:24 AM
                          0 responses
                          46 views
                          0 likes
                          Last Post NinjaTrader_Brandon  
                          Started by ptertich, Today, 07:56 AM
                          2 responses
                          15 views
                          0 likes
                          Last Post Johnny Santiago  
                          Started by aslane, Today, 08:24 AM
                          1 response
                          14 views
                          0 likes
                          Last Post NinjaTrader_ChrisL  
                          Working...
                          X