The model builds three bands from EMAs of highs and lows over 50, 100 and 200 bars. Each band flips up or down depending on which side price closed, and a long opens only when the close is above the active line of all three. The trade ends as soon as that stops being true.
Best run of 31. Gold, Daily, spread 0.6, from run pf:2026-09-24-GOLD-D.tsv:2.
| Period | Up to 2026-09-25 |
| Instrument | Gold, Daily |
| Spread | 0.6 points |
| Contracts | 1 |
| 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-09-25 |
| positionSize Contracts per trade | 1 |
| fastPeriod Fast band: EMA of highs and of lows | 50 |
| midPeriod Middle band | 100 |
| slowPeriod Slow band | 200 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | Daily | 2.27 | 203 | 31.03 | 3,315 EUR | -809 |
| USD/JPY | 30 min | 1.14 | 2,655 | 28.74 | 516,700 JPY | -124,400 |
| USD/JPY | Daily | n/a | 186 | 29.03 | 644,780 JPY | -579,750 |
| USD/JPY | 1 hour | n/a | 1,860 | 29.57 | 491,890 JPY | -349,120 |
| EUR/USD | 2 min | n/a | 3,176 | 19.40 | 188,989 USD | -76,432 |
| EUR/USD | Daily | n/a | 169 | 27.81 | 50,918 USD | -36,021 |
| Nikkei 225 | Daily | n/a | 178 | 31.46 | 44,429 USD | -14,716 |
| Silver | 4 hours | n/a | 409 | 28.36 | 33,015 USD | -13,293 |
| Nikkei 225 | 1 hour | n/a | 1,461 | 27.45 | 21,719 USD | -11,048 |
| Dow Jones | Daily | n/a | 240 | 35.42 | 19,700 EUR | -8,491 |
| Nasdaq 100 | Daily | n/a | 198 | 35.35 | 14,713 EUR | -3,714 |
| Nikkei 225 | 4 hours | n/a | 406 | 29.80 | 14,200 USD | -11,158 |
| Dow Jones | 1 hour | n/a | 597 | 28.64 | 10,754 EUR | -5,895 |
| Dow Jones | 4 hours | n/a | 171 | 35.67 | 10,535 EUR | -5,287 |
| Nasdaq 100 | 4 hours | n/a | 533 | 34.71 | 9,508 EUR | -4,145 |
| DAX 40 | Daily | n/a | 316 | 28.48 | 9,207 EUR | -5,564 |
| Nasdaq 100 | 30 min | n/a | 3,124 | 30.79 | 8,690 EUR | -4,381 |
| DAX 40 | 30 min | n/a | 2,974 | 27.37 | 7,740 EUR | -4,044 |
| Nasdaq 100 | 1 hour | n/a | 1,882 | 28.96 | 7,667 EUR | -5,051 |
| DAX 40 | 1 hour | n/a | 1,669 | 28.76 | 6,875 EUR | -3,807 |
| Nasdaq 100 | 15 min | n/a | 2,880 | 28.26 | 6,738 EUR | -3,594 |
| US Crude Oil | Daily | n/a | 172 | 36.05 | 6,647 EUR | -5,468 |
| Nasdaq 100 | 10 min | n/a | 2,824 | 27.76 | 6,102 EUR | -4,452 |
| Nasdaq 100 | 5 min | n/a | 2,882 | 26.34 | 4,067 EUR | -2,986 |
| Gold | 4 hours | n/a | 397 | 31.99 | 3,155 EUR | -1,179 |
| S&P 500 | Daily | n/a | 257 | 31.91 | 2,727 EUR | -1,019 |
| Gold | 30 min | n/a | 2,710 | 29.85 | 2,323 EUR | -792 |
| Gold | 1 hour | n/a | 1,574 | 28.53 | 1,870 EUR | -1,449 |
| S&P 500 | 4 hours | n/a | 531 | 32.39 | 1,453 EUR | -802 |
| S&P 500 | 30 min | n/a | 3,128 | 30.95 | 1,403 EUR | -1,331 |
| Gold | 15 min | n/a | 2,835 | 24.37 | 934 EUR | -929 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.
// ============================================================ // Triple Band Market Model // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long only // Timeframe tested: Daily // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade fastPeriod = 50 // fast band: EMA of highs and of lows midPeriod = 100 // middle band slowPeriod = 200 // slow band // --- Indicators --- // Each band is an EMA of highs and an EMA of lows (previous bar). // Its direction flips up above the high line and down below the low line, // and the active line is the low line in an uptrend, the high line in a downtrend. ONCE fastDirection = 0 ONCE midDirection = 0 ONCE slowDirection = 0 fastUpperMA = ExponentialAverage[fastPeriod](high)[1] fastLowerMA = ExponentialAverage[fastPeriod](low)[1] IF CustomClose > fastUpperMA THEN fastDirection = 1 ELSIF CustomClose < fastLowerMA THEN fastDirection = -1 ENDIF IF fastDirection = -1 THEN fastLine = fastUpperMA ELSE fastLine = fastLowerMA ENDIF midUpperMA = ExponentialAverage[midPeriod](high)[1] midLowerMA = ExponentialAverage[midPeriod](low)[1] IF CustomClose > midUpperMA THEN midDirection = 1 ELSIF CustomClose < midLowerMA THEN midDirection = -1 ENDIF IF midDirection = -1 THEN midLine = midUpperMA ELSE midLine = midLowerMA ENDIF slowUpperMA = ExponentialAverage[slowPeriod](high)[1] slowLowerMA = ExponentialAverage[slowPeriod](low)[1] IF CustomClose > slowUpperMA THEN slowDirection = 1 ELSIF CustomClose < slowLowerMA THEN slowDirection = -1 ENDIF IF slowDirection = -1 THEN slowLine = slowUpperMA ELSE slowLine = slowLowerMA ENDIF aboveFast = fastLine < close aboveMid = midLine < close aboveSlow = slowLine < close
14 more lines: the entry and exit rules.
Read this first
Questions
Yes, the band logic and exit are automated. With no stop, set a maximum loss at account level.
Gold Daily made 3,314.50 EUR over 203 trades. Every run in the table was profitable, across USD/JPY, EUR/USD, Nikkei 225, Silver, Dow Jones, Nasdaq 100, DAX 40, US Crude Oil, S&P 500 and Gold.
With 1 contract and a 0.6 point spread, the Gold Daily run had a max drawdown of 808.80 EUR.
Bands of 50 to 200 bars describe the main trend best on daily charts. Gold Daily gave the highest profit factor, 2.27.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.