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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    102 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    144 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    71 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    125 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    79 views
    0 likes
    Last Post PaulMohn  
    Working...
    X