A long opens when price crosses above the 100-period SMA plus 0.2% while it is above the 1000-period SMA. Shorts mirror this below the band and under the 1000 SMA. Each side closes when price crosses the opposite edge of the band.
Best run of 26. Nasdaq 100, 30 min, spread 3, from run sweeps:2026-09-24-NAS100-30m-opt.tsv:5.
| Period | Up to 2026-09-24 |
| Instrument | Nasdaq 100, 30 minutes |
| Spread | 3 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 |
| bandPeriod SMA the band is built around | 100 |
| trendPeriod Long trend SMA | 1000 |
| upperFactor Upper band multiple | 1.002 |
| lowerFactor Lower band multiple | 0.998 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nasdaq 100Best run | 30 min | n/a | 1,754 | 31.41 | 8,691 EUR | -4,543 |
| USD/JPY | 10 min | 0.78 | 26 | 42.31 | -10,050 JPY | -23,910 |
| USD/JPY | Daily | n/a | 194 | 24.74 | 974,520 JPY | -443,190 |
| USD/JPY | 30 min | n/a | 1,119 | 35.21 | 502,590 JPY | -139,930 |
| USD/JPY | 15 min | n/a | 856 | 35.40 | 363,690 JPY | -153,990 |
| USD/JPY | 5 min | n/a | 521 | 38.58 | 159,470 JPY | -109,880 |
| Nikkei 225 | Daily | n/a | 188 | 21.28 | 34,977 USD | -12,484 |
| Dow Jones | Daily | n/a | 254 | 21.26 | 17,485 EUR | -10,142 |
| Nasdaq 100 | Daily | n/a | 182 | 31.87 | 14,801 EUR | -4,004 |
| US Crude Oil | 1 hour | n/a | 1,182 | 24.62 | 7,896 EUR | -4,928 |
| GBP/USD | 1 hour | n/a | 1,289 | 31.34 | 5,989 USD | -4,765 |
| Nasdaq 100 | 1 hour | n/a | 1,232 | 28.57 | 5,736 EUR | -3,964 |
| DAX 40 | Daily | n/a | 275 | 24.36 | 5,615 EUR | -5,098 |
| Gold | 30 min | n/a | 1,576 | 31.85 | 3,201 EUR | -1,094 |
| S&P 500 | Daily | n/a | 239 | 25.94 | 2,891 EUR | -977 |
| Gold | Daily | n/a | 216 | 24.54 | 2,750 EUR | -1,275 |
| Gold | 10 min | n/a | 1,205 | 32.28 | 2,332 EUR | -660 |
| Gold | 4 hours | n/a | 396 | 25.76 | 1,787 EUR | -1,534 |
| Gold | 2 min | n/a | 918 | 34.64 | 1,630 EUR | -524 |
| Gold | 1 hour | n/a | 1,154 | 26.52 | 1,522 EUR | -1,077 |
| Gold | 5 min | n/a | 1,069 | 31.81 | 1,480 EUR | -742 |
| S&P 500 | 4 hours | n/a | 396 | 28.03 | 1,442 EUR | -913 |
| Gold | 3 min | n/a | 996 | 34.54 | 1,270 EUR | -847 |
| S&P 500 | 1 hour | n/a | 1,135 | 31.89 | 1,216 EUR | -1,011 |
| Gold | 15 min | n/a | 1,342 | 29.88 | 1,103 EUR | -895 |
| Gold | 1 min | n/a | 716 | 34.92 | 654 EUR | -546 |
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.
// ============================================================ // Moving Average Band Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 30 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade bandPeriod = 100 // SMA the band is built around trendPeriod = 1000 // long SMA that sets the allowed direction upperFactor = 1.002 // upper band, 0.2% above the band SMA lowerFactor = 0.998 // lower band, 0.2% below the band SMA // --- Indicators --- upperBand = Average[bandPeriod](close) * upperFactor lowerBand = Average[bandPeriod](close) * lowerFactor trendMA = Average[trendPeriod](close)
27 more lines: the entry and exit rules.
Read this first
Questions
Yes, the band and trend checks are automated. With no stop in the code, set your own account protection.
Nasdaq 100 30 minutes made 8,690.90 EUR over 1754 trades. 24 of the 25 other runs were positive, across Gold, S&P 500, DAX 40, Dow Jones, Nikkei 225, GBP/USD, US Crude Oil and USD/JPY.
With 1 contract and a 3 point spread, the Nasdaq 100 30 minute run had a max drawdown of 4,542.50 EUR.
It acts as a slow trend filter so the band breaks are only taken in the longer direction. It was tested from 1 minute up to Daily charts.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.