Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Peculiar difference between live test and back test

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

    Peculiar difference between live test and back test

    I am currently live testing a strategy and am running into a peculiar discrepancy between the live test and the back test of the same day.

    In the strategy there is an exit signal generated when a stochastic crosses above 80 or below 20. When I back test the current day after the session has closed, these signals are generated correctly. However, in one of my live tests, the exit signals were not generated on a few trades. These trades crossed above 80 and below 20 however they only crossed by a small amount.

    For example, one trade was supposed to close after the stochastic is above 80 at the close of a bar. The value at the close of the bar was 80.06 and in the live test, the exit signal was not generated. However, in the backtest it was correctly generated.

    What could be causing this? I understand live tests and backtests will have different results but to my understanding this should not happen. Both the live test and backtest were performed on the same data, and I can't come up with a reason the live test wouldn't correctly generate these signals.

    Just as a note, I have been testing this particular strategy for 2 months and this only occurred on one specific day this past week. Aside from that I've never encountered this error.

    #2
    Hi Mike_D, are you sure this happend on exact the same data set and there was no reload of historical data upon reconnecting? Were you using the same loaded data range for your tests? Is this strategy running on CalculateOnBarClose = true in realtime? Thanks!
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi Mike_D, are you sure this happend on exact the same data set and there was no reload of historical data upon reconnecting? Were you using the same loaded data range for your tests? Is this strategy running on CalculateOnBarClose = true in realtime? Thanks!
      -The strategy was running on calculateonbarclose = true in real time.

      -I was using the same data range for my tests. This happened specifically on Wednesday.

      -It sounds like the historical data reload is the most likely explanation. Is there anyway I can confirm this occurred though? It's very possible that a reload and a difference of 1 point would've caused this to happen.

      Thanks for your help!

      Comment


        #4
        To ensure the same data set, just disconnect immediately after you run your strategy live and do not reconnect. You will have the data set as it was received in real-time in your database provided you have "Store real-time data" checked in your Tools -> Options.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by TraderBCL, Today, 04:38 AM
        1 response
        6 views
        0 likes
        Last Post TraderBCL  
        Started by martin70, 03-24-2023, 04:58 AM
        14 responses
        105 views
        0 likes
        Last Post martin70  
        Started by Radano, 06-10-2021, 01:40 AM
        19 responses
        606 views
        0 likes
        Last Post Radano
        by Radano
         
        Started by KenneGaray, Today, 03:48 AM
        0 responses
        4 views
        0 likes
        Last Post KenneGaray  
        Started by thanajo, 05-04-2021, 02:11 AM
        4 responses
        471 views
        0 likes
        Last Post tradingnasdaqprueba  
        Working...
        X