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!
See more
See less

Partner 728x90

Collapse

Determine if an Instrument has Market Data Available

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

    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.

    #2
    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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    2 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    11 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    10 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    12 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,982 views
    3 likes
    Last Post jhudas88  
    Working...
    X