Announcement

Collapse
No announcement yet.

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 Revazi123, Today, 08:48 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_ChrisL  
              Started by M_ichel, Today, 08:38 AM
              2 responses
              9 views
              0 likes
              Last Post M_ichel
              by M_ichel
               
              Started by soon123, Today, 12:18 AM
              1 response
              24 views
              0 likes
              Last Post NinjaTrader_PaulH  
              Started by space_trader, Today, 12:52 AM
              1 response
              21 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by ybhx0315, Yesterday, 09:06 PM
              0 responses
              21 views
              0 likes
              Last Post ybhx0315  
              Working...
              X