Join waitlist
Strategies / Volatility / Band Width Expansion Trend

Band Width Expansion Trend

Buys when the 20-period EMA is above the 50-period EMA and Bollinger width rises over 9% in one bar, and sells short on the mirror setup. Exits when price crosses a 22-bar high or low offset by 4 times the average true range.

VolatilityLong & shortIntradayGold30 min
n/aProfit factor
2,522Net profit EUR
38.92%Win rate
2,346Trades
-1,028Max drawdown
1.08Avg trade

Best run of 7. Gold, 30 min, spread 0.6, from run sweeps:2026-10-12-GOLD-30m-opt.tsv:45.

Entry rules, long

  1. The 20-period EMA is above the 50-period EMA.

Entry rules, short

  1. The 20-period EMA is below the 50-period EMA.

Exit rules

  1. A short closes when the close crosses over the 22-bar lowest low plus 4 times the 22-bar average true range.
  2. An opposite entry signal reverses the position.

Test conditions

PeriodUp to 2026-10-12
InstrumentGold, 30 minutes
Spread0.6 points
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-10-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest run30 minn/a 2,34638.922,522 EUR-1,028
Nikkei 225Dailyn/a 10343.6926,611 USD-12,115
Nikkei 2253 minn/a 2,24735.9612,646 USD-7,943
US Crude Oil30 minn/a 2,20340.356,437 EUR-4,595
Gold1 hourn/a 1,39340.342,331 EUR-606
Gold4 hoursn/a 33038.791,738 EUR-597
Gold3 minn/a 2,14235.99811 EUR-538

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Band Width Expansion Trend
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Volatility
// Direction: Long & short
// Timeframe tested: 30 minutes
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE myRoc = 0

myAtr = AverageTrueRange[22](close)
longstop = highest[22](high) - myAtr * 4
shortstop = lowest[22](low) + myAtr * 4

slow = ExponentialAverage[50](close)
fast = ExponentialAverage[20](close)

basis = Average[40](close)
dev = STD[40](close)
width = 0

25 more lines: the entry and exit rules.

Setup

How to load it

  1. Copy the code with the copy button on 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.

Indicators used

ATRBollinger BandsEMASMAStandard Deviation
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run Band Width Expansion Trend in ProOrder?

Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.

Which markets was it tested on?

It was tested on 7 market and timeframe combinations. The best run by trade count was Gold, 30 minutes, with 2,346 trades.

How large was the drawdown?

The best run had a maximum drawdown of 1,028 EUR at the tested position size, against a net result of 2,522 EUR.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

CCI Breakout

Best run on the same market, Gold.

1.08 PF · 6,065 trades

Bollinger Squeeze

Also a volatility strategy.

14.30 PF · 86 trades

Get the full rules, the complete code and the ProRealAlgos portfolio as a member.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

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