Download MetaTrader 5

Bar closes on the top/bottom 25% of its range

To add comments, please log in or register
Enable MQL5 Storage to store your source codes. It is free!
Gerardo Bustos
746
Gerardo Bustos 2015.05.10 21:29 

Hello forum, good day.

How could I know in MQL4 if a bar closes on the top or bottom 25% of its range? Your help will be much appreciated.

 

Best regards and thank you in advance,

Gerardo 

Gerardo Bustos
746
Gerardo Bustos 2015.05.10 21:55  
Gerardo Bustos:

Hello forum, good day.

How could I know in MQL4 if a bar closes on the top or bottom 25% of its range? Your help will be much appreciated.

 

Best regards and thank you in advance,

Gerardo 

I will try to use the following and see if it works:

 

Top 25%

double BarRange = High[shift] - Low[shift];

if ( Close[shift] >= High[shift] - ( BarRange * 0.25 ) ) return( true );

 

Bottom 25% 

double BarRange = High[shift] - Low[shift];

if ( Close[shift] <= Low[shift] + ( BarRange * 0.25 ) ) return( true );

 

Best regards and thank you,

Gerardo 

To add comments, please log in or register