Blog / Strategy
Strategy

First Passage Drift Bias

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 First Passage Drift Bias strategy is a directional trend-detection Expert Advisor (EA) for MetaTrader 5 built on first-passage-time theory, a concept borrowed from the mathematics of stochastic processes rather than from any conventional chart indicator or candlestick pattern. Instead of reading moving averages or oscillators, it treats the closing-price series as a random path and measures how long that path takes to travel a fixed distance up versus down. The core idea is that a truly efficient, driftless market reaches an equal-sized up-barrier and down-barrier in roughly the same amount of time — while a market under genuine directional pressure reaches the aligned barrier sooner. That timing gap becomes the trading signal.

In plain terms, the strategy is designed for markets that may be developing a directional drift — a subtle, persistent lean in one direction that isn't always visible in raw price movement. Because the signal is built from the timing of price moves rather than their raw size, it is intended to distinguish a steady one-way grind (a strong, tradeable bias) from a violent spike that quickly retraces (noise). This makes it conceptually different from ordinary momentum systems.

As a learning tool, First Passage Drift Bias is best suited to intermediate and advanced traders who want to study how statistical models of drift can be turned into entry and exit rules. It is not a "set and forget" money machine — it is an analytical framework worth studying to understand how first-passage timing, robust volatility scaling, and censoring can be combined into a systematic trading model.

How It Works

The strategy processes one newly-closed bar at a time and rebuilds its statistic on each new bar. Here is what happens step by step:

first passage drift bias EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
Lots 0.10 0.01 1.00 Trade size in lots for each position opened.
AnchorCount 40 15 100 Number of past closes used as first-passage anchors — the sample size for the bias estimator.
Horizon 12 4 40 Forward horizon, in bars, over which each anchor's up- and down-barrier may be reached.
ThresholdMult 1.50 0.50 4.00 Barrier size θ as a multiple of the median absolute one-bar close change.
BiasEntry 0.30 0.05 0.70 Minimum hitting-time asymmetry ` A ` required to open a trade.
AtrPeriod 14 5 40 ATR period used for stop-loss and take-profit sizing.
AtrSlMult 2.00 0.50 6.00 Stop-loss distance as a multiple of ATR.
AtrTpMult 3.00 0.50 8.00 Take-profit distance as a multiple of ATR.
first passage drift bias EA — MQL5 source code

Recommended Chart Settings

The First Passage Drift Bias EA is symbol- and timeframe-agnostic by design — it derives everything from raw OHLC (open, high, low, close) data and runs on whatever single timeframe you attach it to. That said, the default parameters (40 anchors, a 12-bar horizon) suit an intraday-to-swing rhythm, which makes the H1 (1-hour) timeframe on a major, liquid forex pair such as EUR/USD a sensible starting point for study. Higher timeframes like H4 will produce fewer, slower signals; lower timeframes like M15 will produce more frequent but noisier ones.

Because the barrier scales to each market's own median volatility, the model adapts across instruments, but that does not mean it behaves identically everywhere. Results will vary considerably across symbols, timeframes, and changing market conditions. Always test any configuration on historical data and a demo account before drawing conclusions.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of the approach. The most interesting quality of First Passage Drift Bias is that it measures timing rather than magnitude. A steady, one-directional grind reaches its aligned barrier quickly from nearly every anchor, producing a large |A|, whereas a sharp move that later retraces reaches both barriers at similar times and scores close to zero. Because the statistic is built from ordinal hit-times rather than return sizes, it is naturally robust to fat-tailed single-bar spikes and is invariant to the absolute price level. The median-based volatility scale and the censoring mechanism further add discipline, automatically damping the signal when the market is quiet.

Known limitations. First-passage theory assumes a reasonably well-behaved path, and real markets frequently violate those assumptions — gaps, news shocks, and sudden volatility regime shifts can all distort the estimate. Because the model only ever holds one position and enters at market, it can miss opportunities during fast, one-way runs and can be whipsawed when the bias hovers near the entry threshold. The active-exit rule that closes on a bias flip protects against staying wrong, but it can also exit a good trade prematurely during normal pullbacks.

Where it may underperform. Choppy, mean-reverting, range-bound conditions are the hardest environment for any drift detector: barriers get hit in both directions at similar times, |A| stays small, and the strategy will mostly stand aside — which is correct behavior, but means long idle stretches. Conversely, in a violently volatile market the ATR-based stops can become very wide, increasing the monetary risk per trade. This is a framework to study and understand, not a guaranteed edge.

Risk Management Tips

Sound risk management matters far more than any single entry signal. Keep these general principles in mind as you study this strategy:

Risk management is what allows you to survive long enough to learn. Treat it as the first priority, not an afterthought.

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