array out of range in

 

Hi,

How can I fix this fatal error?

_Price_High = MathRound( ( High[Highest ( NULL, 0, MODE_HIGH, Bars - MODE_HIGH, 2 )] * (1 / Point) ) * 2 );
_Price_Low  = MathRound( ( Low [Lowest  ( NULL, 0, MODE_LOW,  Bars - MODE_LOW,  2 )] * (1 / Point) ) / 2 );
//---
fatal error: 'array out of range in'

Thanks. 

 
Max Enrik:

Hi,

How can I fix this fatal error?

_Price_High = MathRound( ( High[Highest ( NULL, 0, MODE_HIGH, Bars - MODE_HIGH, 2 )] * (1 / Point) ) * 2 );
_Price_Low  = MathRound( ( Low [Lowest  ( NULL, 0, MODE_LOW,  Bars - MODE_LOW,  2 )] * (1 / Point) ) / 2 );
//---
fatal error: 'array out of range in'

Thanks. 

remove the "- MODE_HIGH" and "- MODE_LOW" after the Bars for start, but the error is not (just) in that.

You should post the whole code (not just those two lines), since this way it is not visible where the error comes from

 
Mladen Rakic:

remove the "- MODE_HIGH" and "- MODE_LOW" after the Bars for start, but the error is not (just) in that.

You should post the whole code (not just those two lines), since this way it is not visible where the error comes from

Thanks.

After remove them, runs good so far. 

Reason: