Exp_WPR
This EA trades based on the Williams' Percent Range (%R) indicator, entering long positions when %R indicates oversold conditions and short positions when it indicates overbought conditions. It implements a classic momentum mean-reversion strategy using WPR extremes as entry signals with configurable thresholds for buy and sell zones. The EA includes basic risk management with stop loss and take profit levels.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | +0.29% | +0.25% | 3.73% | 134 | 44.00% | 0.09 | 0.08 | 6 | +$0.22 | Reliable |
| GBPUSD | -1.20% | -1.04% | 6.47% | 136 | 47.10% | -0.19 | -0.18 | 7 | −$0.88 | Reliable |
| USDJPY | +9.17% | +7.92% | 4.64% | 136 | 49.30% | 1.70 | 1.98 | 5 | +$6.74 | Reliable |
| XAUUSD | +141.28% | +107.03% | 38.67% | 145 | 53.50% | 1.87 | 3.65 | 4 | +$96.40 | Reliable |
Profitable on 3 of 4 markets with reliable results.
Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.
Against the other Momentum EAs with a reliable result on the same market: EURUSD: better than 60% of 68 · GBPUSD: better than 52% of 66 · USDJPY: better than 97% of 68 · XAUUSD: better than 97% of 75
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 38% | +2.00% 2026-04 | -1.58% 2026-07 |
| GBPUSD | 46% | +4.93% 2026-02 | -3.12% 2026-03 |
| USDJPY | 62% | +3.70% 2026-09 | -1.77% 2026-07 |
| XAUUSD | 69% | +70.32% 2026-02 | -20.88% 2026-01 |
From the backtest equity curve, sampled about every two days; only reliable results.
Blow-up risk: No blow-up pattern found
None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.
High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →
Strategy analysis
Exp_WPR is a momentum mean-reversion trading system based on the Williams' Percent Range (%R) oscillator. Entry conditions are: open a long position when the WPR indicator enters the oversold zone (below a configurable buy threshold), and open a short position when WPR enters the overbought zone (above a configurable sell threshold). Exit conditions rely on preset stop loss and take profit levels, and may also close positions when WPR returns to neutral territory. Position sizing uses a fixed lot approach without dynamic position adjustment or money management algorithms. The strategy concept is rooted in mean reversion—expecting price to revert toward the mean when it reaches extreme levels. The EA lacks a new bar check mechanism, which could lead to multiple entries on the same candle, and it has no spread filter, making it vulnerable to slippage and false signals in high-volatility markets.
Strengths
- Simple and clear strategy logic based on the classic WPR indicator, easy to understand and verify
- Configurable overbought/oversold thresholds allow traders to flexibly adjust based on market conditions
- Includes stop loss and take profit settings, providing basic risk protection
- Uses magic number to distinguish orders, supporting concurrent operation with other EAs
- WPR is a long-validated oscillator indicator that performs well in range-bound markets
Weaknesses
- Lacks new bar check mechanism, potentially opening multiple positions on the same candle leading to overtrading
- No spread filter, which may result in unfavorable fills in high-spread market conditions
- Fixed lot sizing without money management logic cannot dynamically adjust based on account size and risk
- WPR tends to generate consecutive false signals in trending markets, leading to successive losses
- No trailing stop or partial close mechanism to lock in floating profits
Possible improvements
- Add a new bar check to prevent repeated entries on the same candle, reducing overtrading risk
- Introduce dynamic position sizing based on account balance, automatically calculating lot size according to risk percentage
Risk assessment
Overall risk: Medium
- Missing new bar check may cause multiple entries on the same candle, increasing overtrading risk
- No spread filter may result in unfavorable fills in high-spread conditions
- Fixed lot sizing doesn't adapt to different account sizes, potentially exposing small accounts to excessive risk
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
InpWPRPeriod | 14 | WPR indicator calculation period |
InpWPRBuyLevel | -80 | WPR buy threshold (oversold zone) |
InpWPRSellLevel | -20 | WPR sell threshold (overbought zone) |
InpLotSize | 0.1 | Fixed trading lot size |
InpStopLoss | 50 | Stop loss in points |
InpTakeProfit | 100 | Take profit in points |
InpMagicNumber | 12345 | EA magic number for identifying orders |
InpTimeframe | PERIOD_H1 | WPRindicator timeframe |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.