Join waitlist
Strategies / Trend / EMA Crossover With ATR Brackets

EMA Crossover With ATR Brackets

The system buys when EMA(20) is above EMA(50) and the close crosses above EMA(20), and sells short on the mirror condition. Stops and targets sit 2 and 4 times ATR(14) from the entry, and an opposite signal reverses the trade.

TrendLong & shortSwingSilver4 hours
3.36Profit factor
310,939Net profit USD
31.03%Win rate
809Trades
-18,495Max drawdown
384Avg trade

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

Entry rules, long

  1. EMA(20) is above EMA(50).

Entry rules, short

  1. EMA(20) is below EMA(50).

Exit rules

  1. A stop loss at 2 times ATR(14) from the entry price.
  2. A profit target at 4 times ATR(14) from the entry price.
  3. A repeated signal in the same direction resets the stop and target from the new close.

Test conditions

PeriodUp to 2026-10-05
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-05

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
SilverBest run4 hours3.36 80931.03310,939 USD-18,495
USD/JPYDaily1.47 80640.4549,710 USD-7,670
Nikkei 2254 hoursn/a 65832.2219,245 USD-16,268
US Crude Oil4 hoursn/a 60235.0510,536 EUR-4,788

Charts

Results by run

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// EMA Crossover With ATR Brackets
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

fast = ExponentialAverage[20](close)
slow = ExponentialAverage[50](close)
myAtr = AverageTrueRange[14](close)

28 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 run49,710.00 USD
Net, long run49,710.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 ATR Brackets 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 4 market and timeframe combinations. The best run was Silver, 4 hours, with a profit factor of 3.36 over 809 trades.

How large was the drawdown?

The best run had a maximum drawdown of 18,495 USD at the tested position size, against a net result of 310,938 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

SMA Crossover With RSI Exit

Best run on the same market, Silver.

2.13 PF · 8,999 trades

EMA Trend Switch Long Only

Also a trend strategy.

3.35 PF · 106 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