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

Backtest strategy on different currencies with different time frames

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

    Backtest strategy on different currencies with different time frames

    1. If I want to backtest my strategy with major forex pairs with 1 min, 5min, 15 min, 1 hour, 4 hour charts, and shows the results respectively for different currencies and different time frames, what should I do?

    2. For 1, if I want to see the profit and loss for each month from start time to end time, how to achieve that?

    #2
    Hello jack1234,

    Thanks for writing in.

    You could run multiple instances of your strategy within the Strategy Analyzer to create performance reports for your strategy using those parameters.

    Additionally, you can use an optimization backtest to automatically iterate through all instances that you wish to test. You would not be able to specify a different data series for optimization iterations, so you can either run those optimization beck tests separately, or you can add parameters that will only allow the strategy to perform within a certain period.

    For example, you could specify a starting month as a parameter and have that starting month iterate for each optimization iteration.

    For more information on running an optimization backtest, please refer to the help guide documentation here: https://ninjatrader.com/support/help...a_strategy.htm

    Please let me know if you have any additional questions.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks, for different currency pairs, we can use https://ninjatrader.com/support/help...asket_test.htm, but for different timeframes, what could we do specifically so that we can test all the time frames in one go?

      Comment


        #4
        Hello jack1234,

        Any behaviors that you would like to be iterated through an optimization back test will need to be controlled by parameters so they can be modified by the optimizer.

        To be able to test multiple data series in an optimization backtest, you will have to statically add the data series' to your strategy and add parameters that determine what data series you would like to trade with.

        Each data series added with AddDataSeries() will be referenced in by a 1, 2 or 3 for BarsInProgress and BarsArray for each data series added.

        We have sample code that demonstrates how to use an additional data series here:

        You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by


        Further information can be found in the documentation on creating NinjaScripts for Multi-Time Frame & Instruments:



        If you have any further questions, please don't hesitate to ask.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by nandhumca, Today, 03:41 PM
        0 responses
        4 views
        0 likes
        Last Post nandhumca  
        Started by The_Sec, Today, 03:37 PM
        0 responses
        3 views
        0 likes
        Last Post The_Sec
        by The_Sec
         
        Started by GwFutures1988, Today, 02:48 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by ScottWalsh, 04-16-2024, 04:29 PM
        6 responses
        33 views
        0 likes
        Last Post ScottWalsh  
        Started by frankthearm, Today, 09:08 AM
        10 responses
        36 views
        0 likes
        Last Post frankthearm  
        Working...
        X