Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest with Daily Data

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

    Backtest with Daily Data

    Hello,

    I would like to backtest a multi-timeframe strategy but as soon as I choose one timeframe to be of PeriodType.Day nothing happens.

    Even when using a single-timeframe test-strategy that simply prints some text on the output window for each bar, it only works as long as I choose PeriodType.Minute and nothing will appear on the output screen for a day period.

    My database contains minute and daily data and after discovering this behaviour in NT7 I exported the data and imported them into NT6.5 with the same results. What is the reason behind that?
    Not being able to backtest for day timeframes would be a bit of a pain..

    Also, exporting data from NT7 puts 5 zeros on each volume value in the data txt file. NT6.5 will then complain about too large values and removing all the zeros is a pain as well. Hmm, maybe that belongs in a different thread (NT7 bugs?).

    Thanks for your input on that!

    #2
    Hello greg814,

    Can you please backtest the SampleMACrossOver on historical daily data that is available in the database. Does it reflect any results once finished?

    What historical daily data do you have available and what historical daily data is used during the backtest (instrument and time period)?

    In addition, what instrument data did you export when 5 zero's were added to volume data? When I export historical daily data for a futures instrument (6E), it does not add any zero's to the text file.

    Comment


      #3
      Hello NinjaTrader_Jason,

      it's the same for the SampleMACrossOver - many results for a minute period and none for the day period.

      I'm mainly trying to find out if I can use NT for trading my FOREX strategies at this stage and I am testing on $EURUSD, $EURCAD and $AUDJPY. I imported minute data from TradeStation and downloaded daily data from Kinetick. I made sure I am only backtesting for a period that is covered by the data in my database.

      I have noticed before that for currencies the volume value (which I don't require anyway) is often times not available and is set to 1 which results in a lot of 10000s in the exported file. For the last few months Kinetick seems to provide larger values (between 70k-140k) and that's when adding zeros causes error messages.

      Comment


        #4
        Can you please select the Trades or Chart tab and check if you see any trades listed. When I connect to Kinetick (free end-of-day) and perform a backtest on the EURUSD using the SampleMACrossOver, it does display results.

        As per the 5 zero's, I can reproduce it on my end as well. Upon further investigating, I noticed volume already has 5 zero's when you download it from Kinetick. It is not displayed in the Historical Data Manager since the column is not wide enough. Please enlarge the column and you will see the values with 5 zero's.
        Attached Files
        Last edited by NinjaTrader_Jason; 06-30-2010, 04:29 AM.

        Comment


          #5
          Ok, running the backtest in NT7 when connected to Kinetick does the job. That brings up a few more questions:

          1) Why can I not backtest "offline" on the data in the database. Isn't that one of the reasons for a database that you don't have to be connected to a data provider?

          2) Exporting the daily data from NT7 and importing into NT6.5 doesn't work then. I tried it again, just to make sure. Since I know of no other free FOREX EOD data provider does that mean I simply cannot backtest on NT6.5 as long as I only use TradeStation input which only supports minute data? Is there a work-around (e.g. a different free FOREX EOD provider or the possibility to connect to Kinetick on NT6.5)?

          3) Say, the answer to 2) is no. No big deal, then I backtest only on NT7. BUT, since NT7 crashes still a fair bit (at least on my machine) I run the actual real-time strategies on NT6.5. Does the above issue also imply that the daily data I import into NT6.5 will not be processed properly when running a strategy in realtime, meaning e.g. I won't get pivots from daily data but from minute data?

          Thanks for your input.

          Comment


            #6
            1. You should be able to backtest on historical data in the database as well. When I test it on my end, I do see results. Could it be the strategy would not trigger any orders as per the historical daily data that is available. When I backtest the SampleMACrossOver strategy up to 1/1/2010, it lists only 4 trades in total.

            2. Unfortunately not. Kinetick is not supported in NinjaTrader 6.5. You would need to connect to a supported connectivity provider that supports historical daily data.


            3. I am not sure if I follow. If you run a strategy in real-time on minute data, it does not use daily data. The daily data does not import because of the error, so there is no historical daily data available.

            In addition, please see the following link for information on how our Pivots indicator is calculated.

            Comment


              #7
              Daily & 1 Minute Data

              Hi, to pick up from greg814's question, I am using the DAILY 200MA as one set of data and 1 minute as a second set. One of my rules is that if the close of the latest 1 min bar is UNDER the DAILY 200MA, then short, if it is above, then do nothing. On backtesting using the simulated environment, I cannot do 2 things:
              1) Get the 200 DAILY filter to work, it for some reason defaults to 200MA on a 1 minute basis.
              2) Get the chart to display the 200MA DAILY and the 1min data at the same time.
              Any help appreciated. I am using NT6.5 and also have an IB connection available.
              Thanks
              MKT

              Comment


                #8
                Hello MKT,

                You will need to debug your strategy so it will use the desired moving average and for it to display in the chart. You can find general debug information at the link below.

                Comment


                  #9
                  Hi Jason - Do you really think that a debugging strategy is the most thorough way to problem solve in this case? I don't. What about bars array? What about suggesting that the multiple time frame strategy needs to refer to the daily and minute data in the script correctly....?

                  Comment


                    #10
                    Unfortunately I am not a programmer and not very familiar with NinjaScript. All I can respond is to debug your strategy, so it will function as you like. If you have any specific NinjaScript inquiries, please let me know and I will forward your request to a NinjaScript colleague.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by NullPointStrategies, Today, 05:17 AM
                    0 responses
                    44 views
                    0 likes
                    Last Post NullPointStrategies  
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    124 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    65 views
                    0 likes
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    42 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Started by TheRealMorford, 03-05-2026, 06:15 PM
                    0 responses
                    46 views
                    0 likes
                    Last Post TheRealMorford  
                    Working...
                    X