Need Help to make this indicator works

 

Hi,

I need help to make this indicator works.

The idea here is to get a Buy signal alert only once at the opening of a new candle each time the following conditions happens : 

- First condition - The Open price of the alert candle is above the MA 

- Second condition - both of the last two candles are Bear candles (Open>Close) and the previous third candle is a Bull candle (Open<Close)


To the sell signal is the inverse setup.


As you can see in ths example image, the arrows marks the candles where the signals should be showed when those candles open.

Setup


Please, see the attached file 

Thank you for your help. 

Files:
 
Francisco Duarte: I need help
Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help
          urgent help.

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum

Reason: