Discussing the article: "Automating Trading Strategies in MQL5 (Part 53): Double Top and Double Bottom Reversal Model"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Automating Trading Strategies in MQL5 (Part 53): Double Top and Double Bottom Reversal Model.
We build an MQL5 program that detects and trades Double Top and Double Bottom patterns from confirmed swing pivots with rule-based logic. The detector matches peaks within a tolerance, derives the neckline, and applies leg-balance and spacing filters to reject weak shapes. It supports entry on a neckline break or an optional pullback, with a stop beyond the extreme and targets by measured move or reward-to-risk.
A double top and a double bottom are the market's way of failing twice at the same price. In a double top, price rallies to a high, pulls back, and rallies again to roughly the same high before turning down, and the failure of that second push to make new ground signals that buyers are exhausted. The double bottom is the mirror image: two troughs at about the same low, where sellers fail to break lower the second time and control passes back to buyers. The line drawn through the reaction point between the two peaks is the neckline, the level the whole pattern hinges on, because the pattern is only complete once price closes through it.
A rule-based approach outperforms visual judgment because it turns each subjective decision into a parameter. Peak matching becomes a tolerance scaled by pattern height, and leg balance compares bar counts on each leg to reject lopsided shapes. Spacing and an optional prior-trend requirement filter out peaks too close together or patterns that appear mid-range with nothing to reverse. Once a pattern passes the filters, the anchors are explicit: the neckline is the trigger, the paired extreme anchors the stop, and the neckline-to-extreme distance defines the target. The break of the neckline confirms the reversal, and an optional pullback to the retested level offers a second, often better-priced entry. The general strategy architecture is shown below.
Author: Allan Munene Mutiiria