Join waitlist
Strategies / Trend / SMA Crossover Swing Stop Target

SMA Crossover Swing Stop Target

It buys when SMA(5) crosses above SMA(9) and sells short on the cross below, reversing each time. The stop sits at the 5-bar low or high, with a target twice that risk.

TrendLong & shortSwingUSD/JPYDaily
1.25Profit factor
53,820Net profit USD
32.11%Win rate
1,660Trades
-12,260Max drawdown
32.42Avg trade

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

Entry rules, long

  1. The close is more than one tick above the lowest low of the last 5 bars.

Entry rules, short

  1. The highest high of the last 5 bars is more than one tick above the close.

Exit rules

  1. The long target is twice that risk distance from the entry.
  2. The short stop sits at the highest high of the last 5 bars, and the short target is twice that risk distance from the entry.
  3. An opposite crossover reverses the position.

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.25 1,66032.1153,820 USD-12,260
Gold4 hours1.13 3,90636.412,863 EUR-705
Brent CrudeDailyn/a 64439.1311,810 EUR-6,997

Charts

Results by run

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// SMA Crossover Swing Stop Target
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

smafast = Average[5](close)
smaslow = Average[9](close)

20 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
  • 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 Swing Stop Target 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 3 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.25 over 1,660 trades.

How large was the drawdown?

The best run had a maximum drawdown of 12,260 USD at the tested position size, against a net result of 53,820 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

Directional Movement Trend Long

Also a trend strategy.

1.25 PF · 1,365 trades

Want strategies that are already part of a live portfolio? Join the ProRealAlgos waitlist.

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