Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy fills next bar instead of intrabar

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

    Strategy fills next bar instead of intrabar

    When I run my strategy in real time it fills entry orders intrabar but when I backtest using strategy analyzer or in simulated mode the same strategy fills next bar. How do I correct this? I want it to fill intrabar in all situations.

    #2
    Just discovered this....... https://ninjatrader.com/support/help...?calculate.htm

    Notes:

    1.On a historical data set, only the OHLCVT of the bar is known and not each tick that made up the bar. As a result, State.Historical data processes OnBarUpdate() only on the close of each historical bar even if this property is set to OnEachTick or OnPriceChange. You can use TickReplay or a Multi-time frame script to obtain intrabar data.

    2.When set to Calculate OnPriceChange, the OnBarUpdate() method is ONLY called when the price has changed intrabar OR when the bar has closed


    This leads to my next question: Since the backtest is only based on the close of each historical bar, is it correct that when you use calculate on bar close that the live strategy will only fill the order on the open of the next bar as opposed to intrabar? Since there is no way to backtest other than replay I would feel more confidant in the results using on bar close.

    Comment


      #3
      Have you looked at Order Fill Resolution?

      Comment


        #4
        Hello EminiMES,

        This would be due to the order being submitted after the condition bar closes, meaning the order is submitted at the open of the new bar.

        See this post for details.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        90 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        137 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        120 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        72 views
        0 likes
        Last Post PaulMohn  
        Working...
        X