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() vs. OnBarUpdate()

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

    OnMarketData() vs. OnBarUpdate()

    I am trying to understand how one of these methods would fire where the other does not.

    1.What event can happen for OnBarUpdate to trigger, where it does not trigger OnMarketData?

    2. Same question, for OnBarUpdate?

    ...

    I might assume for example that, someone withdrew their pending inside bid (causing the inside bid volume to drop), which would trigger an OnMarketData() call, but no change in OnBarUpdate(). Correct?

    I might also assume that any tick update in OnBarUpdate() will also result in an OnMarketData() call (since it ultimately results in a change in either inside bid or inside ask volume, OnMarketData territory). Is this correct?

    #2
    1. If you have CalculateBarOnClose, OnBarUpdate() will not fire every tick while OnMarketData() will.

    2. The same goes for OnMarketDepth().

    OnMarketData() is essentially level 1 data. OnMarketDepth() is level 2 data so you can build your own bid/ask price ladders with OnMarketDepth() which can be seen here: http://www.ninjatrader-support.com/v...ead.php?t=3478

    OnMarketDepth() will change for every bid/ask change while OnBarUpdate() basically just last price.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh,

      Understand... But if CalculateBarOnClose = false, then how does OnMarketData() differ from OnBarUpdate()?

      Comment


        #4
        Essentially doesn't.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          OnBarUpdate() fires when an update to the Bar occurs which of course is driven by a last trade event. OnMarketData fires on the last trade event among other events. OnBarUpdate() you get the time of bar, OnMarketData() you get the time of the actual market data event.
          RayNinjaTrader Customer Service

          Comment


            #6
            OK great. This is info that I did not find in the helpful manual. Can you elaborate a little on "among other events"?

            Thanks

            Comment


              #7
              other events - Changes in daily high, low, open, close, bid, ask price and volume
              RayNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by ct, 05-07-2023, 12:31 PM
              6 responses
              202 views
              0 likes
              Last Post wisconsinpat  
              Started by kaywai, Today, 06:26 AM
              0 responses
              2 views
              0 likes
              Last Post kaywai
              by kaywai
               
              Started by kevinenergy, 02-17-2023, 12:42 PM
              118 responses
              2,778 views
              1 like
              Last Post kevinenergy  
              Started by briansaul, Today, 05:31 AM
              0 responses
              9 views
              0 likes
              Last Post briansaul  
              Started by traderqz, Yesterday, 12:06 AM
              11 responses
              28 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Working...
              X