Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Live vs Backtestv

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

    Live vs Backtestv

    Hi there.
    I'm running a live strategy and I've had roughly 6 fills today.
    I've gone in and done a historical backtest for today already and it shows me I should have only been filled ONCE.

    Why is there a difference?
    Surely the backtest (albeit not trading live) would be the ultimate view as it can assimilate all data.

    #2
    Hello Zhorny,

    Thanks for your post.

    Do you have “CalculateOnBarClose = false” in your strategy?

    Note that when running a backtest, CalculateOnBarClose(COBC) is going to be always set to true. Which means that the strategy will calculated at the close of each bar. If your strategy is set to COBC=false, then it will act very differently since it will be calculated on each tick. See the following link for more info on COBC.


    It is expected that “Backtests” will produce different results than “Live Trading”. You may read more about the “Discrepancies: Real-Time vs. Backtest” at the following link.


    Please let me know if I can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Thanks for your answer.
      They were both on "Calculate on bar close = True".
      It just seems weird that the live session picked up trades that the backtest didn't seeming as though they are the exact same strategies UNLESS for whatever reason I am using an indicator that doesn't update straight away - hence a problem for live but fine for backtest. Could this be a problem?

      Comment


        #4
        Hello Zhorny,

        Thanks for your post.

        The logic will be the same when using an indicator in both “Backtesting” and “Live Trading” but getting filled will be different. There are two different fill types when running a “Backtest” Default and Liberal, with Default being a more conservative algorithm. You can select different “Fill Types” to try to get different results. See the link below for more information on “Historical Fill Processing”


        For more information about "Real-Time vs Backtest results" you may read our online help guide at the following link.


        Please let me know if I can be of further assistance.
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        666 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        377 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        110 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X