Join waitlist
Strategies / Trend / EMA Crossover With Risk Bracket

EMA Crossover With Risk Bracket

The system goes long when the 20-period EMA crosses above the 50-period EMA and short on the opposite cross. Each trade has a stop 1.5 times ATR(14) from entry and a target twice that distance.

TrendLong & shortSwingUSD/JPYDaily
1.74Profit factor
15,260Net profit USD
40.87%Win rate
230Trades
-3,240Max drawdown
66.35Avg trade

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

Entry rules, long

  1. The 20-period EMA crosses above the 50-period EMA.

Entry rules, short

  1. The 20-period EMA crosses below the 50-period EMA.

Exit rules

  1. The target is 2.0 times the stop distance from the fill.
  2. 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.74 23040.8715,260 USD-3,240
US Crude OilDaily1.51 21240.0911,607 EUR-2,561
Nasdaq 100Dailyn/a 20037.008,146 EUR-2,616
Brent CrudeDailyn/a 9840.827,939 EUR-2,198
US Crude Oil4 hoursn/a 43135.966,920 EUR-2,813
Nasdaq 1001 hourn/a 2,24029.116,549 EUR-4,865
Dow Jones30 minn/a 1,50833.955,291 EUR-4,025

Charts

Results by run

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// EMA Crossover With Risk Bracket
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

fast = ExponentialAverage[20](close)
slow = ExponentialAverage[50](close)
myAtr = AverageTrueRange[14](close)
sldist = myAtr * 1.5
tpdist = sldist * 2.0

13 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

EMAATR
Longer historyRe-run on up to 1,000,000 barsUSD/JPY · Daily · older data 0.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 run15,260.00 USD
Net, long run15,260.00 USD
Net on the older data alone0.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 EMA Crossover With Risk Bracket 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 7 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.74 over 230 trades.

How large was the drawdown?

The best run had a maximum drawdown of 3,240 USD at the tested position size, against a net result of 15,260 USD.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Reversal Pattern With Chaikin Volatility

Uses the same indicator.

2.26 PF · 6,872 trades

Trend Surfer

Best run on the same market, USD/JPY.

1.04 PF · 10,813 trades

SMA And Hull Average Crossover

Also a trend strategy.

1.74 PF · 730 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