In this article, we explore the automation of the Cypher harmonic pattern in MQL5, detailing its detection and visualization on MetaTrader 5 charts. We implement an Expert Advisor that identifies swing points, validates Fibonacci-based patterns, and executes trades with clear graphical annotations. The article concludes with guidance on backtesting and optimizing the program for effective trading.
The Cypher pattern is a harmonic trading formation defined by five key swing points—X, A, B, C, and D—and exists in two forms: a bullish pattern and a bearish pattern. In a bullish Cypher, the structure forms a low-high-low-high-low sequence where point X is a swing low, point A a swing high, point B a swing low, point C a swing high, and point D a swing low (with D positioned below X). Conversely, a bearish Cypher forms a high-low-high-low-high sequence, with point X as a swing high and point D positioned above X. Below are the visualized pattern types.
Kyle Young Sangster #: Hey there, great article. Thank you for your hard work. Could you share the completed code file? Attach it at the end of the article?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Check out the new article: Automating Trading Strategies in MQL5 (Part 15): Price Action Harmonic Cypher Pattern with Visualization.
In this article, we explore the automation of the Cypher harmonic pattern in MQL5, detailing its detection and visualization on MetaTrader 5 charts. We implement an Expert Advisor that identifies swing points, validates Fibonacci-based patterns, and executes trades with clear graphical annotations. The article concludes with guidance on backtesting and optimizing the program for effective trading.
The Cypher pattern is a harmonic trading formation defined by five key swing points—X, A, B, C, and D—and exists in two forms: a bullish pattern and a bearish pattern. In a bullish Cypher, the structure forms a low-high-low-high-low sequence where point X is a swing low, point A a swing high, point B a swing low, point C a swing high, and point D a swing low (with D positioned below X). Conversely, a bearish Cypher forms a high-low-high-low-high sequence, with point X as a swing high and point D positioned above X. Below are the visualized pattern types.
Bullish Cypher Harmonic Pattern:
Bearish Cypher Harmonic Pattern:
Author: Allan Munene Mutiiria