Join waitlist
Strategies / Trend / EHMA Turn With ATR Bracket

EHMA Turn With ATR Bracket

Buys when the EHMA turns upward while a triple-smoothed Gaussian line is rising, with a stop 2 ATR below and target 4 ATR above the entry. Sells when the EHMA turns downward while a long is open.

TrendLong onlySwingSilver4 hours
7.57Profit factor
328,527Net profit USD
33.47%Win rate
493Trades
-7,409Max drawdown
666Avg trade

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

Entry rules, long

  1. The Gaussian line, an EMA of 20 periods applied three times, is rising.
  2. Signals are only considered after bar 100.

Exit rules

  1. The bracket is a stop 2 times ATR (14) below the entry price and a target 4 times ATR (14) above it.
  2. A repeat entry signal while long resets the bracket using the new ATR (14).

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 hours7.57 49333.47328,527 USD-7,409
USD/JPYDaily1.64 20142.7915,890 USD-2,380
GoldDaily1.59 20336.451,277 EUR-300
SilverDailyn/a 14535.1714,460 USD-3,796
Brent CrudeDailyn/a 9339.784,957 EUR-2,901
DAX 404 hoursn/a 56732.454,924 EUR-2,628
Nasdaq 1004 hoursn/a 58733.392,668 EUR-1,755
Gold4 hoursn/a 53033.401,327 EUR-562

Charts

Results by run

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// EHMA Turn With ATR Bracket
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

diff = 2 * ExponentialAverage[15](close) - ExponentialAverage[30](close)
ehma = ExponentialAverage[5](diff)
gfa = ExponentialAverage[20](close)
gfb = ExponentialAverage[20](gfa)
gf = ExponentialAverage[20](gfb)
myAtr = AverageTrueRange[14](close)

17 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

ATREMA
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,890.00 USD
Net, long run15,890.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 EHMA Turn With ATR 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 8 market and timeframe combinations. The best run was Silver, 4 hours, with a profit factor of 7.57 over 493 trades.

How large was the drawdown?

The best run had a maximum drawdown of 7,408 USD at the tested position size, against a net result of 328,527 USD.

Does it trade long, short or both?

It only takes long trades.

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

Slow MACD Slope

Also a trend strategy.

6.80 PF · 7,305 trades

Get the full rules, the complete code and the ProRealAlgos portfolio as a member.

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