Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

APIs to test Strategy across Data Series?

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

    APIs to test Strategy across Data Series?

    We are using strategy trading on Forex. When we implement an update to strategy, we want to be able to get a sense if the strategy is working or not across 30+ currency pairs and across different periods at a very high level.

    Currently as far as I know, the only way to test is to manually go through the currency pairs on the chart, apply the strategy and check the historical performance.

    We would like to automate the backtesting against a basket of instruments across different periods. I am wondering if there are programmatic APIs to execute a strategy against a dataseries, and access strategy performance?

    Thanks,
    Jonathan


    #2
    Hello jonfan45,

    Thanks for your post.

    From your description, I would suggest using the Strategy analyzer where indeed you can test all of the instruments at once. Using the Strategy optimizer section, you could run the optimizer on the data series where you can specify the range of time frames you wish to test. The end result of all analysis would be a performance report.

    Please see the help guide here: https://ninjatrader.com/support/help...y_analyzer.htm
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Paul,

      we also use strategy analyzer for optimization and parameter sweep. In our case, we track around 35 cross currency cross pairs, plus currency futures which add the time dimension. Currently we manually change the instruments and DataSeries (plus the future contract month) and the time range for Strategy Analyzer and/or Strategy execution on a chart, which is quite a laborious process.

      I went through the document you sent, and I am unable to find mentions on how to test across instruments. Can you please elaborate how we can test all the instruments at once in the Strategy Analyzer?

      Best,
      Jonathan

      Comment


        #4
        Hello Jonathan,

        Thanks for your reply.

        You can find that topic in the link I previously provided, here is a direct link to that page for your convenience: https://ninjatrader.com/support/help...asket_test.htm

        In the strategy analyzer, when you select the Instrument, you can choose an instrument list that contains the list of instruments to test. You can configure your own list of instruments.

        I've attached an example that shows the analysis of the Sample MA Crossover strategy on the dow 30 instruments.

        Click image for larger version

Name:	jonfan45-2.PNG
Views:	39
Size:	167.0 KB
ID:	1138609

        Here is a link to the help guide on creating instrument lists: https://ninjatrader.com/support/help...ment_lists.htm
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thanks much Paul. I think Instrument list is the vehicle I needed.
          I think that would work great for the currency cross pair case.

          For futures where there is a time element to it, is there is way to tie in the time element to each instrument?
          For example, Dow 03-20 has a settlement date of 03/20/2020 where as Dow 06-20 has a settlement date of 06/29/2020. Ideally, we want to set up all those futures contracts as instrument with the corresponding period depending on the settlement date.

          Thanks,
          Jonathan

          Comment


            #6
            Hello Jonathan,

            Thanks for your reply.

            "For futures where there is a time element to it, is there is way to tie in the time element to each instrument?
            For example, Dow 03-20 has a settlement date of 03/20/2020 where as Dow 06-20 has a settlement date of 06/29/2020. Ideally, we want to set up all those futures contracts as instrument with the corresponding period depending on the settlement date."


            For what purpose are you trying to do this, what is the goal?

            From a backtest perspective, with futures, you can specify the current contract and set the start date as far back as you wish (as you have data for). As your strategy processes the bars, when the roll date is reached the data is auto shifted to the contract in effect at the time of the roll date.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Thanks Paul for the clarification, I did not know that the continuous contract has a way to stitch past data across settlement boundaries.
              I will give it a try!

              Best,
              Jonathan

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by varsha, Today, 06:33 PM
              0 responses
              6 views
              0 likes
              Last Post varsha
              by varsha
               
              Started by NtFan, Today, 04:12 PM
              1 response
              8 views
              0 likes
              Last Post NtFan
              by NtFan
               
              Started by futurenow, Today, 01:44 PM
              2 responses
              38 views
              0 likes
              Last Post voltation  
              Started by Gerik, Today, 12:44 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Jim  
              Started by autogenix, Today, 01:01 PM
              3 responses
              20 views
              0 likes
              Last Post NinjaTrader_Emily  
              Working...
              X