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 sjsj2732, Yesterday, 04:31 AM
              0 responses
              38 views
              0 likes
              Last Post sjsj2732  
              Started by NullPointStrategies, 03-13-2026, 05:17 AM
              0 responses
              287 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              288 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              134 views
              1 like
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              95 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Working...
              X