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 Spinning Top Cluster Breakout is a price-action breakout strategy built around the spinning top candlestick pattern and the Average True Range (ATR) indicator. Instead of measuring how wide a candle is, it measures how decisive a candle is — the size of the real body relative to the full high-to-low range. A spinning top is a candle with a small body and comparatively long wicks, which signals that buyers and sellers fought to the extremes but ultimately settled near the open. In plain terms, it is a snapshot of market indecision.
This strategy is designed for ranging or balancing markets that are preparing to trend. When several spinning tops appear close together, they form what this strategy calls a "balance pocket" — a cluster of indecision where neither side has committed. The idea is that energy coils inside this pocket. The strategy then waits for a single decisive candle whose body dominates its range and closes beyond the pocket's high or low, treating that escape as the transition from balance to trend.
As a learning tool, the Spinning Top Cluster Breakout is well suited to traders who want to study candlestick microstructure and the difference between range compression and body compression. It is not a signal to expect profit; it is a structured, rules-based way to explore how indecision resolves into directional movement. Beginners can use it to understand candle anatomy, while more experienced students can study how ATR-based buffers and body-ratio filters reduce false breakouts.
How It Works
The strategy evaluates the market once per completed bar and looks for a very specific sequence: a cluster of indecision followed by a decisive escape. Here is how each piece fits together.
- Identifying spinning tops: For each candle in the lookback window, the strategy calculates the body-to-range ratio,
|Close − Open| ÷ (High − Low). If that ratio is at or belowBodyRatioMax(default 0.30), the candle is counted as a spinning top — a small body inside a larger range. - Forming the balance pocket: The strategy looks at the
ClusterWindowbars (default 6) that occurred before the most recently completed bar. It counts how many of them are spinning tops and records the highest high and lowest low of that window — the "fence" of the pocket. - Requiring enough indecision: The cluster is only considered valid if at least
MinSpinningTops(default 3) of the window bars qualify as spinning tops. If there is not enough indecision, no signal is generated. - Detecting a decisive escape candle: The bar that just completed is the breakout candidate. Its body-to-range ratio must be at or above
BreakoutBodyRatio(default 0.55), meaning the body dominates the candle — a full-commitment move rather than another hesitant bar. - Confirming the breakout direction:
- The strategy signals a long when the decisive candle is bullish (closes above its open) and closes above the cluster high plus an ATR-based buffer.
- The strategy signals a short when the decisive candle is bearish (closes below its open) and closes below the cluster low minus that same buffer.
- The ATR buffer: The
BreakBufferAtrparameter (default 0.10) adds a small clearance beyond the fence, scaled to current volatility via ATR. This is an anti-marginal-break filter — it helps ignore closes that only barely poke past the pocket edge.
Stop-loss and take-profit logic are both derived from ATR, so risk automatically scales with market volatility:
- The stop-loss is placed
AtrStopMult × ATRaway from entry (default 1.5 × ATR). For a long, the stop sits below entry; for a short, above. - The take-profit is placed
AtrTargetMult × ATRaway from entry (default 2.5 × ATR), giving a default reward-to-risk structure of roughly 2.5:1.5. - The strategy holds only one position per magic number at a time, so it will not stack multiple trades on the same signal.
Because entries only occur when indecision resolves — not merely when it is present — the design attempts to filter out much of the chop that traps range-bound traders.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| ClusterWindow | 6 | 3 | 20 | Number of completed bars before the escape bar that form the balance pocket. |
| MinSpinningTops | 3 | 2 | 12 | How many of the window bars must be spinning tops for a valid cluster. |
| BodyRatioMax | 0.30 | 0.10 | 0.50 | Maximum body-to-range ratio for a candle to count as a spinning top (indecision). |
| BreakoutBodyRatio | 0.55 | 0.40 | 0.90 | Minimum body-to-range ratio for the escape candle to count as decisive. |
| BreakBufferAtr | 0.10 | 0.0 | 1.0 | Extra clearance beyond the fence, as a fraction of ATR (anti-marginal-break). |
| AtrPeriod | 14 | 5 | 30 | Number of bars used to calculate ATR for the buffer and risk sizing. |
| AtrStopMult | 1.5 | 0.5 | 4.0 | ATR multiple used to set the stop-loss distance. |
| AtrTargetMult | 2.5 | 0.5 | 6.0 | ATR multiple used to set the take-profit distance. |
| Lots | 0.10 | 0.01 | 1.0 | Trade volume (position size) in lots. |

