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 zstheorist, Today, 07:52 PM
            0 responses
            3 views
            0 likes
            Last Post zstheorist  
            Started by pmachiraju, 11-01-2023, 04:46 AM
            8 responses
            149 views
            0 likes
            Last Post rehmans
            by rehmans
             
            Started by mattbsea, Today, 05:44 PM
            0 responses
            5 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            33 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Started by tkaboris, Today, 05:13 PM
            0 responses
            5 views
            0 likes
            Last Post tkaboris  
            Working...
            X