Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnMarketData() vs OnBarUpdate()

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

    OnMarketData() vs OnBarUpdate()

    According to https://ninjatrader.com/support/help...marketdata.htm, the OnMarketData() method is expected to be called after OnBarUpdate(), does this mean these two methods to be called at the similar frequencies?
    Also are there any problems if EnterLong() is called from OnMarketData() instead of OnBarUpdate()?
    Thanks.

    #2
    Hello localappleseed,

    Thank you for your post.

    If the strategy is calculating on each tick, we can expect similar frequency between OnBarUpdate and OnMarketData. With other calculate settings, OnMarketData would be called more often than OnBarUpdate as it's triggered whenever a new tick comes in.

    Order entry methods can be submitted anywhere, however, submitting orders on each tick could result in multiple entries/exits, which could result in an unwanted position. Managed Approach methods are tied to the strategy position, if the order does not get filled and modifies the strategy position before another tick comes in, we could have another entry submitted.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Thanks for very helpful information.
      Yes, as you warned, I have to make sure no additional order submitted if I see existing orders are still pending.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      20 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      119 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      63 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      41 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      45 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X