The strategy buys when a 20 period Hann filter crosses above a 23 period one, swing structure is not bearish and ADX(14) is from 8 to 60. Stops sit near the 20 bar low or high, with targets at twice the stop distance.
Best run of 10. Gold, 3 min, spread 0.6, from run sweeps:2026-10-04-GOLD-3m-opt.tsv:33.
| Period | Up to 2026-10-04 |
| Instrument | Gold, 3 minutes |
| Spread | 0.6 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-04 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 3 min | n/a | 1,143 | 34.03 | 1,230 EUR | -1,177 |
| Silver | 4 hours | n/a | 226 | 34.07 | 27,970 USD | -14,435 |
| Dow Jones | Daily | n/a | 84 | 41.67 | 19,540 EUR | -14,109 |
| USD/JPY | Daily | n/a | 276 | 35.51 | 18,120 USD | -10,380 |
| Silver | Daily | n/a | 54 | 42.59 | 16,567 USD | -15,964 |
| Dow Jones | 15 min | n/a | 885 | 36.16 | 14,497 EUR | -8,097 |
| DAX 40 | 4 hours | n/a | 194 | 38.14 | 10,232 EUR | -5,530 |
| Nasdaq 100 | 1 hour | n/a | 867 | 32.53 | 8,783 EUR | -4,772 |
| Brent Crude | 4 hours | n/a | 116 | 39.66 | 8,074 EUR | -4,889 |
| Gold | 4 hours | n/a | 217 | 33.18 | 1,046 EUR | -1,028 |
Charts
The code
// ============================================================== // Hann Ribbon Crossover Structure Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 3 minutes // ============================================================== DEFPARAM CumulateOrders = false ONCE lastsh = 0 ONCE shok = 0 ONCE lastsl = 0 ONCE slok = 0 ONCE structtrend = 0 ONCE bulltrack = 0 ONCE bulltrackok = 0 ONCE beartrack = 0 ONCE beartrackok = 0 ONCE myPi = 3.14159265358979 myAtr = AverageTrueRange[14](close)
119 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 10 market and timeframe combinations. The best run by trade count was Gold, 3 minutes, with 1,143 trades.
The best run had a maximum drawdown of 1,177 EUR at the tested position size, against a net result of 1,230 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.