Mark
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Determining historical data while processing delayed data
Collapse
X
-
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.
MarkTags: None
-
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.
-
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
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
64 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
35 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
59 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
62 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
51 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment