Please help to fix my code MQ4 - Bars strategic

 

Hi

I do a code in mq4 to show an arrow when:


The Macd is above the 0 level line and the candlestick has the lowest closing price of the last 4, it will show a buy signal.

And when the Macd is below the 0 level line and the candlestick has the highest closing price of the last 4, it will show a sell signal.

the code is without error but it does not display what I want correctly.

How I can solve the problem ?

Please some help.


Thanks !!

Files:
4bars.mq4  7 kb
 
Marcelo Alejandro Borasi:

Hi

I do a code in mq4 to show an arrow when:


The Macd is above the 0 level line and the candlestick has the lowest closing price of the last 4, it will show a buy signal.

And when the Macd is below the 0 level line and the candlestick has the highest closing price of the last 4, it will show a sell signal.

the code is without error but it does not display what I want correctly.

How I can solve the problem ?

Please some help.


Thanks !!

Hello. Are you aware the MACD line is the red dashed line in MT platform?


 
Yashar Seyyedin #:

Hello. Are you aware the MACD line is the red dashed line in MT platform?


Hi Thanks !


I want to show the signal (Arrow up or down) when the red line is crossing the level 0 on the MACD indicator. and sometimes the indicator is not correctly counting the fourth lowest or highest close.

As a reference I take the fourth lowest or highest price close depending on where the macd is, between the last 4 candles