Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Determining historical data while processing delayed data

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

    Determining historical data while processing delayed data

    I currently subscribe to kinetick data, but do not pay any exchange fees and because of this I have data that is delayed 15 min by my understanding. In my strategy I send out email alerts, but would like to determine when I am backtesting, or loading up historical data vs running real time such that I do not send emails out everytime i reload a chart. I have tried the "Historical" property, but this apparently returns true all the time and I can only guess this is because I am on 15 min delayed data. Is there a way that I could easily determine that I am live with my data? I have tried some method but none have worked thus far.

    Mark

    #2
    Hi Mark, correct this would be unfortunately a limitation you run into here working on delayed streaming data - I would suggest adding a user input (for example a bool) to your strategy that you can toggle to enabled / disable alerts, this way you could control them before reloading data or backtesting from the chart.

    Comment


      #3
      Hello Mark and Bertrand,

      I know this is many months after the thread started, but I had an idea about this, since I have a similar need, and I wanted to get your view point on it.

      If I understand correctly, the OnMarketData() method is only called in real time, whether the data is delayed or not. It is not called for historical data. I was thinking of setting up a boolean variable that gets set to true by the OnMarketData method, and then checking that variable in code that needs to know if the bar is real-time or not. I'm thinking that OnMarketData will almost always be called before the OnBarUpdate method of the far-right bar of a chart. I could use the following line at the beginning of the OnMarketData method:

      if (!isRealTime) { isRealTime = true; }

      Do you think this will work as a tool to help with optimizing code to work properly with historical and real time data (even delayed)? (I'm already using the OnMarketData method for other reasons, so I wouldn't be using it for just this purpose. I know putting something in that method slows performance.)

      Thanks in advance.

      Scott
      sh_daggett
      NinjaTrader Ecosystem Vendor - NinjaLaunchpad

      Comment


        #4
        Hi Scott, I think that's a good idea and should do it - especially if you're already working with OMD in your script here.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        683 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        386 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        584 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        585 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X