Join waitlist
Strategies / Pattern / Long Legged Doji Breakout

Long Legged Doji Breakout

The strategy waits for a long-legged doji candle, then buys when close rises above that doji's high or sells short when close falls below its low. Longs close when price crosses below a 20-period average, and shorts close when price crosses above it.

PatternLong & shortIntradayDAX 4015 min
n/aProfit factor
595Net profit EUR
35.29%Win rate
85Trades
-434Max drawdown
7.00Avg trade

Best run of 5. DAX 40, 15 min, spread 3, from run sweeps:2026-10-12-DAX40-15m-opt.tsv:8.

Entry rules, long

  1. The candle is a long-legged doji: its body is up to 0.001 of its range.
  2. Both wicks are at least 2 times the body and at least 0.5 times the 14-period ATR.

Entry rules, short

  1. The close then crosses below the stored doji low, which ends the wait.

Exit rules

  1. A short closes when the close crosses above the 20-period SMA.

Test conditions

PeriodUp to 2026-10-12
InstrumentDAX 40, 15 minutes
Spread3 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
DAX 40Best run15 minn/a 8535.29595 EUR-434
Silver4 hoursn/a 1776.474,620 USD-780
SilverDailyn/a 4100.001,233 USD-264
DAX 404 hoursn/a 683.33534 EUR-144
US Crude Oil1 minn/a 4032.50252 EUR-173

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Long Legged Doji Breakout
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Pattern
// Direction: Long & short
// Timeframe tested: 15 minutes
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE dh = 0
ONCE dl = 0
ONCE wait = 0

myAtr = AverageTrueRange[14](close)
sma = Average[20](close)
body = abs(close - open)
rng = high - low
upw = high - max(open, close)
myLow = min(open, close) - low

32 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

ATRSMA
Read this firstKnown weaknesses4 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The best run has only 85 trades, which is a small sample to judge it on.
  • The maximum drawdown of 434 EUR is large next to the net profit of 595 EUR.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run Long Legged Doji Breakout 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 5 market and timeframe combinations. The best run by trade count was DAX 40, 15 minutes, with 85 trades.

How large was the drawdown?

The best run had a maximum drawdown of 434 EUR at the tested position size, against a net result of 595 EUR.

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

Heikin Ashi Color Flip

Best run on the same market, DAX 40.

1.12 PF · 3,692 trades

Breakout Reversal

Also a pattern strategy.

n/a PF · 459 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