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

Bug Report: backtesting timeframes, various results

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

    Bug Report: backtesting timeframes, various results

    Dear NinjaTrader-Team,
    I have two questions regarding backtesting/optimizing:
    • If I backtest my strategy from 2010-2020 I have an outcome of +170k gains. If I backtest it from 2005-2020 the profit between 2010 and 2020 shrinks to +130k gains. Why is that? Does the results get more accurate the smaller the timeframe?
    • I can't seem to set a backtesting timeframe from 2005-2010. No matter which numbers I punch in, the backtest will always take that timeframe (3 months, 5 years,...) and keep the end date at August 2020. Is that because the futures have been rolled over?
    Thanks in advance!
    Jörg

    #2
    Okay, i figured the second problem out: when i connect to my demo account it works fine. Unfortunately it cancels the live sim trading at my other computer which the support earlier said would work -.-

    Comment


      #3
      Hello demo362740,

      Backtesting in the Strategy Analyzer will follow the historical data and logic in the script. Changing the data available or the start and end dates will change when orders are placed and will change the performance.

      To understand why the orders are being placed when they are or are not being placed, use TraceOrders to see when orders are being submitted, ingnored, cancelled, or rejected. Use Print() to see when conditions are or are not evaluating as true.

      Below is a link to a forum post that demonstrates using prints to understand behavior.


      The Sim101 for sim trading is a local account on the local computer. These are not on a server and are not affected by other computers. You may be placing orders to a live demo and not to the Sim101 account.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hi Chelsea!
        Thank you so much for responding!
        Originally posted by NinjaTrader_ChelseaB View Post
        Changing the [...] start and end dates will change when orders are placed and will change the performance.
        Sorry, that doesn't make sense to me. If I start the backtest at 2005, 2010 or 2015 shouldn't impact the performance in 2019 or 2020 imo. Also it's always becoming less. (It feels like it's just getting more inaccurate.) Could you explain how that works? Or can I read about it somewhere? I use the TraceOrder but I was hoping that I don't have to look into the detail of 200+ trades. I overlayed the charts in Photoshop once and it seems like it's only messing up the major movements, then it's going parallel until the next big movment. (And as those big moves are usually to the upside (the Stop to the downside is quite tight), it kinda messes it up...?) But maybe it's also only the big movements you can see because the gap is becoming much wider...?

        If the Sim101 is on my local computer only how does it get the recent data? Doesn't it need to connect to download it? (If I leave it offline it seems to only have data until August 2020 though it shows it having more under the Data tab. Sorry for being such a pain; I just would really like to understand if it's working (or if I can make it work) the way I need it before throwing money at it

        Comment


          #5
          Hello demo362740,

          If an order opens a position that would have been opened later, that will change the open. If the exit uses logic that relies on when the entry was placed (like bars since entry), this will also change the close. Yes, adding data can change all of the positions after, however this depends on the logic in the script and the settings for the strategy and data series.

          Printing the output tells you for sure what is going on.
          Below is a link to a forum post about comparing results.
          Citizens of the NinjaTrader Community, A common question we hear from clients is 'why are results from backtest different from real-time or from market replay?'. Live orders are filled on an exchange with a trading partner on an agreed upon price based on market dynamics. Backtest orders are not using these market dynamics.


          The Sim101 account does not provide data. This is an account that uses the simulation engine to fill orders locally on the computer. The data will come from the connected connection. Either a data provider like Kinetick, which does not provide a brokerage account and is data only, or a brokerage connection with a data subscription (however the brokerage account would not be selected in the Account drop-down).


          Historical data is downloaded or imported from file. Real-time data requires a connection to a real-time broker or data feed.


          The Simulated Data Feed provides fake, self-generated, real-time data and does not provide historical data. This self-generated real-time data is not real data from the market.



          To view your account balance on the Accounts tab of the Control Center or trade with any connected brokerage account you must:
          • Have a live license key (either Single Broker, Multi-Broker, or Free)
          • Have this license entered into NinjaTrader under Help -> License Key
          • Have Global Simulation Mode Disabled
            - In NT7 click File -> uncheck Global Simulation Mode
            - In NT8 click Tools -> uncheck Global Simulation Mode
          Once a live license key has been entered and the connection to the brokerage is established the live account will appear on the Accounts tab of the Control Center.

          With Global Simulation Mode disabled, you can select any live account in the Account drop-down of a trade window such as ChartTrader or the SuperDOM or in the parameters of a NinjaScript Strategy. Orders will be placed to the account that is selected in the Account drop-down of the trade window.

          Purchase Options - Single Broker

          The best value when purchasing NinjaTrader is to select one of our lifetime purchase options. Alternatively you can also lease our software for a period of time that makes sense to you. We make purchasing NinjaTrader easy by providing you a choice in how you access our software...choose a plan that suits you best!

          Learn more about our purchase options!

          Please note, after a NinjaScript Strategy has been enabled, do not change the Account selection.

          Instead, add a new instance of the strategy to the Strategies window in the Configured area, and select the live account for that new instance. You can also choose to leave the Sim101 instance if you would like.
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by funk10101, Today, 12:02 AM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by GLFX005, Today, 03:23 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by nandhumca, Yesterday, 03:41 PM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by The_Sec, Yesterday, 03:37 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by vecnopus, Today, 06:15 AM
          0 responses
          1 view
          0 likes
          Last Post vecnopus  
          Working...
          X