Join waitlist
Strategies / Pattern / Doji Sweep With RSI Divergence

Doji Sweep With RSI Divergence

Buys after a dragonfly doji whose low undercuts the lowest low of the prior 50 bars while RSI(14) holds above its prior 50-bar low. Sells short on the mirror gravestone doji, with stops at the candle extreme and targets at 2.5 times the risk.

PatternLong & shortSwingNikkei 2251 hour
2.07Profit factor
6,662Net profit USD
27.19%Win rate
114Trades
-1,392Max drawdown
58.44Avg trade

Best run of 11. Nikkei 225, 1 hour, spread 10, from run pf:2026-10-05-NIKKEI-1h.tsv:5.

Entry rules, long

  1. The bar is a dragonfly doji with its body up to 10% of range, lower wick at least 70%, and upper wick up to 10%.
  2. RSI(14) is above the lowest RSI of the previous 50 bars.

Entry rules, short

  1. The bar is a gravestone doji with its body up to 10% of range, upper wick at least 70%, and lower wick up to 10%.
  2. RSI(14) is below the highest RSI of the previous 50 bars.

Exit rules

  1. The target sits at 2.5 times the risk distance from the entry price.

Test conditions

PeriodUp to 2026-10-05
InstrumentNikkei 225, 1 hour
Spread10 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
Nikkei 225Best run1 hour2.07 11427.196,662 USD-1,392
Nikkei 2254 hoursn/a 3036.672,890 USD-2,302
Nikkei 225Dailyn/a 1540.002,247 USD-1,123
US Crude Oil4 hoursn/a 3036.672,015 EUR-653
Brent Crude4 hoursn/a 1346.151,896 EUR-650
FTSE 100Dailyn/a 1258.331,605 EUR-944
DAX 40Dailyn/a 1520.001,387 EUR-709
SilverDailyn/a 540.00869 USD-292
S&P 500Dailyn/a 119.09353 EUR-248
Gold4 hoursn/a 3138.71156 EUR-53.80
GoldDailyn/a 955.5650.20 EUR-26.30

Charts

Results by run

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

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Doji Sweep With RSI Divergence
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Pattern
// Direction: Long & short
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

myRsi = RSI[14](close)
crange = high - low
body = abs(open - close)
upwick = high - max(open, close)
lowick = min(open, close) - low

31 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

RSI
Longer historyRe-run on up to 1,000,000 barsNikkei 225 · 1 hour · older data 0.00 USD

Nikkei 225 had no history beyond the standard run, so both runs used 90,000 bars.

Nikkei 225 · 1 hour

Bars available90,000
Net, standard 200,000-bar run6,662.00 USD
Net, long run6,662.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 Doji Sweep With RSI Divergence 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 11 market and timeframe combinations. The best run was Nikkei 225, 1 hour, with a profit factor of 2.07 over 114 trades.

How large was the drawdown?

The best run had a maximum drawdown of 1,392 USD at the tested position size, against a net result of 6,662 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

Rock Climber

Best run on the same market, Nikkei 225.

1.44 PF · 1,644 trades

Three Candle Moving Average Pattern

Also a pattern strategy.

2.09 PF · 225 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