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

Redrawing Indicator & Backtest Results

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

    Redrawing Indicator & Backtest Results

    Hey guys, I did some backtesting and some forward testing results with a strategy that uses the DM indicator. I think the difference between forward testing and backtesting is caused by the fact that DM indicator that comes with NT redraws itself with each bar update. How do I prevent this so that the backtest results and forward test results match up?

    Thanks,
    EliteTradernyc

    #2
    Hello EliteTradernyc,

    Thank you for your post.

    Are you looking to have static values for each bar historically for your backtesting?

    All indicators will calculate on the close of a bar historically, and in real-time you can choose to use CalculateOnBarClose = False so that the indicator calculates on each incoming tick.

    I look forward to your response.

    Comment


      #3
      Hi Sir, yes CalculateOnBarClose = True for the strategy. I want it to be calculated on bar close for the indicator and all related values, but most importantly, I would like the forward test results to be equal to the backtest results.

      Comment


        #4
        Hello EliteTradernyc,

        Thank you for your response.

        Can you clarify on your meaning behind seeing the forward test results equal the backtest results?

        I look forward to assisting you further.

        Comment


          #5
          Sure, so for example, today I ran a forward test on the SIM101 account with my strategy on S and P 500 stocks like MCD, MS, QCOM, C , etc. I ran the strategy for the entire day between 930 am and 4pm. After the 4pm close I then ran a backtest to see if the backtest results would match the forward test results exactly for the entire day, the same entries exits. So in some cases the results matched exactly but in most cases the entries were different. I think the reason is because I am using the DM indicator which redraws itself.

          Comment


            #6
            Hello EliteTradernyc,

            Thank you for your response.

            I do not believe this is in relation to the DM indicator. Please review the following link for information on discrepancies between Real-Time Data and Backtesting and please let me know if you have any questions: http://www.ninjatrader.com/support/h...ime_vs_bac.htm
            Last edited by NinjaTrader_PatrickH; 06-06-2013, 10:54 AM.

            Comment


              #7
              Hey guys is it possible that the lookback period could be causing the descrepancy? for example, infinite versus 256?

              Comment


                #8
                Hello EliteTradernyc,

                Thank you for your response.

                This should not effect the results however, are you using Infinite in real-time or backtesting but using 256 on the opposite?

                In addition, how far back are you running the backtest? Is it the same amount of days as you have set in real-time for DaysToLoad?

                I look forward to assisting you further.

                Comment


                  #9
                  Hi sir, I respectfully disagree with your opinion below. It appears that the way that the DM indicator is drawn in past periods skews the backtest versus forward test results. I was able to code a workaround by cacheing the values of the DM indicator within the strategy and also I was able to stop this behavior by only considering the values at the 0 timeframe and ignoring previous values.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Barry Milan, Yesterday, 10:35 PM
                  5 responses
                  18 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by DanielSanMartin, Yesterday, 02:37 PM
                  2 responses
                  13 views
                  0 likes
                  Last Post DanielSanMartin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  4 responses
                  13 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by terofs, Today, 04:18 PM
                  0 responses
                  12 views
                  0 likes
                  Last Post terofs
                  by terofs
                   
                  Started by nandhumca, Today, 03:41 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post nandhumca  
                  Working...
                  X