Blog / Strategy
Strategy

Temporal Occupancy Drift

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?

Temporal Occupancy Drift is an original, first-principles trend-regime strategy built around a single statistical primitive — the occupation fraction of recent price — rather than any conventional indicator, chart pattern, or published trading method. Its trading style is best described as low-lag regime detection: it tries to read which side of a reference price the market has been "living on" and then acts the moment that dominance becomes decisive. The occupation fraction simply measures the share of recent bars whose close sits above a fixed reference point, so it behaves like a robust, aggregated vote on direction rather than a single-bar trigger.

The idea draws on Lévy's arcsine law, a result from probability theory. For a driftless random walk, the fraction of time the path spends on one side of its starting point is not clustered around 50% as intuition suggests — it is U-shaped, piling up near 0% or 100%. In plain terms, occupation is "metastable": a market that has recently spent most of its time above where it started tends to keep doing so longer than a coin-flip would imply, and any genuine directional drift only deepens that lean. The strategy treats a freshly-formed, strong imbalance as evidence that one side owns the recent path.

As a learning tool, Temporal Occupancy Drift is well suited to traders who want to study regime-following logic and volatility-adaptive thresholds without the lag of moving averages. Because the signal reads the sign of an entire window at once, it offers an instructive contrast to smoothed indicators. It is designed for trending or persistently directional conditions and is best approached as a study in statistical market structure — an analysis exercise, not a shortcut.

How It Works

The strategy evaluates one completed bar at a time on a single timeframe. On each newly-closed bar it recalculates its core quantities and checks for a signal. Here is the logic in plain English:

Entry conditions require a fresh cross of the band, not merely a state — this avoids chasing moves that are already mature:

Exit logic works on three fronts:

Only one position is held at a time; the strategy lets risk resolve before considering a new entry.

temporal occupancy drift MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
Window 40 10 120 Number of recent closes whose "which side of the origin" votes are counted to form the occupation fraction.
DominanceThreshold 0.30 0.10 0.60 Base dominance band on the centred imbalance g (range −1 to +1); a fresh cross of this band fires an entry.
AdaptGain 0.50 0.00 2.00 How strongly the band flexes with normalised volatility relative to its own recent mean. Higher values demand stronger consensus in noisy markets.
AtrPeriod 14 5 40 Lookback length for the in-line average true range used for risk sizing and the volatility filter.
AtrStopMult 2.00 0.50 5.00 Stop-loss distance expressed as this many ATRs from the entry price.
RewardRatio 1.50 0.50 4.00 Take-profit distance as a reward-to-risk multiple of the stop distance.
Lots 0.10 0.01 1.00 Fixed position size, in lots, for each trade.
temporal occupancy drift MT5 EA — MQL5 source code

Recommended Chart Settings

Temporal Occupancy Drift is a single-timeframe strategy — every calculation uses the chart's own symbol and period, so no multi-timeframe setup is needed. A practical starting point for study is a liquid major forex pair such as EUR/USD on a mid-range timeframe like H1 (1-hour), where the default Window of 40 bars spans a meaningful stretch of market activity and ATR-based sizing has room to breathe.

That said, the occupation concept is timeframe-agnostic, and behaviour will vary considerably across instruments and periods. Faster charts produce more frequent crosses and noisier signals; slower charts produce fewer, slower-developing regimes. Always confirm on your own data that the Window length and volatility band suit the instrument you intend to study, and remember that results will differ across changing market conditions.

How to Install on MetaTrader 5

What to Consider Before Using This EA

The main strength of Temporal Occupancy Drift is its low-lag, aggregated read on direction. Because occupation counts many binary "which side" votes across the whole window, a single noisy bar cannot flip the signal — it is a low-variance regime estimate that remains responsive because it works on unsmoothed count data rather than a lagging moving average. Trading the emergence of dominance (the band cross) instead of an already-established state is a thoughtful attempt to enter before a move is fully mature, and the volatility-adaptive band is a genuine effort to demand more evidence when the tape is choppy.

There are, however, real limitations. The underlying arcsine intuition describes driftless random walks; live markets have drift, microstructure, spreads, and news shocks that no clean theorem captures. In ranging or choppy markets, the imbalance can cross the band, trigger an entry, and then flip back through the origin quickly — producing whipsaw exits and a string of small losses. The single-position rule means the strategy can sit idle through opportunities while one trade resolves. And like any parameter-driven system, it is vulnerable to over-fitting: tuning Window, the band, and ATR settings until a backtest looks flattering rarely survives contact with unseen data. Treat every default as a starting point for research, not a validated edge.

Risk Management Tips

Sound risk management matters more than any single signal. Consider these general principles as you study this EA:

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