So I tried to use MAX.
If I use it for volume, it works fine like in the formula below:
protected override void OnBarUpdate()
{
if (CurrentBar < 10) return;
if(Volume[0] > MAX(Volume, 20)[1])
Plot1.Set(Volume[0] );
}
But if I change it to Range(wich is an indicator), for example:
protected override void OnBarUpdate()
{
if (CurrentBar < 10) return;
if(Range[0] > MAX(Range, 20)[1])
Plot1.Set(Range[0] );
}
I get the error message: " Cannot apply indexing with [] to an expression of type 'method Group'.
So it seems that I cannot reference any indicator when using MAX.
Then I tried to name it:
double MyRange = High[0]-Low[0];
and put it in the formula but get a message saying that I cannot have a double in there.
Please, can someone help me find the way to do it?
Thanks.
Comment