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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    333 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    211 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    196 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    287 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    244 views
    0 likes
    Last Post CarlTrading  
    Working...
    X