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 Range Center Bias Trend strategy is a price-only, trend-following expert advisor (EA) for MetaTrader 5 that trades on a custom oscillator the author calls the range-center bias, filtered by an Exponential Moving Average (EMA) trend baseline. An EMA is a moving average that weights recent prices more heavily, giving a responsive read on the prevailing direction. What makes this strategy unusual is that it deliberately ignores the closing price of each candle. Instead, it studies where the middle of a bar's high-low range sits relative to that same bar's opening price — a way of measuring the intrabar pressure that price exerts away from where each session began.
Most candle-based systems key off the close: body flow, engulfing patterns, close-location measures, and so on. Range Center Bias Trend takes a different angle. For every bar it calculates (High + Low) / 2 − Open. If a bar spends most of its life probing above its open, that value is positive; if it keeps getting pressed below its open, it is negative — regardless of where the candle eventually closed. Averaged over a window and normalized by the Average True Range (ATR) — a standard volatility measure — this produces a smooth, regime-independent reading of persistent directional pressure that typically oscillates between roughly −1 and +1.
As a learning tool, this strategy suits traders who want to study trend-following logic, oscillator construction, and stop-and-reverse position management without relying on any off-the-shelf named indicator. It is designed with liquid intraday markets in mind, such as EUR/USD or XAU/USD (gold) on the M15 to H1 timeframes, but it is not locked to any single symbol. This is a strategy analysis intended to help you understand how the mechanics fit together — not a profit opportunity.
How It Works
The EA acts once per closed bar, so signals are evaluated on completed candles rather than on every incoming tick. On each new bar it rebuilds its measurements and checks the entry, management, and exit rules in sequence.
Building the signal:
- The strategy computes ATR over the
AtrPeriodwindow using a simple average of true range (a gap-aware volatility measure), which is used to normalize the bias and to size stops. - It averages
(High + Low) / 2 − Openover the lastBiasPeriodbars, then divides by ATR to produce the normalized bias,biasNorm. - It maintains an EMA of closing prices over
TrendPeriodbars as a broader trend filter.
Entry conditions (the strategy signals a trade when):
- Long:
biasNormcrosses up through the positiveThreshold(breaking out of the neutral band) and the closing price is above the EMA. Both the intrabar pressure and the broader trend must agree. - Short:
biasNormcrosses down through the negativeThresholdand the closing price is below the EMA.
A "cross" means the previous bar's reading was on one side of the threshold and the current bar's reading is on the other — this ensures the strategy reacts to fresh breaks rather than to a level that has already been held for many bars.
Position management and exits:
- Stop-and-reverse: If the EA is long and the bias breaks down through the negative threshold while price is below the EMA, it closes the long and immediately opens a short (and vice versa). This keeps the position aligned with the dominant pressure.
- Bias-collapse exit: If the bias simply falls back through zero while long (or rises back through zero while short), the strategy closes the position. The reasoning is that the intrabar pressure which justified the trade has disappeared, so the trade thesis is no longer valid.
Stop-loss and take-profit logic:
- Every entry carries a protective stop placed at
ATR × StopMultaway from the entry price. Because it scales with ATR, the stop automatically widens in volatile conditions and tightens in calm ones. - The take-profit is set at
stop distance × RewardRatio, giving a fixed reward-to-risk ratio on every trade (1.8 by default, meaning the target is 1.8 times the stop distance).

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| BiasPeriod | 20 | 5 | 60 | Number of bars used to average the range-center bias. Longer values smooth the oscillator; shorter values make it more reactive. |
| Threshold | 0.15 | 0.02 | 0.60 | Half-width of the neutral band, in ATR units. The bias must break beyond this level to trigger a trade. Higher values demand stronger pressure. |
| TrendPeriod | 50 | 10 | 200 | Period of the EMA trend baseline used to confirm signal direction. Larger values track the longer-term trend. |
| AtrPeriod | 14 | 5 | 40 | Lookback for the self-computed ATR that normalizes the bias and sizes the stop. |
| StopMult | 2.0 | 0.5 | 5.0 | Protective stop distance as a multiple of ATR. Higher values give wider stops. |
| RewardRatio | 1.8 | 0.5 | 5.0 | Take-profit distance as a multiple of the stop distance, setting the reward-to-risk ratio. |
| Lots | 0.10 | 0.01 | 1.0 | Fixed order volume in lots. Should be adjusted to your account size and risk tolerance. |
The EA also uses a Magic number (default 7361) internally to identify and manage only its own positions, which matters if you run multiple EAs on one account.

Recommended Chart Settings
Range Center Bias Trend was designed with liquid intraday markets in mind — for example EUR/USD or XAU/USD (gold) — on the M15 to H1 timeframes. Because the bias is ATR-normalized, the oscillator behaves consistently across different volatility regimes, and the EA runs on whatever timeframe the chart is set to at run time rather than forcing a fixed one.
That said, no single setting is universally optimal. Trend-following behavior, spread costs, and the character of intrabar pressure differ from symbol to symbol and from one market period to the next. Results will vary across different instruments, timeframes, and market conditions, so treat the defaults as a starting point for your own study rather than a finished configuration.
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
Strengths of this approach. The range-center bias offers a genuinely different lens on price action, focusing on intrabar positioning rather than the close, which can capture directional pressure that close-based tools miss. Normalizing by ATR makes the signal comparable across volatility regimes, and the dual filter — requiring both a fresh bias break and EMA agreement — helps avoid taking momentum signals that fight the broader trend. The ATR-scaled stop and fixed reward ratio impose a consistent, pre-defined risk structure on every trade.
Known limitations. Like all trend-following systems, this strategy may struggle in choppy, range-bound markets, where the bias can whipsaw across the threshold and generate a string of losing entries or repeated stop-and-reverse flips. The EMA trend filter reduces but does not eliminate this. Because the stop-and-reverse logic can flip positions quickly, sideways conditions may produce frequent turnover and accumulate spread and commission costs. The strategy also acts only on closed bars, so it will not react to sharp intrabar moves until the candle completes.
Where it may underperform. Expect weaker behavior during low-volatility consolidation, around major news spikes that gap through stops, and on illiquid symbols with wide spreads relative to the ATR-scaled stop distance. As always, thorough forward testing on a demo account across varied market conditions is essential before drawing any conclusions.
Risk Management Tips
- Size positions responsibly. The default of 0.10 lots is arbitrary; adjust volume so that a stop-out costs only a small, planned fraction of your account.
- Never risk more than 1–2% of your capital on a single trade. Use the ATR-based stop distance to calculate an appropriate lot size for your account, rather than trading a fixed lot blindly.
- Test on a demo account first. Run the EA in a risk-free simulated environment for an extended period to understand how it behaves in trending versus ranging markets before considering any live capital.
- Understand drawdown. Every strategy endures losing streaks. Know the maximum historical drawdown you are willing to tolerate and stop if it is breached.
- Diversify and monitor. Do not rely on a single EA, symbol, or timeframe, and keep an eye on open positions rather than assuming full automation removes the need for oversight.
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: RangeCenterBiasTrend.ex5 (5 downloads)
- Source Code: RangeCenterBiasTrend.mq5 (7 downloads)
- Documentation: RangeCenterBiasTrend.pdf (18 downloads)