Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Back Testing - date filters not working

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

    Back Testing - date filters not working

    Hello,

    I've ran into a problem when I was back testing my strategies. I notice the performance didn't change once I extended the look back period beyond a certain point (about a month). Am I doing something wrong? I'm using either TOS or NT for my data. Tested it on multiple simple strategies and am still getting the same results. It is acting as though it is not recieving enough data...

    Any help would be appreciated

    #2
    Hello Kensonprib,

    If the strategy is in the Strategy Analyzer, is the full range of data appearing on the Chart Display of the Strategy Analyzer?
    It may be that the historical data is not available depending on the data type.


    Can you open a separate chart and load the full data range?

    If the data is available, use prints to debug the script.
    Print the time of the bar, and all variables and values above the condition sets that trigger the entry.

    Below is a link to a forum post that demonstrates using prints to understand behavior and includes links to videos.
    https://ninjatrader.com/support/foru...121#post791121

    Save the output from the NinjaScript Output window (right-click the output window -> Save As) and include this with your next post. Also, what specific dates does the data start and end?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Chelsea,

      I am able to load a chart which displays as far as I may ever want to go. I chose 400 days and it populated. When I attempted to load my strategy onto that same chart I would click apply and nothing would happen. It would act as through it was about to load it but never would. When I use a shorter period it stops calculating after 45 trading days. So today it ended on Jan 25. Anything beyond that and it displays the same performance with no warning that the full time period was not included.

      As for using prints, I am not familiar with how to do that so I will need to do a little more research on that request. With that said, I really don't believe there is anything wrong in the code itself seeing how it preforms flawlessly in the shorter timeframes. I am thinking that the NT processing memory is maxing out. Are there performance limits placed on non-paid accounts by chance? I am still trying to determine whether this platform will be worth the investment and that is difficult to do if it is limiting my ability to back test.

      Kenson

      Comment


        #4
        Hello Kenson,

        There are no performance limitations with any license type including simulation or free.

        Does the SampleMACrossover included with NinjaTrader have the same behavior?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hey Chelsea,

          I was able to replicate the issue using the SampleMACrossover. These are the steps I took.

          Step 1. I opened a chart with AAPL for 400 days, applied the SampleMACrossover strategy and enabled. Everything loaded correctly.
          Step 2. I opened the Strategy Analyzer and performed a back test on AAPL with the SampleMACrossover strategy. In doing so I ran the test for the month of Jan 2021 and the result was a 9.98% return.
          Step 3. I then adjusted the start date multiple times, running the test again each time, and would get the same 9.98% result. This continued until I got to Jan 26th where the return fell to 7.5%.

          I am connected to the "simulated data" available through NT. I experienced the same thing when pulling data from TD Ameritrade. Attached is a snapshot of the other settings for the back test.

          What worries me as a user is that had I not run multiple timeframes I would never have never known that NT was not taking into account the whole of January. I would just have assumed I got 9.98%. There are no warnings say "hey! we were not able to process your request for your specified timeframe." or "You cannot perform this back test for your specified dates."

          Are you able to replicate this issue?
          Attached Files

          Comment


            #6
            Hello Kensonprib,

            The Simulated Data Feed provides real-time data only, and cannot be used for backtesting with the Strategy Analyzer.


            Data will be loaded from the connected historical data provider. You will need to be connected to a provider that provides the data for the data type and instrument type.

            Below is a link to the help guide on supported connection types and the types of data available.


            Does the data you want to test over show as completely loaded in the Tools -> Historical Data window in the Historical section?

            In the Strategy Analyzer on the Chart Display what is the first bar's time and date?

            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I think we have found the problem.

              Within the Tools -> Historical Data window it only goes back to Jan 26, 2021. See attached.
              This is also true when I look at the chart within the Strategy Analyzer.

              I will follow your link and review the supported connection types and the types of data available. If I need further assistance I will check back in on this thread.

              I do find it odd though that when opening a chart and then applying the strategy that my requested 400 days of historical data DOES load... odd..

              Comment


                #8
                Hello Kensonprib,

                Connect back to TDA, and try downloading the historical minute data in the Historical Data window on the Load tab.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Chelsea,

                  I reconnected to TDA, I went to the load tab and entered my criteria (see attached), and clicked download. The looked as though it downloaded something but I haven't the foggiest idea where it downloaded to. I then went back to the "Edit" tab and expanded the symbol I downloaded and nothing had changed (see attached). Did I do something wrong? Is there a next step?

                  Kenson
                  Attached Files

                  Comment


                    #10
                    Hello Kensonprib,

                    Are you using NinjaTrader 8.0.24.1? (Help -> About)

                    This may be a limitation of the data available from TD Ameritrade.

                    May I have you delete it and re-download?

                    On the Edit tab, right-click AAPL (where the symbol is to get the entire section) -> click Remove.

                    Double check the connection is still connected and you are using the latest version and try downloading again.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      I do have NT version 8.0.24.1

                      I tried deleting the old data (successful), checked my connection to TD Ameritrade (still connected), I then reloaded it and it only loaded a portion of February to the present.

                      Why would it limit this minute data when it loads 400+ days of minute data when viewing a chart? Anything else we can try?

                      Comment


                        #12
                        Upon closer examination, looks like TDA only provides me with around a months worth of historical minute data. Is there a good source for this minute back testing data I can tie into. I review the options you sent over but am curious to know if there is a "most common" and "most reliable" option.

                        Comment


                          #13
                          Hello Kensonprib,

                          That may be a limitation of the TD Ameritrade API or may be as much data as TDA has on their historical data servers. It would be necessary to contact TDA to find out.

                          However, if you are opening a new chart, I would not expect the chart to load any more data than is showing is available in the Historical Data window.
                          If this is the case, I would want to schedule a call to see for myself, as that would be unexpected.

                          A Kinetick subscription has minute and day data usually as far back as the instruments have been recorded. Tick data goes back 180 days.
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Ya, the chart only shows what has been loaded into the Historical Data Window. Would be happy to schedule a call. How do we do that?

                            Also, I have connected to Kinetick (end of day - free version) and was unable to pull any data from it. It would be good to have someone walk me through that to see what I am doing wrong.

                            Kenson

                            Comment


                              #15
                              Hello Kenson,



                              The Kinetick End of Day (Free) connection provides end of day data (daily bars) and does not provide real-time data or historical minute or tick data.

                              As previously mentioned, a Kinetick subscription would provide this. Below is a publicly available link to the Kinetick subscription page.


                              The chart loads the data that shows as in the historical data window. Previously, you stated that the chart has more data than the historical data window, which would not be expected and I would need proof of.

                              If the chart is loading the data in the historical window, then it is working as it is supposed to. A call would not be necessary as there would be nothing to fix.

                              Do you have an issue we need schedule a call about?

                              I will not be able to cause TD Ameritrade's servers to have more data...
                              Chelsea B.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by stafe, 04-15-2024, 08:34 PM
                              7 responses
                              31 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by adeelshahzad, Today, 03:54 AM
                              4 responses
                              29 views
                              0 likes
                              Last Post adeelshahzad  
                              Started by merzo, 06-25-2023, 02:19 AM
                              10 responses
                              823 views
                              1 like
                              Last Post NinjaTrader_ChristopherJ  
                              Started by frankthearm, Today, 09:08 AM
                              5 responses
                              17 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by jeronymite, 04-12-2024, 04:26 PM
                              3 responses
                              43 views
                              0 likes
                              Last Post jeronymite  
                              Working...
                              X