Join waitlist
Strategies / Breakout / Moving Average Band Breakout

Moving Average Band Breakout

The strategy buys when price closes above a 40-period average of highs, and sells short when it closes below a 40-period average of lows. Each trade has a stop at the opposite band and a target 3 times the stop distance away.

BreakoutLong & shortSwingUSD/JPY1 hour
n/aProfit factor
391,170Net profit USD
29.66%Win rate
6,525Trades
-262,820Max drawdown
59.95Avg trade

Best run of 5. USD/JPY, 1 hour, spread 1, from run sweeps:2026-10-11-USDJPY-1h-opt.tsv:70.

Entry rules, long

  1. The close crosses above the 40-period average of highs.

Entry rules, short

  1. The close crosses below the 40-period average of lows.

Exit rules

  1. A short closes when a bar's high reaches the upper band stop, or its low reaches the target 3 times the stop distance below the entry.

Test conditions

PeriodUp to 2026-10-11
InstrumentUSD/JPY, 1 hour
Spread1 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-11

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest run1 hourn/a 6,52529.66391,170 USD-262,820
EUR/USDDailyn/a 60730.97120,622 USD-60,227
Nasdaq 100Dailyn/a 59030.349,004 EUR-5,832
Gold4 hoursn/a 1,43633.842,477 EUR-697
GoldDailyn/a 69231.501,071 EUR-1,000

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Moving Average Band Breakout
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long & short
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE lsl = 0
ONCE ltp = 0
ONCE ssl = 0
ONCE stp = 0

upper = Average[40](high)
lower = Average[40](low)

26 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

SMA
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 262,820 USD is large next to the net profit of 391,170 USD.

Questions

About this strategy

Can I run Moving Average Band Breakout 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 5 market and timeframe combinations. The best run by trade count was USD/JPY, 1 hour, with 6,525 trades.

How large was the drawdown?

The best run had a maximum drawdown of 262,820 USD at the tested position size, against a net result of 391,170 USD.

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

EMA 8 21 RSI Filtered Bracket

Best run on the same market, USD/JPY.

1.09 PF · 6,194 trades

Big Candle Breakout

Also a breakout strategy.

n/a PF · 4,636 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