The system sells short when the MACD line crosses below its signal line and DI+ is below DI-. It covers when price closes more than 3% above the average entry or crosses below a volatility stop based on twice ATR(20).
Best run of 2. EUR/USD, 2 min, spread 1, from run sweeps:2026-10-11-EURUSD-2m-opt.tsv:9.
| Period | Up to 2026-10-11 |
| Instrument | EUR/USD, 2 minutes |
| Spread | 1 points |
| Starting capital | 1,000,000 |
| Costs | Spread only. Commissions and overnight financing are not included. |
| Bars | Up to 200,000 bars, fewer where the instrument has less history |
| Last tested | 2026-10-11 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| EUR/USDBest run | 2 min | n/a | 2 | 50.00 | 30,681 USD | -27,917 |
| USD/JPY | Daily | n/a | 1 | 100.00 | 1,215,880 USD | -1,022,800 |
Charts
The code
// ============================================================== // MACD Crossover Short With Volatility Stop // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Short only // Timeframe tested: 2 minutes // ============================================================== DEFPARAM CumulateOrders = false ONCE vmax = 0 ONCE vmin = 0 ONCE up = 1 ONCE vstop = 0 ONCE vinit = 0 myMacd = ExponentialAverage[12](close) - ExponentialAverage[26](close) sig = ExponentialAverage[9](myMacd) dip = DIplus[14](close) dim = DIminus[14](close) atrm = AverageTrueRange[20](close) * 2 IF vinit = 0 THEN vmax = close vmin = close vinit = 1 ENDIF vmax = max(vmax, close) vmin = min(vmin, close) IF up = 1 THEN vstop = max(vstop, vmax - atrm) ELSE vstop = min(vstop, vmin + atrm) ENDIF prevup = up
26 more lines: the entry and exit rules.
Setup
Questions
Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.
It was tested on 2 market and timeframe combinations. The best run by trade count was EUR/USD, 2 minutes, with 2 trades.
The best run had a maximum drawdown of 27,917 USD at the tested position size, against a net result of 30,681 USD.
It only takes short trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.