Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting not working for CalculateOnBarClose

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

    Backtesting not working for CalculateOnBarClose

    Hello Guys

    I'm backteting my strategy, but on the backtest I noticed it is not working for every inconming tick, looks like it is working with CalculateOnBarClose set to true. I see that because on the backtest results chart it show Entries on at the end/beginning of a bar, although price crossed bar in the meantime.

    On initialize() CalculateOnBarClose is set to false, how can I make backtesting to work as if it was running on each incoming tick?

    Thanks

    Rodrigo

    #2
    Hello rgaleote,

    Thanks for your post.

    Backtesting uses historical bars which do not contain the ticks that made up the bar (unlike market replay), so what you are reporting is expected behavior and the behavior on historical bars is the same as if CalculateOnbarClose were true (even though you set it to false).

    Here is a reference sample on "Backtesting NinjaScript Strategies with an intrabar granularity". http://www.ninjatrader.com/support/f...ead.php?t=6652

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    24 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    115 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    69 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    225 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    411 views
    0 likes
    Last Post CaptainJack  
    Working...
    X