Join waitlist
Strategies / Momentum / Reversal With Ergodic Candlestick Oscillator

Reversal With Ergodic Candlestick Oscillator

Buys when a reversal pattern on closing prices and an Ergodic Candlestick Oscillator both point up, and sells short when both point down. Any open position is closed when the two signals disagree.

MomentumLong & shortSwingUSD/JPYDaily
1.85Profit factor
2,958,900Net profit USD
36.82%Win rate
258Trades
-417,910Max drawdown
11,469Avg trade

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

Entry rules, long

  1. Candlestick state is +1 when the ratio of smoothed close minus open to smoothed range is above 0, and -1 otherwise.
  2. The system buys one contract at market when both states are +1.

Entry rules, short

  1. Candlestick state is -1 when that ratio is 0 or below.
  2. The system sells short one contract at market when both states are -1.

Exit rules

  1. A short closes when the two states no longer both point down.
  2. There is no stop or target.

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.85 25836.822,958,900 USD-417,910
USD/JPY30 minn/a 4,22930.79573,300 USD-270,030
USD/JPY10 minn/a 4,30130.02359,610 USD-218,180
USD/JPY15 minn/a 4,29430.23223,240 USD-216,770
Nikkei 225Dailyn/a 24634.1526,219 USD-23,326
Brent CrudeDailyn/a 10735.5112,719 EUR-10,607
US Crude OilDailyn/a 22334.0812,284 EUR-8,594
DAX 4030 minn/a 4,14331.119,390 EUR-5,600
GoldDailyn/a 27936.202,283 EUR-980
Gold1 hourn/a 2,58031.472,010 EUR-993
Gold30 minn/a 4,04129.701,289 EUR-1,104
Gold4 hoursn/a 65934.141,241 EUR-1,063

Charts

Results by run

Top 10 of 12 runs. The full list is in the table above.

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Reversal With Ergodic Candlestick Oscillator
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE posrev = 0
ONCE sincebad = 1000
ONCE poseco = 0

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

56 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

EMASMAStochastic
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 Reversal With Ergodic Candlestick Oscillator 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 12 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.85 over 258 trades.

How large was the drawdown?

The best run had a maximum drawdown of 417,910 USD at the tested position size, against a net result of 2,958,900 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

Five Bar Rising Average Price

Also a momentum strategy.

1.85 PF · 235 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