Join waitlist
Strategies / Trend / SMA Crossover Trend Long Short

SMA Crossover Trend Long Short

Buys when the 3 SMA is above the 48 SMA and price is above the 168 SMA, and sells short when the reverse holds. Trades close when the fast average crosses back against them.

TrendLong & shortSwingUSD/JPYDaily
1.92Profit factor
3,388,270Net profit USD
32.83%Win rate
399Trades
-497,210Max drawdown
8,492Avg trade

Best run of 11. USD/JPY, Daily, spread 1, from run pf:2026-10-04-USDJPY-D.tsv:14.

Entry rules, long

  1. The close is above the 168 period SMA.

Entry rules, short

  1. The close is below the 168 period SMA.

Exit rules

  1. A short closes when the 3 period SMA rises above the 48 period SMA.
  2. No stop or target is set.

Test conditions

PeriodUp to 2026-10-04
InstrumentUSD/JPY, Daily
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 runDaily1.92 39932.833,388,270 USD-497,210
EUR/USDDaily1.56 34835.06194,023 USD-34,696
USD/JPY30 minn/a 5,93428.16695,680 USD-187,300
USD/JPY1 hourn/a 4,17128.60517,870 USD-356,320
Nikkei 225Dailyn/a 34828.7435,709 USD-27,797
Silver4 hoursn/a 95028.3232,506 USD-22,601
GBP/USDDailyn/a 42032.1414,998 USD-9,258
Nasdaq 100Dailyn/a 32230.7513,633 EUR-4,666
US Crude OilDailyn/a 34832.4712,651 EUR-6,980
GoldDailyn/a 43528.282,450 EUR-1,114
Gold1 hourn/a 3,49528.271,778 EUR-1,162

Charts

Results by run

Top 10 of 11 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 Crossover Trend Long Short
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

maf = Average[3](close)
mas = Average[48](close)
mat = Average[168](close)

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
Longer historyRe-run on up to 1,000,000 barsUSD/JPY · Daily · older data 1,460.00 USD

USD/JPY had no history beyond the standard run, so both runs used 12,000 bars.

USD/JPY · Daily

Bars available12,000
Net, standard 200,000-bar run3,388,270.00 USD
Net, long run3,389,730.00 USD
Net on the older data alone1,460.00 USD
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run SMA Crossover Trend Long Short 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 11 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.92 over 399 trades.

How large was the drawdown?

The best run had a maximum drawdown of 497,210 USD at the tested position size, against a net result of 3,388,270 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

200-Period Average Two-Way Crossover

Also a trend strategy.

1.92 PF · 370 trades

Put your name on the ProRealAlgos waitlist to trade a tested portfolio instead of single strategies.

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