Wilder Volatility System
Wilder's own book introduced Average True Range and then used it, a few chapters later, to build a complete stop-and-reverse system - the ancestor of every modern "ATR trailing stop" indicator. Most of those descendants trail from the extreme high or low PRICE reached since entry. This EA reproduces what the book actually specifies instead: the stop is measured from the "Significant Close" - the highest CLOSE while long, or the lowest CLOSE while short - which is less reactive to a single long wick than an extreme-price anchor and is the literal method, not a modern approximation of it. MetaTrader's own iATR() already smooths with Wilder's running-average method - the same one he introduced in the same book - so using it here is not an approximation of Wilder's ATR, it IS Wilder's ATR. The system is always in the market once started: there is no flat state, no separate exit signal. When the previous bar's close crosses the stop level, the position reverses outright, evaluated once per closed bar exactly as the book's own examples do it. An optional real broker-side stop tracks the same computed level as a safety net, since a purely close-evaluated system carries the position with no protection between bar closes otherwise. This is a deliberate safety addition on top of a literal reproduction, not a change to the method itself, and can be switched off for a strictly literal close-only evaluation. RISK WARNING: this system is never flat. Every loss on one side is immediately followed by a new position on the other side. Trade it only with a lot size and a broker-stop setting whose drawdown you have accepted in advance. Notes and limitations - Always in the market once the first position is opened - there is no flat state and no way to exit without reversing, by design. See the risk warning in the source header. - The reversal decision is made once per closed bar. With the broker stop switched off, an adverse intrabar move beyond the computed level is not acted on until that bar closes. - The very first side is chosen by the simplest available rule - the most recent bar's own close direction - since the book does not prescribe one; this only affects which side the very first trade takes, not the ongoing method. - On MQL5, if a foreign-magic position already exists on the traded symbol, the EA logs a refusal and skips that bar's entry rather than opening - see "MQL4 versus MQL5 differences" above.
Expert advisor · MT4 · v1.0 · Free
About Wilder Volatility System
Wilder Volatility System is an expert advisor (trading robot) for MetaTrader 4 based on ATR. It increases the lot size after a losing trade (martingale), can size trades from your balance and risk percent and has a news filter. It has 10 settings, such as Atr period, Atr multiplier and Use broker stop. MQL source code included.
Files in the download: WilderVolatilitySystem.ex4, WilderVolatilitySystem.mq4, WilderVolatilitySystem.txt.
Trading robots can lose money. Check every setting and test on a demo account before using real funds.
Settings
| Setting | Default | What it does |
|---|---|---|
| Atr period | 7 | ATR lookback - Wilder's own examples used a short period such as this |
| Atr multiplier | 3.0 | ATR multiple from the Significant Close to the stop-and-reverse level |
| Use broker stop | true | Also place a real broker-side stop at the computed level (recommended safety net) |
| Use risk sizing | false | Size by percent risk to the stop distance instead of a fixed lot |
| Risk percent | 1.0 | Percent of equity risked per reversal, used only when risk sizing is on |
| Fixed lots | 0.10 | Lot size when risk sizing is off, or as a fallback |
| Magic number | 20260908 | Magic number for orders this EA opens |
| Slippage pips | 3 | Slippage tolerance, in pips |
| Max retries | 5 | Attempts per trade action before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
- Test it first on a demo account or in the Strategy Tester.
Tags: ATR · Trailing Stop & Break-even · Martingale · Risk & Lot Size · News Trading · MT4 Expert Advisor · MQL4 Source Code