Join waitlist
Strategies / Pattern / Reversal Pattern With EMA Trend Filter

Reversal Pattern With EMA Trend Filter

Requires a reversal state built from a stochastic and an EMA(20) trend state to agree before entering. It buys when both are up, sells short when both are down, and closes any position when they disagree.

PatternLong & shortSwingUSD/JPYDaily
1.58Profit factor
2,784,420Net profit USD
34.80%Win rate
477Trades
-339,645Max drawdown
5,837Avg trade

Best run of 4. USD/JPY, Daily, spread 1, from run pf:2026-10-12-USDJPY-D.tsv:23.

Entry rules, long

  1. The EMA state turns up when close is above EMA(20) and above a band level taken from the last two bars' highs or lows.
  2. A long is opened at market when both states are up and no long position is open.

Entry rules, short

  1. The EMA state turns down when close is below EMA(20) and below the band level.
  2. A short is opened at market when both states are down and no short position is open.

Exit rules

  1. A position closes at market when the two states disagree.

Test conditions

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

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily1.58 47734.802,784,420 USD-339,645
Silver4 hoursn/a 1,15630.1924,645 USD-13,411
Brent CrudeDailyn/a 18733.6913,455 EUR-5,849
Gold4 hoursn/a 1,09833.791,623 EUR-984

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Reversal Pattern With EMA Trend Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Pattern
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE posrev = 0
ONCE sincebad = 1000
ONCE postwo = 0

ll = lowest[14](low)
hh = highest[14](high)

57 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

EMAStochasticSMA
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run Reversal Pattern With EMA Trend Filter 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 USD/JPY, Daily, with a profit factor of 1.58 over 477 trades.

How large was the drawdown?

The best run had a maximum drawdown of 339,645 USD at the tested position size, against a net result of 2,784,420 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

Lower Low Dip Buyer

Also a pattern strategy.

1.58 PF · 345 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