Join waitlist
Strategies / Trend / SMA Band Toggle Long

SMA Band Toggle Long

Alternates buy and sell signals on the 9 period SMA. A buy comes when the close sits just above the average, within 1.009 times it, and a sell when the close is below the average and above 0.001 times it.

TrendLong onlySwingUSD/JPY4 hours
n/aProfit factor
741,300Net profit USD
34.01%Win rate
2,552Trades
-239,660Max drawdown
290Avg trade

Best run of 14. USD/JPY, 4 hours, spread 1, from run sweeps:2026-10-04-USDJPY-4h-opt.tsv:31.

Entry rules, long

  1. Buy and sell zone signals alternate, so consecutive buy-zone bars do not each trigger a buy.
  2. Enter long at market when flat, on a buy-zone bar that is not consecutive with another.

Exit rules

  1. When long, sells at market on alternating sell-zone signals.

Test conditions

PeriodUp to 2026-10-04
InstrumentUSD/JPY, 4 hours
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-04

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest run4 hoursn/a 2,55234.01741,300 USD-239,660
USD/JPYDailyn/a 95732.81915,780 USD-469,450
EUR/USDDailyn/a 90932.0146,468 USD-38,920
Nikkei 225Dailyn/a 69332.3220,861 USD-13,128
Dow JonesDailyn/a 93234.1215,680 EUR-5,741
DAX 404 hoursn/a 2,16433.739,669 EUR-3,098
Brent CrudeDailyn/a 27037.417,525 EUR-4,294
Nasdaq 1004 hoursn/a 2,16434.337,265 EUR-4,431
Nasdaq 100Dailyn/a 68531.686,824 EUR-3,368
Brent Crude4 hoursn/a 1,16232.966,459 EUR-3,285
DAX 40Dailyn/a 95533.825,492 EUR-4,978
GoldDailyn/a 89530.732,550 EUR-1,241
S&P 500Dailyn/a 98232.182,205 EUR-1,334
Gold4 hoursn/a 2,25531.442,059 EUR-996

Charts

Results by run

Top 10 of 14 runs. The full list is in the table above.

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// SMA Band Toggle Long
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE prev = 1

sma = Average[9](close)
myOver = sma * 1.009
myUnder = sma * 0.001

24 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 code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run SMA Band Toggle Long 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 14 market and timeframe combinations. The best run by trade count was USD/JPY, 4 hours, with 2,552 trades.

How large was the drawdown?

The best run had a maximum drawdown of 239,660 USD at the tested position size, against a net result of 741,300 USD.

Does it trade long, short or both?

It only takes long trades.

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

ADX Filtered EMA Cross

Also a trend strategy.

1.15 PF · 607 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