Max Bars Back & 2 Instruments  [SOLVED]

Questions about MultiCharts and user contributed studies.
TrendFirst
Posts: 36
Joined: 23 Nov 2015
Has thanked: 14 times
Been thanked: 6 times

Max Bars Back & 2 Instruments

Postby TrendFirst » 09 Sep 2018

I have a chart with 2 data streams; Data1 is a 5000 tick chart, and Data2 is a daily chart. Data2 is used for a filter, while buy/sell signals are generated on Data1. My question is: Which data stream does Max Bars Back apply to? It seems to apply to different streams under different circumstances. I would expect it to apply to the primary data stream, Data1.

But this does not seem to be the case. Say Max Bars Back is set to 50. When a strategy is applied to Data1, no trades are generated for 50 days - so it is operating on Data2, the daily stream. I reset the Max Bars Back to 5, thinking 5 days would be plenty on the 5000 tick stream. The maximum bars I need on the 5000 tick data is 20, which is much less than 5 days.

Then I run an optimization, and I get an error saying Max Bars back is not set high enough. So the optimization process obviously applies Max Bars Back to Data1.

In the case of two data streams, shouldn't the application of Max Bars Back be consistently applied to one data stream or the other?

User avatar
ABC
Posts: 587
Joined: 16 Dec 2006
Has thanked: 117 times
Been thanked: 330 times
Contact:

Re: Max Bars Back & 2 Instruments  [SOLVED]

Postby ABC » 10 Sep 2018

TrendFirst,

it applies to both data streams. In other words you should see no trades until the max bars back are sufficient for the highest time frame you are using in your code and you will run into the error message when any of the length inputs in your code that require a look back (even if it's only applied to the shortest time frame) of more bars that set up as max bars in the properties.

Regards,

ABC
These users thanked the author ABC for the post:
TrendFirst


Return to “MultiCharts”