Download MetaTrader 5

array out of range in

To add comments, please log in or register
Max Enrik
942
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. 

Mladen Rakic
57489
Mladen Rakic  
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

Max Enrik
942
Max Enrik  
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. 

To add comments, please log in or register