Buys when the close is above the 200-period average and the MACD histogram turns positive, and sells short in the opposite case. Each trade has a stop and a target set from the 14-period average true range.
Best run of 5. Silver, 4 hours, spread 2, from run pf:2026-10-05-SILVER-4h.tsv:2.
| Period | Up to 2026-10-05 |
| Instrument | Silver, 4 hours |
| Spread | 2 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-05 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| SilverBest run | 4 hours | 2.27 | 1,061 | 39.02 | 172,397 USD | -30,758 |
| Nikkei 225 | Daily | n/a | 377 | 45.89 | 23,492 USD | -17,881 |
| Brent Crude | 4 hours | n/a | 617 | 42.63 | 6,941 EUR | -3,357 |
| Gold | 4 hours | n/a | 1,078 | 42.12 | 1,373 EUR | -501 |
| S&P 500 | Daily | n/a | 525 | 38.48 | 983 EUR | -662 |
Charts
The code
// ============================================================== // MACD Histogram Trend Cross // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false ema = ExponentialAverage[200](close) myMacd = ExponentialAverage[12](close) - ExponentialAverage[26](close) signal = ExponentialAverage[9](myMacd) hist = myMacd - signal myAtr = Average[14](TR(close))
18 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 5 market and timeframe combinations. The best run was Silver, 4 hours, with a profit factor of 2.27 over 1,061 trades.
The best run had a maximum drawdown of 30,758 USD at the tested position size, against a net result of 172,396 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.