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

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 benmarkal, Yesterday, 12:52 PM
            3 responses
            22 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by helpwanted, Today, 03:06 AM
            1 response
            18 views
            0 likes
            Last Post sarafuenonly123  
            Started by Brevo, Today, 01:45 AM
            0 responses
            11 views
            0 likes
            Last Post Brevo
            by Brevo
             
            Started by aussugardefender, Today, 01:07 AM
            0 responses
            6 views
            0 likes
            Last Post aussugardefender  
            Started by pvincent, 06-23-2022, 12:53 PM
            14 responses
            244 views
            0 likes
            Last Post Nyman
            by Nyman
             
            Working...
            X