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

Same strategy different back test results

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

    Same strategy different back test results

    I copied my custom strategy and back tested both the original and copy, exact same inputs and parameters. They resulted in different outcomes. Looking at the charted analysis I determined that the indicator that corresponds to the strategy is being drawn differently for the two strategies. Trading hours are both set the same "instrument hours". Every 2 hours the indicator draws a static average price from the previous 2 hour period. In strategy 1 the indicator starts drawing at 2300 and in strategy 2 the indicator starts at 2345.

    If the strategy and indicator code is exactly the same why are they drawing at different times?

    Please let me know what more information I can provide.

    #2
    This can be closed...I figured it out.

    Comment


      #3
      Hello, thanks for your post.

      Can you try the same thing on the SampleMACrossover strategy and see if the same difference happens? Make a copy of the SampleMACrossover and ensure to test it on the exact same data set with the exact same parameters. When I do this on my end I get matching strategy results. There must be a different parameter between your two script copies. It would be recommended then to double-check the parameters, test on a completely different data set and bar type (try a simple 1 minute chart on one day of data), or even rebuild the script from scratch to ensure each script is exactly the same.

      Please let me know if I can assist any further.
      Chris L.NinjaTrader Customer Service

      Comment


        #4
        Thanks Chris, It was an issue with EOD being checked.

        However I found a secondary issue. When I run the strategy through back test the indicator starts drawing at 2400 but when I add the indicator to a chart it starts at 2300.

        I have my time zone set to GMT -5 but live in GMT-6 could this be the root of the issue?

        Comment


          #5
          Hello, thanks for your reply.

          The strategy's start and end time is determined by the session template that is selected in the "Trading Hours" setting in the strategy analyzer. That will define exactly what the start and end of the session are. Test in the SampleMACrossover strategy for the same behavior. If you do not see the same issue on that strategy, there is something mis matched between your two scripts. Are your "BarsRequiredToTrade" parameters the same? If you Print out the timestamp data from OnBarUpdate do you see the same amount of timestamps?
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            Thanks Chris,

            Testing the Sample MA Crossover strategy doesn't help because the issue is with my custom indicator that draws a static avg. price every 2 hours. I figured out the root of the issue but don't know why it happened or how to fix it.

            After the close of trading on November 27 2020 the indicator draw setting changed. On and before Nov. 27 the indicator was drawn at 2400, 2200, 2000... At the start of the next trading day (1800 Nov. 29) the indicator started to be drawn at 1845, 2045, 2245...

            Did some sort of internal change occur within Ninjatrader between Nov.27 1200 to Nov.29 1800? Click image for larger version

Name:	AV Indicator Issue.png
Views:	143
Size:	102.7 KB
ID:	1142182

            Comment


              #7
              Further Note: If I change the start date of the strategy to October 29, 2020 or earlier the change doesn't occur. The change only occurs when the start date is between October 30 and November 27 2020 and the end date is after Nov. 27 2020

              Comment


                #8
                Hello, thanks for your reply.

                On Kinetick I have hourly time stamps all throughout November:


                I'm sorry but I can not reproduce what you are reporting. Try reducing the indicator down to see if there is a bug in there, If not, you can always delete your historical data and load new data:

                See the guide here on editing historical data in the platform:

                Removing Historical Data
                • Once the data has been deleted close NinjaTrader. Open the Documents\NinjaTrader 8\db\cache folder. Select all files then right mouse click and select “delete.”
                • Open NinjaTrader and connect to your data provider. Open a new chart.
                Please let me know if I can assist any further.
                Chris L.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                44 views
                0 likes
                Last Post jeronymite  
                Started by Barry Milan, Yesterday, 10:35 PM
                7 responses
                20 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by AttiM, 02-14-2024, 05:20 PM
                10 responses
                179 views
                0 likes
                Last Post jeronymite  
                Started by ghoul, Today, 06:02 PM
                0 responses
                10 views
                0 likes
                Last Post ghoul
                by ghoul
                 
                Started by DanielSanMartin, Yesterday, 02:37 PM
                2 responses
                13 views
                0 likes
                Last Post DanielSanMartin  
                Working...
                X