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 on 2 computers with different results

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

    Same strategy on 2 computers with different results

    I develop strategies on one computer and run them on another so I can develop a strategy while still having it running and gathering data. I have noticed that when backtesting that each computer gets different results, even though the scripts and parameters are identical.

    I have uploaded two pictures. Each one uses the same strategy and same parameters but are from different computers. You can notice that, among other things, the total net profit and sharpe ratio are vastly different. I compared the scripts using notepad++ compare tool so I know they are the same.

    Any ideas what could cause this?





    Click image for larger version

Name:	2.png
Views:	178
Size:	288.4 KB
ID:	1263697
    Click image for larger version

Name:	1.png
Views:	205
Size:	108.5 KB
ID:	1263696

    #2
    Yes - most likely it is that the data included in the test is different. Try copying the entire Documents -> NinjaTrader 8 -> db folder from one computer to the other, then repeat the test with both computers in offline mode (not connected to any data feed connection) and including only complete trading days (certainly not including the current incomplete day, but also not including any days that were incomplete when the data was downloaded). Additionally, check to make sure you have not modified the instrument definition for AUDUSD on either computer, and that the definitions are identical.

    One way to narrow down such problems if you can't otherwise figure it out is to go through the trade list for each and see what trades are different, and then look at those trades on a chart on each side. This process will likely help you understand e.g. if one computer is missing some bars, or has different ticks in it, etc.
    Last edited by QuantKey_Bruce; 08-09-2023, 05:15 AM.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Hello Jeffsg605,

      Thanks for your post.

      QuantKey_Bruce is correct. There is likely a difference in the historical data that you are backtesting on which would cause different results to occur when comparing the backtest between the two computers.

      As a general rule for backtesting: Same data + Same strategy code and parameters = Same results.

      You could follow the advice QuanyKey_Bruce provided to make sure that the historical data in your Documents\NinjaTrader 8\db folders on each computer are the same and retest the script on both machines.

      Or, you could try re-downloading the historical data on both machines and compare the historical data in the Tools > Historical Data window to ensure the historical data matches. Then, retesting the script on each machine.

      Discrepancies between backtesting and realtime data — https://ninjatrader.com/support/help...ime_vs_bac.htm

      Comparing real-time, historical, and replay performance — https://ninjatrader.com/support/foru...d.php?t=102504
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        Interesting, I'll give that a try this weekend. Thank you very much for this information.

        Comment


          #5
          It looks like the historical data between both computers is different. I tried to download historical data but after doing that twice on each machine, they are still different. I attached a picture of one
          instance of NT which is missing several months of data. When I try to download just those months, nothing happens. How can I fix this?

          Click image for larger version

Name:	3.png
Views:	164
Size:	8.3 KB
ID:	1264118

          Comment


            #6
            Hello Jeffsg605,

            Are you connected to a paid Kinetick subscription for this Forex data?

            Are you connected to a brokerage such as Interactive Brokers or Forex.com?

            Are both computers connected to the same data feed?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I am connected to Forex.com. I bought the 3rd party add on, enabled multi provider checkbox, they are both connected to the same data feed.
              I am able to download Day data fine, just not Minute data.

              Comment


                #8
                Hello Jeffsg605,

                Thanks for your notes.

                We cannot guarantee that a specific amount of Historical minute data is available from the Forex.com connection as this is determined by the brokerage.

                You should contact Forex.com directly to inquire about how much Historical minute data they provide with their connection.
                Brandon H.NinjaTrader Customer Service

                Comment


                  #9
                  Understood, thanks

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by rbeckmann05, Today, 06:48 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post rbeckmann05  
                  Started by rhyminkevin, Today, 04:58 PM
                  4 responses
                  52 views
                  0 likes
                  Last Post dp8282
                  by dp8282
                   
                  Started by iceman2018, Today, 05:07 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post iceman2018  
                  Started by lightsun47, Today, 03:51 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post lightsun47  
                  Started by 00nevest, Today, 02:27 PM
                  1 response
                  14 views
                  0 likes
                  Last Post 00nevest  
                  Working...
                  X