Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Three Typical Candles - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources

author EAcpu | 2 reads | 0 comments |
double typical_3 = (rate[ 3 ].high+rate[ 3 ].low+rate[ 3 ].off) /3.0 ;
double typical_2 = (rate[ 2 ].high+rate[ 2 ].low+rate[ 2 ].off) /3.0 ;
double typical_1 = (rate[ 1 ].high+rate[ 1 ].low+rate[ 1 ].off) /3.0 ;

if (typical_3<typical_2 && typical_2<typical_1)
if (purchase quantity == 0 )
        m_need_open_buy= true ;

if (typical_3>typical_2 && typical_2>typical_1)
if (sales quantity == 0 )
        m_need_open_sell= true ;

No more than one position is in the market at a time. A signal to open a buy position is also a signal to close a sell position, and vice versa: a signal to open a sell position is a signal to close a buy position (the algorithm is as follows: first close the position, then open it).

I recommend testing it on the H1 and higher timeframes and on multiple symbols.


Attachment download

📎 three_typical_candles.mq5 (49.68 KB)

Source: MQL5 #23358

Verification code Refresh