I have coded an indicator(indi2) that calulates values based on another indicator (indi1).
Whenever indi1 doesn't contain values, indi2 automatically uses Close-values instead.
That's absolutely unwanted and it seems like it's
a problem due to the indicator class in general.
I want indi2 not to be calculated if values for indi1 do not exist. Is there a way to switch
that automatic use of Closes off?
Here is an example to illustrate the problem:
indi1:
if (CurrentBar>=200)
{
Plot0.Set(1);
}
else
{return;}
Applied to a chart the indicator plots nothing before bar no. 200, after it it plots 1.
indi2:
Plot0.Set(Testindi1()[0]);
I would expect and want indi2 to do the same as indi1.
But what happens is that the value of the current Close is plotted before bar number 200.
Any suggestions to get rid of/suppress that behaviour?
Thanks in advance,
Stephan
Comment