Join waitlist
Strategies / Trend / SMA Ratio Trend Filter

SMA Ratio Trend Filter

The system holds 1 contract long while the ratio of a 10-period SMA to a 100-period SMA is at or above its own 20-period average, and exits when it falls below. It trades long only, with no stop or target.

TrendLong onlySwingNikkei 2254 hours
1.51Profit factor
44,626Net profit USD
44.42%Win rate
538Trades
-9,148Max drawdown
82.95Avg trade

Best run of 24. Nikkei 225, 4 hours, spread 10, from run pf:2026-10-05-NIKKEI-4h.tsv:6.

Entry rules, long

Exit rules

  1. The trade closes at market when the SMA(10) to SMA(100) ratio falls below its 20-period average.

Test conditions

PeriodUp to 2026-10-05
InstrumentNikkei 225, 4 hours
Spread10 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-05

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nikkei 225Best run4 hours1.51 53844.4244,626 USD-9,148
Gold1 hour1.27 2,51839.203,643 EUR-753
USD/JPY1 hour1.20 2,93640.741,150,170 USD-156,175
USD/JPY30 minn/a 4,22737.92328,570 USD-206,900
Nikkei 225Dailyn/a 27237.1326,827 USD-11,579
Nikkei 2251 hourn/a 2,07538.6023,809 USD-11,788
Dow JonesDailyn/a 33042.4215,603 EUR-6,526
Nasdaq 100Dailyn/a 24445.9014,906 EUR-3,744
DAX 401 hourn/a 2,35341.3913,139 EUR-4,267
DAX 40Dailyn/a 32746.1812,582 EUR-5,323
Nasdaq 1001 hourn/a 2,64438.4312,516 EUR-3,959
Brent CrudeDailyn/a 10946.7911,589 EUR-7,264
Dow Jones1 hourn/a 86442.2511,395 EUR-6,536
Nasdaq 10030 minn/a 4,16937.9911,348 EUR-4,477
US Crude OilDailyn/a 25046.409,208 EUR-8,257
DAX 404 hoursn/a 65342.888,100 EUR-3,988
DAX 4030 minn/a 4,10438.477,649 EUR-6,752
Nasdaq 1004 hoursn/a 71144.307,326 EUR-4,587
Brent Crude1 hourn/a 1,34638.934,917 EUR-4,525
S&P 500Dailyn/a 35643.262,797 EUR-1,044
GoldDailyn/a 29839.932,674 EUR-950
Gold4 hoursn/a 66341.182,121 EUR-1,503
S&P 5001 hourn/a 2,59139.061,946 EUR-1,249
S&P 5004 hoursn/a 72442.821,153 EUR-1,038

Charts

Results by run

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

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

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

DEFPARAM CumulateOrders = false

fastma = Average[10](close)
slowma = Average[100](close)
mrat = fastma / slowma
signal = Average[20](mrat)

9 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
Longer historyRe-run on up to 1,000,000 barsNikkei 225 · 4 hours · older data 402.20 USD

Nikkei 225 had no history beyond the standard run, so both runs used 22,000 bars.

Nikkei 225 · 4 hours

Bars available22,000
Net, standard 200,000-bar run44,626.20 USD
Net, long run45,028.40 USD
Net on the older data alone402.20 USD
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run SMA Ratio Trend Filter 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 24 market and timeframe combinations. The best run was Nikkei 225, 4 hours, with a profit factor of 1.51 over 538 trades.

How large was the drawdown?

The best run had a maximum drawdown of 9,148 USD at the tested position size, against a net result of 44,626 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

Rock Climber

Best run on the same market, Nikkei 225.

1.44 PF · 1,644 trades

EMA Pullback Trend Continuation (long and short)

Also a trend strategy.

1.51 PF · 87 trades

See how ProRealAlgos combines strategies like this into one automated portfolio.

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