access of data2 affects the calculation on data1

Questions about MultiCharts and user contributed studies.
cnbiz850
Posts: 33
Joined: 15 Oct 2012
Has thanked: 1 time
Been thanked: 1 time

access of data2 affects the calculation on data1

Postby cnbiz850 » 19 Oct 2012

My data1 is 1-minute bars since 1/4/2011, data2 is daily bars also since 1/4/2011.

When the code is as follows, it plots the indicator nicely.

Code: Select all

Inputs: NL(500);
vars: MidPS(0);
MidPS = AverageFC((h+l)/2, NL);
plot1(MidPS, "MidPS");
But when I added some calculation on data2, it has problems.

Code: Select all

Inputs: NL(500);
vars: MidP(0), MidPS(0);
MidPS = AverageFC((h+l)/2, NL);
if (Date <> date[1]) then begin
MidP = ((h+l)*0.5) of data2;
end;
plot1(MidPS, "MidPS");
If I left MaxBars to be "auto detect", the subchart shows "computing" and never plots the indicator.
If I set MaxBars to be 600 for instance, it complains about "not enough series length".

If I change NL to be 300, then it only plots a small part of the entire timespan.

Am I missing something here?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: access of data2 affects the calculation on data1

Postby Henry MultiСharts » 23 Oct 2012

Hello cnbiz850,

With the current MultiCharts implementation in User Defined bars back mode with multiple data series the study will wait for the specified amount of bars on the highest data resolution that is referenced in the code.
Example: If you are referencing data2 in your code with user defined max bars back=500 and data2 is 1 day bars then the study will require 500 daily bars for calculation.

We are looking into improving this behavior.

cnbiz850
Posts: 33
Joined: 15 Oct 2012
Has thanked: 1 time
Been thanked: 1 time

Re: access of data2 affects the calculation on data1

Postby cnbiz850 » 23 Oct 2012

Henry,

Thanks for the reply. I hope the matter can get quickly resolved. As it stands, the multiple timeframe feature falls short of expectations.


Return to “MultiCharts”