The lower band is a 141-bar triangular moving average minus 2.4 times ATR(141). A close crossing back above that band opens a long. It sells at the middle line or on a 3% stop or 3% target.
Best run of 8. FTSE 100, 15 min, spread 2, from run sweeps:2026-09-17-FTSE100-15m-opt.tsv:3.
| Period | Up to 2026-09-17 |
| Instrument | FTSE 100, 15 minutes |
| Spread | 2 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-17 |
| positionSize Contracts per trade | 1 |
| tmaHalfLength Half length of the triangular average | 141 |
| atrPeriod ATR length for channel width | 141 |
| atrMultiplier Channel width in ATRs | 2.4 |
| stopLossPct Protective stop, percent | 3 |
| takeProfitPct Profit target, percent | 3 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| FTSE 100Best run | 15 min | n/a | 1,484 | 77.29 | 3,189 EUR | -1,261 |
| Nikkei 225 | 15 min | n/a | 1,481 | 74.81 | 14,734 USD | -6,454 |
| Dow Jones | 4 hours | n/a | 90 | 78.89 | 9,366 EUR | -4,362 |
| Dow Jones | 30 min | n/a | 607 | 76.28 | 7,653 EUR | -5,013 |
| Brent Crude | Daily | n/a | 102 | 56.86 | 3,663 EUR | -1,291 |
| DAX 40 | 4 hours | n/a | 300 | 73.33 | 3,578 EUR | -2,460 |
| FTSE 100 | Daily | n/a | 152 | 59.87 | 1,807 EUR | -1,127 |
| S&P 500 | 4 hours | n/a | 306 | 74.84 | 1,190 EUR | -550 |
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.
// ============================================================ // TMA Channel Long // ProRealAlgos Strategy Library | prorealalgos.com // Type: Mean reversion // Direction: Long only // Timeframe tested: 15 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false DEFPARAM PreloadBars = 10000 // --- Parameters --- positionSize = 1 // contracts per trade tmaHalfLength = 141 // half length of the triangular moving average atrPeriod = 141 // ATR length for the channel width atrMultiplier = 2.4 // channel width in ATRs stopLossPct = 3 // protective stop, percent takeProfitPct = 3 // profit target, percent // --- Indicators --- // Triangular average built by hand: weights fall linearly with bar age. weightedSum = (tmaHalfLength + 1) * close weightTotal = (tmaHalfLength + 1) weight = tmaHalfLength FOR j = 1 TO tmaHalfLength DO weight = weight - 1 weightedSum = weightedSum + (weight * close[j]) weightTotal = weightTotal + weight NEXT bandOffset = AverageTrueRange[atrPeriod](close) * atrMultiplier midBand = weightedSum / weightTotal lowerBand = midBand - bandOffset
16 more lines: the entry and exit rules.
Read this first
Questions
Yes, all rules are automatable. The rewritten code was not compile-checked, so run it in ProBacktest first.
FTSE 100, Nikkei 225, Dow Jones, DAX 40, S&P 500 and Brent Crude, and all 7 listed runs were positive. Nikkei 225 15 minutes made USD 14,734.4.
The FTSE 100 15 minute run had a max drawdown of EUR 1,261.1 against EUR 3,188.5 net profit.
It gave the best recorded run. The long 141-bar settings keep the channel slow even on intraday bars.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.