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 AaronKoRn, Today, 09:49 PM
      0 responses
      11 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Today, 08:42 PM
      0 responses
      10 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Today, 07:51 PM
      0 responses
      11 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,980 views
      3 likes
      Last Post jhudas88  
      Started by rbeckmann05, Today, 06:48 PM
      0 responses
      9 views
      0 likes
      Last Post rbeckmann05  
      Working...
      X