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 Javierw.ok, Today, 04:12 PM
              0 responses
              4 views
              0 likes
              Last Post Javierw.ok  
              Started by timmbbo, Today, 08:59 AM
              2 responses
              10 views
              0 likes
              Last Post bltdavid  
              Started by alifarahani, Today, 09:40 AM
              6 responses
              40 views
              0 likes
              Last Post alifarahani  
              Started by Waxavi, Today, 02:10 AM
              1 response
              18 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by Kaledus, Today, 01:29 PM
              5 responses
              15 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X