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

DoubleZigZag - MetaTrader 5 Expert | Forex Indicators Download - MT4/MT5 Resources

author EAcpu | 4 reads | 0 comments |

DoubleZigZag - expert for MetaTrader 5

DoubleZigZag - expert for MetaTrader 5

The author of the idea is Maxim , and the author of the mq5 code is Barabashkakon .

The Expert Advisor uses two ZigZag indicators for analysis: a smaller ZigZag parameter ( 13.5,3 ) and a larger ZigZag with parameters multiplied by eight: (13*8,5*8,3*8 )

 //--- Create a handle for the indicator iCustom handle_iCustom = custom ( symbol (), period (), "Example\\ZigZag" , 13 , 5 , 3 ); //--- if the handle is not created if (handle_iCustom== INVALID_HANDLE )
    {
//--- Inform of failure and output error code print format ( "Unable to create handle of iCustom indicator for symbol %s/%s, error code %d" ,
symbol (),
Enumeration to string ( period ()),
getLastError ());
//--- The indicator stops returning early ( initialization failed );
    } //--- Create handle of indicator iCustom handle_iCustomX8= custom ( symbol (), period (), "Example\\ZigZag" , 13 * 8 , 5 * 8 , 3 * 8 ); //--- if handle is not created if (handle_iCustomX8== INVALID_HANDLE )
    {
//--- Inform of failure and output error code print format ( "Unable to create handle of iCustomX8 indicator for symbol %s/%s, error code %d" ,
symbol (),
Enumeration to string ( period ()),
getLastError ());
//--- The indicator stops returning early ( initialization failed );
    }

To make a trading decision, the two legs of the last peak of the larger ZigZag ( 13*8,5*8,3*8 ) are analyzed, while the analysis of the smaller ZigZag ( 13,5,3 ) contained in these two legs is counted.

If a signal is received to open a buy position, all sell positions will be closed. Vice versa: if a signal to open a position is received, all long positions will be closed.

EA trading parameters:

DoubleZigZag - expert for MetaTrader 5

Larger zigzags (13*8,5*8,3*8) are shown in red, smaller zigzags (13,5,3) are shown in yellow.

Respectively, ABC is the peak of a larger zigzag correction wave (13*8, 5*8, 3*8).

Leg AB and AC contain the nine peaks of the smaller Zigzag (13,5,3).

EURUSD,M1 test results:

DoubleZigZag - expert for MetaTrader 5


Attachment download

📎 doublezigzag.mq5 (31.14 KB)

Source: MQL5 #18629

Verification code Refresh