Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Historical data loading issue

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

    Historical data loading issue

    Hello NT8 support.

    I use some feed from Lenz&Partner company as data provider. I have some two-instrument indicator. For more certainty, let's consider a secondary chart based on the CL 05-25 instrument. In other words I have
    Code:
    AddDataSeries("CL 05-20", ...);
    method call in the code of my indicator.

    I noticed a weird thing with historical data when starting the indicator. The thing is that a lot of historical bar data of the secondary instrument (CL) for the current day was missed. But the historical data for the previous days was loaded completely. Only a few today's bars that are close to the current time was loaded, but there was no tens or even hundreds of bars from the beginning of the day. I tried the following ways:

    1. Manual downloading the historical data of CL 05-25 (menu Tools -- Historical Data).
    2. Reloading all historical data in the chart by Ctrl+Shift+R.
    3. Reconnection to the feed.

    And I got well-working indicator. I don't know exactly whether one of those actions or some their combination helped to resolve the issue. But my the first question is: Are you familiar with this anomaly?

    Here is my the second question. Is there a possibility to call Ctrl+Shift+R command from the code of my indicator? If yes then I could apply it somewhere in the Transition state between Historical and Realtime states.

    Thank you in advance.

    #2
    Hello PopovDS,

    Thank you for your post.

    We generally do recommend reloading historical data or deleting and redownloading the historical data if there is an issue with it loading improperly/not loading at all.

    You can call ReloadHistoricalData() within a script, but this is meant to be used from within OnConnectionStatusUpdate().




    Programming a NinjaScript to detect key presses would go outside of the scope of support we would be able to provide you with in the Support Department at NinjaTrader.

    That said, it would be possible to code an indicator using C# PreviewKeyUp and PreviewKeyDown for detecting key presses to perform your own actions.

    See this forum thread for more information on this topic and sample code: https://forum.ninjatrader.com/forum/...78#post1137778​​

    Here is a forum thread that discusses this topic which you might find helpful as well: https://forum.ninjatrader.com/forum/...tener-selector

    This forum thread will be open for other community members to share their insights on the topic.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Thank you, Gaby!
      Your link was helpful, and I have applied that approach in my code. But... it provides the reloading of all historical data when connection is lost only. I would like to do that also at the first start of the indicator. The problem is that ReloadAllHistoricalData() method causes restarting of the indicator. There is a risk to get an infinitive loop... For example, the following implementation is called recursively:

      Code:
      protected override void OnConnectionStatusUpdate(ConnectionStatusEventArgs connectionStatusUpdate)
      {
         if (connectionStatusUpdate.Status == ConnectionStatus.Connected)
         {
            ReloadAllHistoricalData();
         }
      }
      Can you confirm that there is no way to reload historical data on the start of the indicator?​

      Comment


        #4
        Hello Popov,

        There is no supported method to have the script reload all historical data outside of OnConnectionStatusUpdate. That method is meant to only be used from OnConnectionStatusUpdate.
        Gaby V.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by raysinred, Today, 10:32 AM
        1 response
        15 views
        0 likes
        Last Post rockmanx00  
        Started by cbadr, Today, 08:19 PM
        0 responses
        4 views
        0 likes
        Last Post cbadr
        by cbadr
         
        Started by DayTradingDEMON, Today, 07:23 PM
        0 responses
        7 views
        0 likes
        Last Post DayTradingDEMON  
        Started by XXfea, Today, 07:01 PM
        0 responses
        9 views
        0 likes
        Last Post XXfea
        by XXfea
         
        Started by RedPothos, Today, 05:07 PM
        0 responses
        12 views
        0 likes
        Last Post RedPothos  
        Working...
        X