Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy – including backtests – does not guarantee future results. Never trade with money you cannot afford to lose.
What Is This Strategy?
The hanging man reversal strategy is a short-only, price-action swing trading system. It looks for the hanging man candlestick pattern at the top of a short-term advance and sells only after the market confirms the warning. It uses no indicators at all, so there are no moving averages, RSI or ATR. Every decision comes from the open, high, low and close of recent candles on one timeframe.
A hanging man candle has the same shape as a hammer. It has a small body near the top, a long lower wick (the thin line below the body, also called a shadow) and little or no upper wick. Where it appears is what makes it a hanging man. Buyers push price to a fresh high, sellers drive it well down inside the bar, and buyers only just pull it back to close near the top. The long lower wick suggests that supply may have appeared above the market for the first time in the run.
The Hanging Man Reversal EA is a counter-trend tool, meaning it trades against the recent direction of price. It works well as a learning tool because the rules are fully coded in the MQL5 source. You can study how a classic candlestick idea becomes objective, testable conditions.
Why the Hanging Man Reversal Strategy Waits for Confirmation
On its own, a hanging man is only a warning, and many of them appear in uptrends that keep going. So the system waits for the next candle to close below the hanging man's low. At that point, everyone who bought during that bar is holding a loss, and the logic assumes their exits may add to the selling pressure.
How It Works
The EA checks the chart once per completed candle, on the first tick of each new bar. The candle that just closed is the "confirmation candle" and the one before it is the possible hanging man. The strategy signals a short only when every condition below is true.
Step 1: A Short-Term Advance and a Fresh High
- The candles just before the hanging man must show at least MinHigherCloses (default 3) higher closes in a row.
- The hanging man's high must be the highest of the last HighLookback candles (default 10, itself included). This keeps the focus on candles at the top of a move, not halfway up it.
Step 2: The Hanging Man Candle Shape
The candle's range (high minus low) is split into body and wicks:
- Body in the top zone: the whole body, bullish or bearish, must sit within the top BodyZoneFrac of the range (default: the top third).
- Long lower wick: at least MinWickBodyRatio times the body (default 2×). A near-bodiless dragonfly doji can still qualify.
- Small upper wick: no more than MaxUpperWickFrac of the range (default 10%).
Step 3: The Confirmation Close
- The next candle must close below the hanging man's low. A close exactly at the low is not enough.
- The EA then sells at market at the Bid price (the price at which you can sell) as the new bar opens.
Stop-Loss and Take-Profit Logic
- Stop-loss: above the hanging man's high, plus StopBufferPoints (default 10). A point is the smallest price step for a symbol, so 10 points is 1 pip on a five-digit EUR/USD quote.
- If that stop is closer than the broker's minimum stop distance, the EA widens it to the minimum.
- Take-profit: RiskReward times the stop distance below entry. At the default of 2.0 ("2R"), the target is twice as far from entry as the stop.
- There is no trailing stop, break-even move or time exit. Each trade ends at its stop or target.
Position Rules
- Short trades only.
- One position at a time per symbol and magic number (an ID the EA uses to recognise its own trades). Signals that appear while a trade is open are ignored.
- A fixed lot size from Lots, rounded to the broker's volume step.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| MinHigherCloses | 3 | 2 | 6 | Higher closes in a row required before the hanging man. |
| HighLookback | 10 | 5 | 30 | The hanging man must be the highest of this many candles, itself included. |
| BodyZoneFrac | 0.333 | 0.20 | 0.50 | The body must sit inside this top fraction of the range (0.333 = top third). |
| MinWickBodyRatio | 2.0 | 1.5 | 4.0 | Minimum lower wick as a multiple of the body. |
| MaxUpperWickFrac | 0.10 | 0.0 | 0.25 | Maximum upper wick as a fraction of the range. 0.0 allows none. |
| StopBufferPoints | 10 | 0 | 100 | Points added above the hanging man's high for the stop. 0 puts it exactly at the high. |
| RiskReward | 2.0 | 1.0 | 4.0 | Take-profit distance as a multiple of the stop distance. |
| Lots | 0.10 | 0.01 | 1.0 | Fixed trade volume, adjusted to the broker's volume limits. |
The MQL5 version also has a Magic input (default 726415). Give each running copy its own value.

Recommended Chart Settings
This hanging man reversal strategy was designed for EUR/USD, GBP/USD and XAU/USD (gold) on the H1 or H4 timeframe. These are liquid markets with relatively tight spreads, and on those timeframes the wick-to-body proportions tend to be meaningful. The EA reads prices from whatever chart it is attached to, so it will run on other symbols too.
Points are not the same size on every instrument. On gold quoted to two decimals, 10 points is only 0.10 in price, so review StopBufferPoints for each symbol. Results will vary across market conditions: strong trends, quiet ranges and news-driven volatility all change how the pattern behaves.
How to Install on MetaTrader 5
- Download the .ex5 file from the link below
- Copy it to your MT5
MQL5\Expertsfolder - Restart MetaTrader 5 or refresh the Navigator panel
- Drag the EA onto a chart matching the recommended symbol and timeframe
- Configure the input parameters and enable Algo Trading
To find the folder, choose File → Open Data Folder in MT5. To read or change the logic, compile HangingManReversal.mq5 in MetaEditor.
What to Consider Before Using This EA
Strengths
- Objective rules. Vague textbook terms like "small body" become exact ratios, so every signal can be checked and repeated.
- Built-in confirmation. The close below the low filters out many hanging man patterns where the uptrend simply carries on.
- A clear invalidation point. If price climbs back above the hanging man's high, the idea has failed, and that is where the stop sits.
- Defined reward-to-risk. At 2R, a win rate of roughly one in three covers the losses in theory, before spread and commission.
Limitations
- Wide stops. Each trade risks at least the full height of the hanging man, plus however far the confirmation candle closed below it. Entry is often well below the actual top.
- Fixed lot size. Stop distance changes from trade to trade but volume does not, so the money at risk varies.
- A short-term trend definition. Three higher closes is a small move. In a strong rally, counter-trend shorts may be stopped out repeatedly.
- Spread effects. Shorts close at the Ask price, so the spread eats into the stop buffer, especially around news or the daily rollover.
- Infrequent signals. The filters are strict, and a backtest with few trades can be misleading.
Historically, a hanging man trading strategy tends to struggle in persistent uptrends with few pullbacks and in choppy ranges where new highs fade straight away.
Risk Management Tips
- Size positions from the stop distance. A common guideline is to risk no more than 1-2% of your account per trade. This EA uses fixed lots, so lower Lots until a typical stop-out stays within that limit.
- Start on a demo account. Run it for several weeks to learn how often it trades and how wide its stops are, without real money at stake.
- Understand drawdown. Drawdown is the fall in equity from a peak to a later low. With a 2R target, several losses in a row are normal. Decide in advance how much you can accept.
- Include all costs. Spread, commission and swap (the overnight financing charge) all reduce results, especially on H4, where trades may stay open for days.
- Avoid over-optimisation. Settings tuned to fit past data, known as curve fitting, often fail on new data. Check changes on a separate period.
- Watch correlated exposure. EUR/USD and GBP/USD often move together, so running both can double your US dollar exposure.
Risk Warning
Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.
Downloads
- Expert Advisor: HangingManReversal.ex5 (0 downloads)
- Source Code: HangingManReversal.mq5 (0 downloads)
- Documentation: HangingManReversal.pdf (0 downloads)