LIMITATION: MaxBarsBack for multiple data streams  [SOLVED]

Questions about MultiCharts and user contributed studies.
Zheka
Posts: 198
Joined: 13 Jan 2016
Has thanked: 8 times
Been thanked: 48 times

LIMITATION: MaxBarsBack for multiple data streams

Postby Zheka » 13 Jul 2017

There is a *nuance* in MC which makes life unnecessarily harder.

Say, you have 1 min bars as Data1 and need it 200-300 bars ago - for an indicator.
But you also have Weekly bars as Data2 - for gauging a 20-Week ATR.

Then, you might not have enough data to backtest, since a Maxbarsback setting of 250+ (needed for Data1) will also apply to Data2!

There can obviously be a smarter approach, automatically calculating and checking for the CALENDAR Max (Maxbarsback of data1, maxbarsback of data2).

Would be great to have this corrected!

User avatar
JoshM
Posts: 2099
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1526 times
Been thanked: 1503 times
Contact:

Re: LIMITATION: MaxBarsBack for multiple data streams

Postby JoshM » 17 Jul 2017

Say, you have 1 min bars as Data1 and need it 200-300 bars ago - for an indicator.
But you also have Weekly bars as Data2 - for gauging a 20-Week ATR.

Then, you might not have enough data to backtest, since a Maxbarsback setting of 250+ (needed for Data1) will also apply to Data2!
Not necessarily I think. If you code the 200-300 bars ago indicator with one of the `Symbol_*` keywords (like Symbol_Close), then that calculation can be performed independent from the MaxBarsBack setting. The script then will not wait 200-300 bars before calculating.

That means the 20-bar Data2 calculation can happen after 20 bars, and then after 200-300 bars the other computation can happen on Data1. I'm not sure if this workaround will help you in your case, but might be an idea while you wait on a different implementation of MaxBarsBack in MultiCharts.

Zheka
Posts: 198
Joined: 13 Jan 2016
Has thanked: 8 times
Been thanked: 48 times

Re: LIMITATION: MaxBarsBack for multiple data streams  [SOLVED]

Postby Zheka » 17 Jul 2017

Thank you, Josh!

I somehow never explored the Symbol_* functionality....It actually did the trick!

Nevertheless, I think the current implementation of MaxBarsback is to be corrected.


Return to “MultiCharts”