Mean reversion · EA-013 · v1.00
PipFix SpikeFade
Fades exhaustion spikes back towards the mean
Backtest
XAUUSD · M15 · 2024-09-01 to 2026-09-01
- Net profit
- $992
- Profit factor
- 1.26
- Relative drawdown
- 7.03%
- Trades
- 84
- Win rate
- 55.95%
- Modelling quality
- 98%
Test conditions. Symbol XAUUSD, timeframe M15, 2024-09-01 to 2026-09-01, initial balance $10,000, spread 1 minute OHLC, modelling quality 98%, run on Exness-MT5Real39. Past results do not predict future results.
Publish gate
| Criterion | Measured | Needs | Result |
|---|---|---|---|
| Closed trades ≥ 80 | 84 trades | >= 80 | Pass |
| Profit factor ≥ 1.15 | 1.260 | >= 1.15 | Pass |
| Relative drawdown ≤ 25% | 7.03% | <= 25% | Pass |
| Modelling quality ≥ 90% | 98.00% | >= 90% | Pass |
| Out-of-sample not a catastrophe | true | true in stats.json | Pass |
| Curve not carried by one trade | true | true in stats.json | Pass |
Download
The EA and its set file are free. You just need to be signed in. There is no payment, no checkout and no licence for anything in this library. An account exists so downloads can be rate limited, and so you can be told when an EA you have taken is updated.
Waiting behind the sign-in: ea.ex5 · PipFix_SpikeFade_XAUUSD_M15_BACKTESTED.set
How it works
**Fades exhaustion spikes back towards the mean**
* Product name: `PipFixSpikeFade`
* File: `PipFix_SpikeFade.ex5`
* Category: Mean reversion
* Default timeframe: M15
* Validated symbol: XAUUSD M15 (the only symbol walk-forward validated — see the measured result above)
* Magic number: 8850112
* Martingale / grid / averaging: **NO - none, ever**
* Stop Loss + Take Profit: **attached to every order at the moment it is opened**
* Branding: `pipfixalgo.com` watermark locked to the chart
---
## Measured backtest result
| | |
|---|---|
| Tested on | **XAUUSD M15** |
| Backtest period | **2024.09.01 to 2026.09.01** |
| **Length of the test** | **24 months of market data** |
| Net profit on 10 000 USD | **992.11 USD** |
| Average monthly return | **0.39%** (compounded, over the 24 months) |
| Maximum drawdown | **6.57%** |
| Profit factor | **1.26** |
| Trades | 84 |
Full report, screenshots and the exact settings file: `Backtest/BACKTEST_RESULTS.md`
## 1. What this robot does
Markets overshoot. When a single bar travels far more than the market's normal range for that timeframe, it is usually the tail end of a rush of orders rather than the start of a new trend - and price tends to give part of it back. This robot measures every bar against ATR, waits for one that is oversized, and then takes the first bar that closes back against it, with RSI confirming the move was stretched.
## 2. Exact trading rules
1. A spike bar is one whose body is at least 1.2 x ATR and no more than 4.0 x ATR.
2. Bodies larger than 4 x ATR are ignored - that is a news detonation, not an overshoot.
3. BUY after a down spike when the next bar closes higher than it opened and RSI is below 45.
4. SELL after an up spike when the next bar closes lower than it opened and RSI is above 55.
5. Stop Loss = 1.5 x ATR, Take Profit = 2.0 x ATR, no trailing - the move is meant to be short.
## 3. Risk management built in
| Protection | What it does |
|---|---|
| Percent risk sizing | Lot size is calculated from `InpRiskPercent` and the real stop distance, so every trade risks the same fraction of the balance. |
| Fixed lot mode | Set `InpUseRiskPercent = false` to use `InpFixedLot` instead. |
| Hard lot cap | `InpMaxLot` can never be exceeded, whatever the balance. |
| One position rule | `InpMaxOpenTrades` (default 1) - no stacking, no averaging down. |
| Daily loss stop | Trading halts for the rest of the day after `InpDailyLossStopPct` percent loss. |
| Daily trade cap | `InpMaxTradesPerDay` limits overtrading (0 = unlimited). |
| Spread guard | No entry while spread is above `InpMaxSpreadPoints`. |
| Break-even | Stop moves to entry after `InpBE_ATR` x ATR of profit. |
| ATR trailing stop | Locks in profit as the move extends. |
**No martingale guarantee.** The position size function of this EA reads only the account balance, the
risk percent and the stop distance. It never reads the result of the previous trade, so a loss can
never increase the next lot size. There is no grid, no hedge basket and no recovery multiplier
anywhere in the code.
## 4. Parameters
| Parameter | Default | Meaning |
|---|---|---|
| `InpTF` | `15` | Working timeframe |
| `InpAllowLong` | `true` | Allow BUY trades |
| `InpAllowShort` | `true` | Allow SELL trades |
| `InpUseStrategyExit` | `false` | Close early on opposite signal |
| `InpMinSpikeATR` | `1.2` | Spike bar body must be at least ATR x this |
| `InpMaxSpikeATR` | `4.0` | Ignore bodies bigger than ATR x this (news shock) |
| `InpRSIPeriod` | `14` | RSI period |
| `InpRSIBuyMax` | `45.0` | RSI must be below this to fade a down spike |
| `InpRSISellMin` | `55.0` | RSI must be above this to fade an up spike |
| `InpNeedReversalBar` | `true` | Require the next bar to close against the spike |
| `InpUseRiskPercent` | `true` | Size position from % risk (false = fixed lot) |
| `InpRiskPercent` | `1.0` | Risk per trade, % of balance |
| `InpFixedLot` | `0.10` | Fixed lot when % risk is off |
| `InpMaxLot` | `5.0` | Hard maximum lot |
| `InpMaxOpenTrades` | `1` | Max simultaneous positions of this EA |
| `InpMaxTradesPerDay` | `0` | Max entries per day (0 = unlimited) |
| `InpDailyLossStopPct` | `5.0` | Stop for the day after this % loss (0 = off) |
| `InpATRPeriod` | `14` | ATR period for stops |
| `InpSL_ATR` | `1.5` | Stop Loss = ATR x this |
| `InpTP_ATR` | `2.0` | Take Profit = ATR x this |
| `InpMinSLPoints` | `80` | Minimum SL distance in points |
| `InpUseBreakEven` | `true` | Move SL to break-even |
| `InpBE_ATR` | `1.0` | Break-even trigger = ATR x this |
| `InpUseTrailing` | `false` | ATR trailing stop |
| `InpTrail_ATR` | `1.5` | Trailing distance = ATR x this |
| `InpMaxSpreadPoints` | `60` | Max allowed spread in points |
| `InpUseTimeFilter` | `false` | Restrict trading hours (server time) |
| `InpStartHour` | `7` | Trading start hour |
| `InpEndHour` | `20` | Trading end hour |
| `InpAvoidFriday` | `false` | No new trades on Friday |
| `InpMagic` | `8850112` | Magic number - keep unique per chart |
| `InpTradeComment` | `PipFix SpikeFade` | Order comment |
| `InpSlippage` | `20` | Max deviation in points |
## 5. Installation
1. In MetaTrader 5 choose **File -> Open Data Folder**, open `MQL5\Experts\` and create a folder named `PipFix`.
2. Copy the downloaded **PipFix SpikeFade.ex5** into `MQL5\Experts\PipFix\`. It is already compiled — there is no source file and nothing to build.
3. Back in MT5, right-click the **Navigator** panel and choose *Refresh*, then drag **PipFix SpikeFade** onto a **M15** chart of **XAUUSD**.
4. On the **Common** tab tick *Allow Algo Trading*.
5. On the **Inputs** tab press **Load** and select the settings file you downloaded, **PipFix_SpikeFade_XAUUSD_M15_BACKTESTED.set**.
6. Make sure the **Algo Trading** button in the MT5 toolbar is green.
## 6. How to reproduce the backtest
1. **View -> Strategy Tester** (Ctrl+R).
2. Expert: `PipFix\PipFix_SpikeFade`, Symbol: XAUUSD, Period: M15.
3. Modelling: *Every tick based on real ticks* (or *1 minute OHLC* for a fast first pass).
4. Set the date range, deposit and leverage you want to publish, load the `.set` file, press **Start**.
5. When it finishes, open the **Backtest** tab, right-click -> **Report** to save the HTML/XML report.
The measured results for this EA are in `Backtest/BACKTEST_RESULTS.md` in this folder, together with
the report screenshots. Those numbers come from an actual Strategy Tester run - the settings, symbol,
period and date range used are printed at the top of that file so anyone can repeat it.
## 7. Honest notes
* Past backtest performance is not a promise of future results. Spread, swap and execution differ
between brokers, and a different broker will produce a different curve.
* This robot trades one position at a time with a fixed stop. It is designed to survive, not to
produce a straight equity line.
* Use it on a demo account for at least a few weeks before risking real money.
---
(c) pipfixalgo.com - PipFix SpikeFade v1.00
**Best conditions:** M15 on gold and the majors. Raise InpMinSpikeATR to 1.6-2.0 for rarer, sharper reversals.