Join waitlist
Strategies / Breakout / Swing Break With EMA and RSI

Swing Break With EMA and RSI

The strategy buys when the 50-period EMA is above the 200-period EMA, RSI(14) is above 55, and the close crosses above the last confirmed swing high. It sells short on the mirror setup.

BreakoutLong & shortSwingSilver4 hours
3.95Profit factor
237,807Net profit USD
26.16%Win rate
841Trades
-11,337Max drawdown
283Avg trade

Best run of 9. Silver, 4 hours, spread 2, from run pf:2026-10-04-SILVER-4h.tsv:6.

Entry rules, long

  1. The 50-period EMA is above the 200-period EMA.
  2. RSI(14) is above 55.
  3. Buys one contract at market when flat, after bar 200.

Entry rules, short

  1. The 50-period EMA is below the 200-period EMA.
  2. RSI(14) is below 45.
  3. Sells short one contract at market when flat, after bar 200.

Exit rules

  1. A repeat signal in the same direction moves the stop and target to the current close, using the same distances.
  2. An opposite signal closes the trade and reverses it.

Test conditions

PeriodUp to 2026-10-04
InstrumentSilver, 4 hours
Spread2 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
SilverBest run4 hours3.95 84126.16237,807 USD-11,337
Gold4 hours1.65 85331.303,199 EUR-279
Nikkei 225Dailyn/a 31232.3718,713 USD-6,737
SilverDailyn/a 33228.3110,806 USD-4,459
US Crude OilDailyn/a 28433.807,591 EUR-5,158
Brent CrudeDailyn/a 11536.527,573 EUR-3,103
DAX 401 hourn/a 3,04027.734,317 EUR-2,717
GoldDailyn/a 38931.621,226 EUR-660
S&P 500Dailyn/a 48225.52882 EUR-671

Charts

Results by run

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// Swing Break With EMA and RSI
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long & short
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE lasthigh = 0
ONCE hashigh = 0
ONCE lastlow = 0
ONCE haslow = 0

emafast = ExponentialAverage[50](close)
emaslow = ExponentialAverage[200](close)
myRsi = RSI[14](close)
myAtr = AverageTrueRange[14](close)

44 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

ATREMARSI
Longer historyRe-run on up to 1,000,000 barsGold · 4 hours · older data 3.30 EUR

Gold had no history beyond the standard run, so both runs used 30,000 bars.

Gold · 4 hours

Bars available30,000
Net, standard 200,000-bar run3,199.20 EUR
Net, long run3,202.50 EUR
Net on the older data alone3.30 EUR
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 Swing Break With EMA and RSI 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 9 market and timeframe combinations. The best run was Silver, 4 hours, with a profit factor of 3.95 over 841 trades.

How large was the drawdown?

The best run had a maximum drawdown of 11,337 USD at the tested position size, against a net result of 237,807 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

SMA Crossover With RSI Exit

Best run on the same market, Silver.

2.13 PF · 8,999 trades

Volume Confirmed Band Breakout

Also a breakout strategy.

4.21 PF · 227 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