Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Determine if an Instrument has Market Data Available
Collapse
X
-
Determine if an Instrument has Market Data Available
How can I determine if market data is available for a given instrument? Currently I create a MarketData object and wait for a fixed amount of time for it to call the update method. If this method doesn't get called then market data is unavailable.Tags: None
-
Hello ntbone,
Thank you for your post.
We checked with our dev team on this one, and while it's undocumented, so it is subject to change, you can try checking Instrument.HasSeenMarketData to see if it's gotten at least some real time market data. If the connection gets disconnected, well we don't know if its currently getting data, but we know it did at one point from checking this.
You may also want to check the following to determine if there may have been a disconnection:
if(myInstrument.MarketData.Last != null && !myInstrument.MarketData.Last.IsReset)
{
// do something if it has not been reset and there's been last data
}
Checking the connection or account might confirm if the connection was changed as well.
Please let us know if we may be of further assistance to you.
Kate W.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Johndc, Today, 04:39 AM
|
0 responses
0 views
0 likes
|
Last Post
by Johndc
Today, 04:39 AM
|
||
Started by johntraderuser2, Today, 02:34 AM
|
0 responses
6 views
0 likes
|
Last Post Today, 02:34 AM | ||
Started by IanS00, 03-27-2024, 11:24 AM
|
2 responses
12 views
0 likes
|
Last Post Today, 02:00 AM | ||
Started by Mariawilcoxi, Today, 01:32 AM
|
0 responses
5 views
0 likes
|
Last Post
by Mariawilcoxi
Today, 01:32 AM
|
||
Started by gleichnerany, Today, 01:17 AM
|
0 responses
5 views
0 likes
|
Last Post
by gleichnerany
Today, 01:17 AM
|
Comment