Join today
Strategies / Trend / Moving Average Band Filter

Moving Average Band Filter: Trading a 100 SMA Band With the Long Trend

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.

TrendLong & shortIntradayNasdaq 10030 min
n/aProfit factor
8,691Net profit EUR
31.41%Win rate
1,754Trades
-4,543Max drawdown
4.95Avg trade

Best run of 26. Nasdaq 100, 30 min, spread 3, from run sweeps:2026-09-24-NAS100-30m-opt.tsv:5.

Entry rules, long

  1. Members only
  2. Close is above the 1000-period SMA

Entry rules, short

  1. Members only
  2. Close is below the 1000-period SMA

Exit rules

  1. Members only
  2. Close a short when price crosses above the 100 SMA plus 0.2%
  3. No stop loss or target

Test conditions

PeriodUp to 2026-09-24
InstrumentNasdaq 100, 30 minutes
Spread3 points
Contracts1
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-09-25

Parameters

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

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nasdaq 100Best run30 minn/a 1,75431.418,691 EUR-4,543
USD/JPY10 min0.78 2642.31-10,050 JPY-23,910
USD/JPYDailyn/a 19424.74974,520 JPY-443,190
USD/JPY30 minn/a 1,11935.21502,590 JPY-139,930
USD/JPY15 minn/a 85635.40363,690 JPY-153,990
USD/JPY5 minn/a 52138.58159,470 JPY-109,880
Nikkei 225Dailyn/a 18821.2834,977 USD-12,484
Dow JonesDailyn/a 25421.2617,485 EUR-10,142
Nasdaq 100Dailyn/a 18231.8714,801 EUR-4,004
US Crude Oil1 hourn/a 1,18224.627,896 EUR-4,928
GBP/USD1 hourn/a 1,28931.345,989 USD-4,765
Nasdaq 1001 hourn/a 1,23228.575,736 EUR-3,964
DAX 40Dailyn/a 27524.365,615 EUR-5,098
Gold30 minn/a 1,57631.853,201 EUR-1,094
S&P 500Dailyn/a 23925.942,891 EUR-977
GoldDailyn/a 21624.542,750 EUR-1,275
Gold10 minn/a 1,20532.282,332 EUR-660
Gold4 hoursn/a 39625.761,787 EUR-1,534
Gold2 minn/a 91834.641,630 EUR-524
Gold1 hourn/a 1,15426.521,522 EUR-1,077
Gold5 minn/a 1,06931.811,480 EUR-742
S&P 5004 hoursn/a 39628.031,442 EUR-913
Gold3 minn/a 99634.541,270 EUR-847
S&P 5001 hourn/a 1,13531.891,216 EUR-1,011
Gold15 minn/a 1,34229.881,103 EUR-895
Gold1 minn/a 71634.92654 EUR-546

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-500K-250K500K1.0MUSD/JPY · DailyUSD/JPY · 30 minUSD/JPY · 15 minUSD/JPY · 5 minNikkei 225 · DailyDow Jones · DailyNasdaq 100 · DailyNasdaq 100 · 30 minUS Crude Oil · 1 hourGBP/USD · 1 hourNasdaq 100 · 1 hourDAX 40 · DailyGold · 30 minS&P 500 · DailyGold · DailyGold · 10 min

The code

ProBuilder, rewritten to house standard

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

Known weaknesses

  • There is no stop loss or target. Exits depend only on price crossing the other side of the band.
  • Win rates are low, 31.41% in the best run, so the system leans on a few large winners.
  • USD/JPY 10 minutes ended at -10,050 JPY with a profit factor of 0.78, and the USD/JPY Daily run had a 443,190 JPY drawdown.
  • Profit factor was not recorded for the headline run because only sweep data exists.

Indicators used

SMA

How to load it

  1. Copy the code with the copy button above the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Questions

About this strategy

Can it run in ProOrder?

Yes, the band and trend checks are automated. With no stop in the code, set your own account protection.

How did it perform across markets?

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.

What drawdown came with 1 contract?

With 1 contract and a 3 point spread, the Nasdaq 100 30 minute run had a max drawdown of 4,542.50 EUR.

Why use a 1000 SMA?

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

Strategies like this one

Bollinger Squeeze

Uses the same indicator.

14.30 PF · 86 trades

Negated Hammer

Best run on the same market, Nasdaq 100.

3.20 PF · 372 trades

Long-Term Moving Average Cross

Also a trend strategy.

12.31 PF · 61 trades

Join the ProRealAlgos waitlist to see how trend filters are used in live portfolios.

Copy trading on US indices is available to ProRealAlgos members as spots open.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs