Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnBarUpdate v's OnMarketData

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

    OnBarUpdate v's OnMarketData

    Hi

    Can anybody explain the difference between OnBarUpdate and OnMarketData ... I understand that OnMarketData is called on every change of market data (last, bid, ask etc) but what determines the frequency of the call to OnBarUpdate

    Thanks

    Paul

    #2
    It's determined by the frequency of your chart or strategy, ie 233 tick, 5 minute, etc. Unless calculateonbarclose = false, in which it would be every tick (only in real time, not in strategy backtesting).

    Mike

    Comment


      #3
      Originally posted by ctrlbrk View Post
      It's determined by the frequency of your chart or strategy, ie 233 tick, 5 minute, etc. Unless calculateonbarclose = false, in which it would be every tick (only in real time, not in strategy backtesting).

      Mike

      Mike

      Thanks ... so basically there is no difference (if looking at close[0]) if calculateonbarclose = false

      Paul

      Comment


        #4
        Originally posted by murfinp View Post
        Mike

        Thanks ... so basically there is no difference (if looking at close[0]) if calculateonbarclose = false

        Paul
        Hmm, not sure, there might be some situations where it is different, I will let the experts answer.

        There is also OnMarketDepth.

        Mike

        Comment


          #5
          Difference is you receive bid and ask events, not just only last events.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            how about IB forex. there is only bid and ask and no last. would the OnBarUpdate and OnMarketData be the same.

            Comment


              #7
              junkone,

              It is very simple. OnBarUpdate() only updates once for each price move. OnMarketData() may come with 3 updates representing bid, ask, and last. You filter it to choose which one you want to look at.

              For most case scenarios just stick with OnBarUpdate(). Only very specific needs warrant the use of OnMarketData().
              Josh P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              558 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              324 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              545 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              547 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X