Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest opening position at EOD (using daily bars)

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

    Backtest opening position at EOD (using daily bars)

    I would like to backtest using EOD bars (stocks) and my entry would be at the end of the day (close price). I coded the strategy but it's entering next bar.

    Can anyone help ? Thanks.

    #2
    Hello tradinghumble,

    When NinjaTrader is running with Calculate on bar close (COBC) as true, orders are placed after the bar closes using logic calculated from that bar.

    Below is a link to the help guide on Calculate on bar close.


    This means that any orders that are triggered from that bar are submitted after the bar closes as the new bar opens. As the order is placed as the new bar opens and the timestamp of the order is within the time of the next bar, the order will show on the next bar.

    If the strategy were running with COBC as false, or if the script has intra-bar granularity and submitted orders on a smaller timeframe, this would cause the timestamp of the order to be within the bar it is triggered on as the order may be submitted intra-bar. This order would show on the same bar as the bar that triggered the order submission. Though this would not be possible with the Kinetick End of Day (Free) connection, which does not provide intra-day or real-time data.

    This is outlined in the help guide Discrepancies: Real-Time vs Backtest.


    Please let me know if this does not resolve your inquiry.
    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
    71 views
    0 likes
    Last Post PaulMohn  
    Working...
    X