Clarifying "Maximum Bars Back" Setting W/Multiple Data Sets

Questions about MultiCharts and user contributed studies.
User avatar
furytrader
Posts: 353
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 215 times

Clarifying "Maximum Bars Back" Setting W/Multiple Data Sets

Postby furytrader » 06 Jan 2011

Here's an odd question I came across in my programming - perhaps someone here on the forum will know the answer:

Let's imagine you have a chart that has two data sets on it:

Data Set 1 = a 1 minute bar
Data Set 2 = a 15 minute bar

As part of a trading strategy (not an indicator), you have to calculate a 9 bar moving average based on data set 2. Here's my question: should the "Maximum Bars Back" setting be set to 9, even though during the time required to accumulate sufficient data to calculate a 9 bar moving average based on 15 minute data, there would have to also be 135 1-minute bars (data set 1?)

For some reason, this confuses me - thanks for any ideas!

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 485 times

Re: Clarifying "Maximum Bars Back" Setting W/Multiple Data S

Postby Dave Masalov » 11 Jan 2011

Dear furytrader,

You should set "Maximum Bars Back" the following way: first data series should be enough for 9 bars of data2, i.e. 135 bars if the symbol ticks every minute.

User avatar
furytrader
Posts: 353
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 215 times

Re: Clarifying "Maximum Bars Back" Setting W/Multiple Data S

Postby furytrader » 11 Jan 2011

Dave,

Thanks for your response.

What confuses me is this: if I run this setup and set the MaxBarsBack setting to "5", MultiCharts generates an error, saying that the program is trying to go back further than the MaxBarsBack setting. However, if I set it to 9 (assuming the moving average on data set 2 is set to 9), no error happens. Since 9 is less than the 135 bars you recommended in this scenario, does that mean that the historical backtesting results generated with a MaxBarsBack setting of 9 are wrong or incomplete?

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 485 times

Re: Clarifying "Maximum Bars Back" Setting W/Multiple Data S

Postby Dave Masalov » 11 Jan 2011

Dear furytrader,

I apologize for misinformation. Backtesting results generated with a MaxBarsBack setting of 9 are correct. You can indicate a minimum value which is enough for every data series. The calculations' start date on the chart is chosen when every data series has enough bars for calculations.


Return to “MultiCharts”