Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting question

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

    Backtesting question

    Hi,

    I'm developing a strategy that requires the instrument price to be above SMA(200). My Time Frame for backtesting is 1/1/2013-05/30/2013.
    1. From what I've read in this forum and from your help guide, actually I need to set Time frame starting day 200 days back(aprox.end of march 2012!) in order to have enough bars to calculate SMA(200)! Please confirm.
    2.If the answer for my previous question is yes what's the purpose of "Maximum bars look back" setting in the backtest panel.

    Thank you in advance,

    Dan

    #2
    Hello Dan,

    Thank you for your post.

    Correct, you will need to set the From and To date for the amount of data needed for the test.

    MaximumBarsLookBack is used to set how many bars are used for calculation, can the strategy use all the bars on the chart (Infinite) or just 256. This is not the same as the period which is the number of bars needed to calculate the values but MaximumBarsLookBack is the amount of bars on the chart that can be used for calculations.

    Please let me know if I may be of further assistance.

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello Dan,

      Thank you for your post.

      Correct, you will need to set the From and To date for the amount of data needed for the test.

      MaximumBarsLookBack is used to set how many bars are used for calculation, can the strategy use all the bars on the chart (Infinite) or just 256. This is not the same as the period which is the number of bars needed to calculate the values but MaximumBarsLookBack is the amount of bars on the chart that can be used for calculations.

      Please let me know if I may be of further assistance.
      Hi Patrick,

      Thank you for your answer. I must confess that I'm a little bit confuse here. If I need at least 200 bars to calculate SMA(200) and MaximumBarsLookBack is set to Infinite why do I still need to set From date 200 days back?
      When you say "MaximumBarsLookBack is used to set how many bars are used for calculation" what calculation are you referring to?
      When you say "This is not the same as the period which is the number of bars needed to calculate the values" what period and what values are you referring to?
      Sorry for these beginner's questions but I have a hard time understanding those settings.

      Thank you once again,

      Dan

      Comment


        #4
        Hello Dan,

        Thank you for your response.

        The Period is usually the number of bars used to calculate the indicator's values (look at the parameters of the EMA or SMA for example).

        The BarsRequired are the number of bars needed on the chart before calculation of your indicator or strategy can be done.

        MaximumBarsLookBack are the number of bars on the chart that the indicator or strategy can view.

        An example would be the following:
        I have a 20 period EMA, this means I want to calculate the value of the EMA based on 20 bars of the instrument I apply it to. This also means I am going to need at least 20 bar on the chart before this indicator can calculate (BarsRequired). MaximumBarsLookBack only plays a factor in how many bars of the chart the EMA will be plotted on per se, so if I set TwoHundredAndFiftySix then only the mist recent 256 bars will be plotted on. If I set Infinite then every bar on my chart (excluding the first 20 BarsRequired) will be plotted on.

        I hope this clears things up, please let me know if you have any further questions.

        Comment


          #5
          Thanks Patrick. Now back to my SMA(200). Do I still need to change "Min bars required" in Backtest panel to 200?

          Dan

          Comment


            #6
            Hello Dan,

            Thank you for your response.

            Correct, as your SMA is using a period of 200 bars you will need to ensure you have enough bars on the chart.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            646 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            367 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            107 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            569 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X