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 llanqui, Today, 10:32 AM
    0 responses
    1 view
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by StockTrader88, 03-06-2021, 08:58 AM
    45 responses
    3,992 views
    3 likes
    Last Post johntraderuser2  
    Started by TAJTrades, Today, 09:46 AM
    0 responses
    7 views
    0 likes
    Last Post TAJTrades  
    Started by rhyminkevin, Yesterday, 04:58 PM
    5 responses
    62 views
    0 likes
    Last Post dp8282
    by dp8282
     
    Started by realblubb, Today, 09:28 AM
    0 responses
    8 views
    0 likes
    Last Post realblubb  
    Working...
    X