Blog / Strategy
Strategy

Swing Pivot Pin Reversal

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 Swing Pivot Pin Reversal is a pure price-action reversal strategy that combines two classic technical-analysis concepts: fractal swing pivots (which define dynamic support and resistance) and the pin bar (a single-candle rejection pattern with a long wick and a small body). Rather than relying on lagging oscillators or moving-average crossovers, this strategy reads the raw structure of the candles themselves to identify moments when price probes a key level, fails, and snaps back — a behaviour often associated with liquidity sweeps and stop-runs.

A swing pivot is simply a turning point on the chart. A fractal swing high (resistance) is a closed bar whose high is strictly greater than the highs of the bars immediately on either side of it; a swing low (support) is the mirror image. The strategy continuously tracks the most recently confirmed swing high above price and swing low below price, treating these as its active decision levels. When a candle pierces one of these levels but closes back inside it with the shape of a pin bar, the strategy interprets that as rejection — buyers defending support or sellers defending resistance.

This approach is designed primarily for range-bound and mean-reverting market conditions, where price respects horizontal levels and reverses after testing them. It is best suited to traders who want to study how support/resistance and candlestick rejection patterns can be encoded into objective, rule-based logic. As a learning tool, it offers a clear, transparent example of how discretionary price-action concepts translate into a mechanical Expert Advisor (EA). It is not a "set-and-forget" system, and it should be treated as an analytical study rather than a profit opportunity.

How It Works

The strategy evaluates the market once per completed candle (it ignores the still-forming bar), then applies a sequence of filters. Here is the logic in plain English:

swing pivot pin reversal EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
PivotLookback 3 2 6 Number of bars (K) required on each side of a candle for it to count as a fractal swing pivot. Higher values produce fewer, more significant levels.
WickRatio 0.55 0.40 0.75 Minimum size of the dominant (rejection) wick as a fraction of the candle's full range. Higher values demand a more pronounced rejection.
BodyMaxRatio 0.40 0.20 0.60 Maximum body size as a fraction of the candle's range. Lower values enforce a smaller, more indecisive body — a stricter pin-bar filter.
AtrPeriod 14 7 28 Look-back period for the Average True Range used to size the stop buffer and take-profit distance.
SlAtrBuffer 0.50 0.10 1.50 Extra distance beyond the rejection wick for the stop-loss, expressed in ATR multiples.
TpAtrMult 2.00 1.00 5.00 Take-profit distance from entry, expressed in ATR multiples.
Lots 0.10 0.01 1.00 Fixed trade volume in lots.
swing pivot pin reversal EA — MQL5 source code

Recommended Chart Settings

Because the strategy reads all bar data through the chart's selected timeframe, it will run on whatever timeframe you attach it to. Pin-bar rejection patterns at swing levels are most commonly studied on the higher intraday and swing timeframes — such as H1, H4, and D1 — where individual candles carry more weight and false signals from market noise tend to be reduced. Liquid major forex pairs (for example EUR/USD or GBP/USD) are a sensible starting point for study because their clean structure makes swing pivots easier to identify.

That said, no single symbol or timeframe is universally "correct." Behaviour can change dramatically from one instrument to another and across different volatility regimes. Always test the strategy across multiple symbols and timeframes in the Strategy Tester before drawing any conclusions, and remember that results will vary as market conditions change.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of the approach. The strategy is built on well-established price-action concepts. Its entries are objective and repeatable, removing much of the discretionary guesswork that surrounds manual pin-bar trading. Anchoring the stop to the actual rejection wick — rather than an arbitrary pip value — means the risk is defined by genuine market structure, and using ATR for both the buffer and the target lets the system adapt to changing volatility. The "one position at a time" rule keeps exposure contained and the logic easy to follow.

Known limitations. Reversal strategies, by their nature, trade against the immediate move, which means they can struggle badly in strong, sustained trends. A market that is genuinely breaking out will repeatedly sweep a level and keep going, turning what looks like a rejection into a losing fade. Pin bars and swing pivots are also somewhat subjective concepts; the WickRatio and BodyMaxRatio filters approximate them numerically, but the "right" thresholds differ between instruments and timeframes. Because only the most recently confirmed pivot is used, the active level can sometimes be stale or located at a price that is no longer meaningful.

Where it may underperform. Expect weaker behaviour during low-liquidity sessions, around high-impact news releases when spreads widen and wicks become erratic, and in choppy conditions that generate many marginal pin-bar lookalikes. The strategy may indicate a signal that historically would have reversed, yet still fail when the broader context is trending. Treat every signal as a hypothesis to be evaluated, not a certainty.

Risk Management Tips

Sound risk management matters far more than any single entry rule. Keep these general principles in mind:

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

← Back to Blog