Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

At new Rollover NQ 06-23, the Instruments did not merge the historical data

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

    At new Rollover NQ 06-23, the Instruments did not merge the historical data

    Hello,

    When the Rollover (06-23) happened for NQ, it did not merge the historical data leading to a chart bars less than BarsRequiredToTrade.
    This issue made the strategy to not analyze any trades.

    So, I had to do a Manual Reload All Historical Data and restart the strategy again.
    1. Why this happened, knowing that the Merge Policy is set to MergeBackAdjusted ?
    2. Is it okay if I use the function ReloadAllHistoricalData() at the State.DataLoaded in the strategy to make sure of the historical data merging at every start of a trading session?

    Best regards.

    #2
    Originally posted by PrQuantumH View Post
    Is it okay if I use the function ReloadAllHistoricalData() at the State.DataLoaded in the strategy to make sure of the historical data merging at every start of a trading session?
    Hypothetically, what would stop it from infinitely looping if you could do that?

    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Originally posted by QuantKey_Bruce View Post
      Hypothetically, what would stop it from infinitely looping if you could do that?
      Hello QuantKey_Bruce,

      - It is already (advisable) in the NinjaTrader help Guides :


      to be used ONLY after detecting that the connection has been restored at the OnConnectionStatusUpdate section.

      However, since the State == State.DataLoaded will run only one time, the we probably can use it there too and it will not loop infinitely.

      Regards.

      Comment


        #4
        When it reloads all the historical data, the indicator will start its states over, going through all the states up to State.DataLoaded again, at which time it will reload all of the historical data again, etc., ad infinitum.

        At a minimum, you would need to make the reload conditional on something, such as possibly there was a rollover and a flag was not set that you have done this already for this contract.
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment


          #5
          Thank you QuantKey_Bruce​,

          I found out that no matter what we do, this function ReloadAllHistoricalData() will always lead to disabling the script (restarting it). Therefore, any 1-Time condition we do for it will be reset and allow it again!​

          The only way will be Manually doing it by opening all charts needed and clicking on ReloadAllHistoricalData​. (Before enabling the trading scripts)

          Comment


            #6
            You would need to save this information outside of the indicator instance. For instance, you could use a static variable or a static dictionary of the charts if you want the information to be preserved between indicator runs to store (across instances and runs of this indicator whether it's been done already). Or, you could make it an input parameter and change that, because the input parameters are preserved between runs. Those are just some ideas. What you want to do can be done, but it's not clear-cut and you're going outside of what's supported.
            Bruce DeVault
            QuantKey Trading Vendor Services
            NinjaTrader Ecosystem Vendor - QuantKey

            Comment


              #7
              Hello PrQuantumH.

              Thank you for your post.

              What steps did you take to perform the rollover in your platform? As noted in the help guide, doing the batch rollover from the platform (either via the pop-up prompt when launching NinjaTrader or via the Tools > Database Management window) does not rollover NinjaScript strategies. NinjaScript strategies are not rolled forward and must be manually rolled over.


              However, since the State == State.DataLoaded will run only one time, the we probably can use it there too and it will not loop infinitely.​
              The following is explicitly mentioned on the help guide page for ReloadAllHistoricalData():
              "Critical: This method should NOT be called from any of the event methods which access data or any of the OnStateChange() states as it may be called recursively while the hosting object transitions through states. The designed use case for this method is reloading historical data after a connection update therefore we suggest ONLY using this method in the OnConnectionStatusUpdate method. Please see the examples below for a demonstration of the intended use case."

              Calling from State.DataLoaded is not the appropriate use case for ReloadAllHistoricalData(). If your strategy is running on the primary instrument on the chart, after doing the rollover the strategy must be restarted in order to pick up the change to the new contract front month. It is advisable to close any open positions on the old contract prior to rolling over to the new contract.

              Please let us know if we may be of further assistance.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, 03-13-2026, 05:17 AM
              0 responses
              93 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              152 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              80 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              53 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              64 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X