Recommended Chart Settings
The Spinning Top Cluster Breakout is a single-timeframe strategy — every calculation uses the chart's own symbol and period, so what you attach it to is what it trades. It was designed to be studied on major forex pairs (such as EUR/USD, GBP/USD, or USD/JPY) on intraday-to-swing timeframes like the H1 (1-hour) or H4 (4-hour) charts, where spinning-top clusters and balance pockets form clearly and ATR-based stops have room to breathe.
Lower timeframes produce more clusters but also more noise, while higher timeframes produce fewer, slower signals. Because candle-body microstructure varies by instrument and session, results will differ considerably across symbols, timeframes, and market conditions. Always test the strategy on your chosen market in a risk-free environment before drawing any conclusions.
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
What to Consider Before Using This EA
Every strategy has strengths and blind spots, and understanding both is part of using it responsibly as a learning tool.
Strengths of this approach:
- It targets a genuine, well-documented market behaviour: consolidation followed by expansion. Studying it teaches you how balance resolves into trend.
- By keying on body compression rather than range compression, it captures a different microstructure than common breakout setups such as NR7 or coiled-range breakouts. A bar can have a wide range but a tiny body — long wicks reveal a fight that pure range measures miss.
- The decisive-candle and ATR-buffer filters are designed to reject weak, marginal breaks, which historically are a major source of false signals.
- ATR-scaled stops and targets mean the risk framework adapts automatically as volatility changes.
Known limitations:
- Like all breakout systems, it is vulnerable to false breakouts — a decisive candle can clear the fence and then reverse, especially around news releases or session opens.
- In strongly trending markets that never consolidate, valid spinning-top clusters may rarely form, so the strategy can sit idle for long stretches.
- In choppy, low-volatility ranges, breakouts may repeatedly fail as price oscillates inside a broader band.
- The fixed one-position-per-magic rule means it does not scale into moves or pyramid; it is a single-shot entry model.
No parameter set performs equally well across all instruments and regimes. Treat the defaults as a starting point for study, not a finished configuration, and observe how the strategy behaves before considering any live use.
Risk Management Tips
Sound risk management matters far more than any single entry signal. As you study this strategy, keep these general principles in mind:
- Risk a small, fixed fraction per trade. Many educators suggest risking no more than 1–2% of account equity on any single position. Adjust the
Lotsparameter so your worst-case loss at the ATR stop stays within that limit. - Understand your drawdown tolerance. Even a well-designed strategy will experience losing streaks. Know how a series of consecutive stop-outs would affect your account before committing capital.
- Start on a demo account. Run the EA in a risk-free demo environment first to observe how often it trades, how it behaves in different market conditions, and whether its logic matches your expectations.
- Respect the stop-loss. The ATR-based stop exists to define and cap risk. Removing or widening it after a trade goes against you defeats the purpose of the design.
- Size positions for volatility. Because the stop distance scales with ATR, a volatile market means a wider stop and therefore a larger monetary risk at the same lot size — factor that into your sizing.
- Diversify your study. Avoid concentrating all your testing on a single pair or timeframe; observing the strategy across several markets builds a more realistic picture.
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: SpinningTopClusterBreakout.ex5 (10 downloads)
- Source Code: SpinningTopClusterBreakout.mq5 (12 downloads)
- Documentation: SpinningTopClusterBreakout.pdf (15 downloads)