Blog / Strategy
Strategy

Directional Majority Pullback

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 Directional Majority Pullback strategy is a trend-continuation system built around a genuine statistical hypothesis test — the one-sample binomial sign test applied to candle colour. Instead of measuring how big recent price moves are, it counts how many candles closed bullish (Close above Open) versus bearish (Close below Open) over a fixed window, then asks a single categorical question: is the majority of recent candles pointing the same way more often than random chance can explain? This is a fundamentally different lens from the moving averages, momentum oscillators, and MACD-style tools that dominate most trend filters.

Why does that distinction matter? Almost every popular trend filter reacts to the magnitude of price moves, and magnitude is exactly what gets distorted by outliers. A single oversized bar can flip a mean-based measure and trigger a whipsaw. The sign test throws magnitude away entirely — one giant spike bar counts exactly the same as a tiny one, because only the direction (sign) of each candle is recorded. That makes the regime read robust to volatility shocks, gaps, and news spikes. When enough candles agree, the strategy classifies the market as being in a statistically significant "up regime" or "down regime."

This EA is best understood as a learning tool for traders who want to study how a categorical, outlier-resistant filter behaves compared with conventional magnitude-based indicators. It is designed for liquid, trending markets — think EURUSD, XAUUSD (gold), or a major index on the M15 to H1 timeframes — and it combines the statistical regime filter with a disciplined two-stage pullback entry and a structured risk model. It is suitable for intermediate traders and students of algorithmic design who want to see how a hypothesis test can be turned into a practical trading rule.

How It Works

The strategy operates on completed candles only, evaluating its logic once per newly closed bar and managing any open position on every tick. Here is the full sequence in plain English.

The regime filter (the sign test):

The two-stage pullback entry:

This two-stage design means the strategy signals entries on a dip that resumes, rather than chasing an already-extended run.

Stop-loss logic:

Take-profit and trade management:

directional majority pullback MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
MajorityLookback 20 8 60 Number of candles the sign test is computed over.
MajorityZ 1.5 0.5 3.0 Minimum sign-test z-score required to call the directional bias statistically real.
TrendEmaPeriod 50 20 200 Period of the baseline EMA used as a which-side-of-price confirmation.
ArmMaxBars 5 1 15 Maximum bars a shallow-dip arm stays valid before it is abandoned.
AtrPeriod 14 5 40 Lookback period for the ATR volatility measure.
StopSwingBars 4 2 12 Bars scanned for the structural swing extreme that anchors the stop.
StopAtrMult 0.50 0.0 2.0 ATR multiple added as padding beyond the swing extreme for the stop.
MaxRiskAtr 3.0 1.0 8.0 Setups whose risk exceeds this ATR multiple are skipped.
RewardRisk 2.0 1.0 5.0 Take-profit distance as a multiple of the trade's risk.
BreakevenR 1.0 0.3 2.0 Profit (in risk-multiples) at which the stop moves to break-even.
TrailAtrMult 1.5 0.5 4.0 ATR multiple used to trail the stop once break-even is reached.
Lots 0.05 0.01 1.0 Fixed position size in lots.
Magic 5271 0 9,999,999 Unique identifier so the EA manages only its own trades.
directional majority pullback MT5 EA — MQL5 source code

Recommended Chart Settings

This strategy was designed with liquid, trending markets in mind — EURUSD, XAUUSD (gold), or a major stock index — on the M15 to H1 timeframes. Nothing about the symbol or timeframe is hardcoded, however: every calculation uses the primary timeframe of the chart the EA is attached to, so it will run on whatever timeframe your backtest or chart selects.

As always, behaviour will vary significantly across different symbols, timeframes, and market conditions. A window and z-threshold that suit one instrument may need adjustment for another. Treat the defaults as a starting point for study and testing, not as a fixed prescription.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of the approach. The most distinctive feature is the outlier resistance of the sign test. Because only candle direction is counted, a single fat-tailed spike bar cannot hijack the regime read the way it can with mean- or momentum-based filters. The two-stage arm-and-trigger entry adds discipline by requiring a dip and a confirmed resumption, which historically helps avoid buying at over-extended extremes. The risk model is deliberately conservative — skipping wide-risk setups, capping to one position, and trailing only in the direction of profit — which is engineered to keep drawdown contained.

Known limitations. The sign test discards magnitude, and that cuts both ways. A market can print many small same-colour candles that clear the significance threshold while going almost nowhere in price terms, producing signals in low-energy conditions. The filter also says nothing about where in a larger structure the trend sits, so it can arm continuations late in a mature move. Like all trend-continuation systems, it is vulnerable to choppy, range-bound markets where a "significant majority" forms and then immediately reverses — the strategy may signal an entry just as the regime evaporates.

Where it may underperform. Sideways or mean-reverting regimes, illiquid symbols with erratic candle formation, and very low timeframes dominated by spread and noise are all environments where this style of filter tends to struggle. The confirming EMA and the risk cap help, but no filter eliminates whipsaws entirely. Study its behaviour across varied conditions before drawing conclusions.

Risk Management Tips

Sound risk management matters more than any single entry rule. Consider these general principles as part of your education:

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