When the whole lower exponential band is above the 200 SMA, the trend is up, and the strategy buys the first close at or below the 20 SMA. It takes only one long per uptrend, and shorts mirror the logic. An equity curve filter pauses entries when the strategy is below its own 250 bar average.
Best run of 6. Gold, 10 min, spread 0.6, from run sweeps:2026-09-23-GOLD-10m-opt.tsv:4.
| Period | Up to 2026-09-23 |
| Instrument | Gold, 10 minutes |
| 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-23 |
| positionSize Contracts per trade | 1 |
| startCapital Starting equity used by the equity curve filter | 10000 |
| equityCurvePeriod SMA length of the equity curve | 250 |
| fastPeriod Entry and final exit SMA length | 20 |
| midPeriod SMA length that arms the exit | 50 |
| trendPeriod Trend SMA length | 200 |
| bandPeriod Length of the exponential log-price bands | 42 |
| bandWidth Band width in standard deviations | 2.4 |
| seedPeriod SMA length that seeds the bands on early bars | 3 |
| stopLossMoney Protective stop in account currency | 40 |
| takeProfitMoney Profit target in account currency | 130 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 10 min | n/a | 696 | 46.55 | 432 EUR | -387 |
| EUR/USD | Daily | n/a | 52 | 42.31 | 1,660 USD | -240 |
| FTSE 100 | 4 hours | n/a | 96 | 41.67 | 762 EUR | -362 |
| S&P 500 | Daily | n/a | 54 | 46.30 | 593 EUR | -223 |
| Nasdaq 100 | 4 hours | n/a | 118 | 43.22 | 462 EUR | -424 |
| FTSE 100 | Daily | n/a | 37 | 32.43 | 434 EUR | -344 |
Charts
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.
// ============================================================ // Bollinger Trend Catcher // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 10 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade startCapital = 10000 // starting equity for the equity curve filter equityCurvePeriod = 250 // SMA length of the equity curve fastPeriod = 20 // entry and final exit average midPeriod = 50 // average that arms the exit trendPeriod = 200 // trend average the bands are compared with bandPeriod = 42 // length of the log-price exponential bands bandWidth = 2.4 // band width in standard deviations seedPeriod = 3 // SMA used to seed the bands on early bars stopLossMoney = 40 // protective stop in account currency takeProfitMoney = 130 // profit target in account currency // State: one trade per trend, and a staged exit. ONCE longTrendUsed = 0 ONCE shortTrendUsed = 0 ONCE longExitStage = 0 ONCE shortExitStage = 0 ONCE logEma = 0 ONCE logVariance = 0 // --- Indicators --- // Only trade while equity is at or above its own moving average. equity = startCapital + StrategyProfit equityCurve = Average[equityCurvePeriod, 0](equity) equityOk = BarIndex < equityCurvePeriod OR (BarIndex > equityCurvePeriod AND equity >= equityCurve) fastMA = Average[fastPeriod](close) midMA = Average[midPeriod](close) trendMA = Average[trendPeriod](close) // Exponential bands on log price. logPrice = LOG(CustomClose) emaAlpha = 2 / (bandPeriod + 1) IF BarIndex < bandPeriod THEN logEma = Average[seedPeriod](logPrice) ELSE logEma = emaAlpha * logPrice + (1 - emaAlpha) * logEma ENDIF logError = logPrice - logEma errorSquared = SQUARE(logError) IF BarIndex < bandPeriod + 1 THEN logVariance = errorSquared ELSE logVariance = emaAlpha * errorSquared + (1 - emaAlpha) * logVariance ENDIF logStdDev = SQRT(logVariance) upperBand = EXP(logEma + (bandWidth * logStdDev)) lowerBand = EXP(logEma - (bandWidth * logStdDev))
44 more lines: the entry and exit rules.
Read this first
Questions
Yes, it is written as a ProOrder system. The code was rewritten and not yet compile checked, so run a backtest before going live.
Gold, EUR/USD, FTSE 100, S&P 500 and Nasdaq 100. Every listed run made a small profit, the largest being USD 1,660 on EUR/USD Daily from 52 trades.
At 1 contract the best run had a max drawdown of EUR 387.3. Each trade risks the 40 money stop, before spread.
The one trade per trend rule means a new long only comes after the band has dipped below the 200 SMA and recovered. On daily bars that happens rarely, for example 37 trades on FTSE 100 Daily.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.