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()

    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.
    Kate W.NinjaTrader Customer Service

    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 f.saeidi, Today, 11:02 AM
      0 responses
      0 views
      0 likes
      Last Post f.saeidi  
      Started by geotrades1, Today, 10:02 AM
      3 responses
      10 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by rajendrasubedi2023, Today, 09:50 AM
      3 responses
      15 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by lorem, Today, 09:18 AM
      2 responses
      11 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by geddyisodin, Today, 05:20 AM
      4 responses
      30 views
      0 likes
      Last Post geddyisodin  
      Working...
      X