Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnMarketData and Data.MarketDataEventArgs

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

    OnMarketData and Data.MarketDataEventArgs

    Hi NinjaTrader,

    For the class Data.MarketDataEventArgs that is returned with the callback OnMarketData, I have a question about what we can assume about it.

    When e.MarketDataType == Data.MarketDataType.Last (i.e. a last trade occurred) can was assume that the class will be populated with Bid, Ask, etc. or do we need to check for null values of those fields ?

    I remember seeing something somewhere that said we can assume these fields are populated when a last trade is fired. It gets messy to have to code in null checks, so wanted to inquire.

    Thank you for insights.

    Number1

    #2
    Hello number1,

    The ask or bid will trigger OnMarketData before the last. You can tell if the last was an ask or bid by comparing it to the previous update.

    I have an example that reproduces the behavior of the T&S Window that demonstrates.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you. Very helpful.

      Comment


        #4
        Chelsea,

        Thank you. Do you know how "hidden orders" would play out for that OnmarketData bid or ask trigger? Would a sell limit that is "hidden", not posted, and gets filled trigger an ask OnMarketData type?

        Comment


          #5
          Hello number1,

          Are you referring to simulated orders that are not submitted to the exchange until touched? These would not be in level 1 or level 2 data.
          Are you referring to working orders that are on the exchanged and not filled? These would be level 2 orders in the market depth (OnMarketDepth).
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Chelsea,

            Thank you for your help.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            43 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            27 views
            0 likes
            Last Post PaulMohn  
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            163 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            98 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            158 views
            2 likes
            Last Post CaptainJack  
            Working...
            X