Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order triggering discrepency

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

    Order triggering discrepency

    Whenever I compare my real time strategy performance to the backtest results, my real time orders are triggering exactly 1 bar prior to when the back test is saying that it triggered. I can easily put a delay into the strategy so that they match up properly, but I want to see if there is a logical explination to this problem so that I can address it more effectively. Does anyone have any ideas on what might be causing this?

    #2
    First, you can't compare, see here - http://www.ninjatrader-support.com/H...sBacktest.html

    Second, its possible you are running with the parameter "Calculate on bar close" set to false at run time which means signals can be triggered intrabar vs end of bar which is the case in a backtest.
    RayNinjaTrader Customer Service

    Comment


      #3
      The strategy is set to calculate on bar close, so that would work the same as the back test in that regard. The only reason that I mentioned comparing the two is that it seemed improbable for it to be just a coincidence that the real time trades were executing exactly 1 minute (on a 1 minute chart) prior to what the back test showed. I guess it is just a difference in when the data is being processed if I am understanding the link that you provided correctly.

      Comment


        #4
        In a backtest, the executions are plotted on the bar after the signal is true, in real-time, the execution is plotted based on its actual time stamp. It is possible that it could be plotted on the signal bar or the next bar.
        RayNinjaTrader Customer Service

        Comment


          #5
          Ah, now that makes more sense. Now I just need to adjust my strategy to account for that. Thank you very much for your assistance.

          Comment


            #6
            I am having a new problem related to backtesting, so I thought I would put it in this same thread. This morning I ran a back test on a strategy and got a set of results for the last couple of days. I then disconnected from my live account and ran a market replay for yesterday through this morning. After that was done and I reconnected to my live account, the results of the back test was very different from the first one that I ran.

            I have tried resetting the database to try and get it reset so that the backtest showed the original results, but that didn't work. Do you have any ideas what may have caused the replay to change my backtest results?

            Comment


              #7
              Replay is considered real-time, with that in mind, please look at the following link - http://www.ninjatrader-support.com/H...sBacktest.html
              RayNinjaTrader Customer Service

              Comment


                #8
                Well the replay results were fine. Maybe I didn't explain my question well enough. Prior to running the replay, the backtest in the strategy analyzer returned one set of results. After the replay, the strategy analyzer returned a different set of results for the same time period with the same parameters set.

                Comment


                  #9
                  Got it, thanks.

                  Something then must have changed, settings, strategy logic, underlying data. Not sure what, but something would have changed for sure.
                  RayNinjaTrader Customer Service

                  Comment


                    #10
                    Alright, I will just keep my eye on it and see if it happens again. That was the first time I have had it happen, so we will see if it was just a random glitch in the data set. Thanks for your help.

                    Comment


                      #11
                      Alright, I did some more investigating in my historical data database and I have found the answer to my problem. I exported the database, deleted it from the program, and then tried importing it again, but it gave me an error saying that a line wasn't formated correctly. Last week I got my account transfered to running on sub-pip with Gain capital. From that day on, Ninja Trader has been storing the historical data as 0.0000'0, which is how the price appears in the program. If I manually go into the text file and delete the ' the data will then import without a problem.

                      This explains the problem that I described earlier because I was originially feeding the analyzer with data from that session, but whenever I disconnected, and reconnected, the program then had to load the historical data from the database, which Ninja Trader was not able to accurately read every price, only the even pricing with no sub-pips.

                      I hope I have explained this situation adequately to where you understand it. Hopefully you will be able to address this problem in the next update of Ninja Trader so that it properly handles sub-pip entries in the database. If you need any further explination, please let me know and I will be more than happy to provide the information.

                      Comment


                        #12
                        Thanks for reporting. This will be fixed with next update.

                        Comment


                          #13
                          Awsome, I will be looking forward to that update.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          582 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          338 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by Mindset, 02-09-2026, 11:44 AM
                          0 responses
                          103 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                          0 responses
                          554 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          552 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X