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 argusthome, Yesterday, 10:06 AM
|
0 responses
14 views
0 likes
|
Last Post
by argusthome
Yesterday, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
11 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
9 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
4 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
31 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment