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!
LIMITATION: MaxBarsBack for multiple data streams [SOLVED]
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: LIMITATION: MaxBarsBack for multiple data streams
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.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!
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.
Re: LIMITATION: MaxBarsBack for multiple data streams [SOLVED]
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.
I somehow never explored the Symbol_* functionality....It actually did the trick!
Nevertheless, I think the current implementation of MaxBarsback is to be corrected.