Join today
Strategies / Pattern / Three Bars Pattern

Three Bars Pattern: Following Three Candles in a Row

Three bullish candles in a row trigger a long, and three bearish candles trigger a short. Each trade has a 30 point stop and a 45 point target. An opposite pattern reverses the position.

PatternLong & shortSwingGold4 hours
n/aProfit factor
1,463Net profit EUR
39.74%Win rate
2,564Trades
-860Max drawdown
0.57Avg trade

Best run of 1. Gold, 4 hours, spread 0.6, from run sweeps:2026-09-23-GOLD-4h-opt.tsv:2.

Entry rules, long

  1. Members only

Entry rules, short

  1. Members only

Exit rules

  1. Stop loss 30 points
  2. Members only
  3. An opposite signal reverses the position

Test conditions

PeriodUp to 2026-09-23
InstrumentGold, 4 hours
Spread0.6 points
Contracts1
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-09-23

Parameters

positionSize
Contracts per trade
1
stopLossPoints
Protective stop
30
takeProfitPoints
Profit target
45

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest run4 hoursn/a 2,56439.741,463 EUR-860

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-1K-5001K2KGold · 4 hours

The code

ProBuilder, rewritten to house standard

Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.

// ============================================================
// Three Bars Pattern
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Pattern
// Direction: Long & short
// Timeframe tested: 4 hours
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false

// --- Parameters ---
positionSize = 1          // contracts per trade
stopLossPoints = 30       // protective stop
takeProfitPoints = 45     // profit target

// --- Indicators ---
threeUpBars = close > open AND close[1] > open[1] AND close[2] > open[2]
threeDownBars = close < open AND close[1] < open[1] AND close[2] < open[2]

20 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • Only one run exists, on Gold 4 hours, so there is no evidence it works elsewhere.
  • The average trade was EUR 0.57 over 2,564 trades, thin enough that extra costs could remove it.
  • The win rate is 39.74%, so losing streaks are common even with the 45 point target.
  • Profit factor was not recorded because only sweep data exists.

How to load it

  1. Copy the code with the copy button above 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.

Questions

About this strategy

Can this pattern strategy run in ProOrder?

Yes, it needs only candle colours and fixed stop and target. The rewritten code is not compile-checked yet.

Which markets were tested?

Only Gold 4 hours, which made EUR 1,463.1 over 2,564 trades.

What drawdown with 1 contract?

The Gold run had a max drawdown of EUR 860.1 with 1 contract.

Why a 4 hour chart?

Three candles in a row on 4 hour Gold means a move lasting many hours, which fits the 45 point target.

Related

Strategies like this one

Triple Band Market Model

Best run on the same market, Gold.

2.27 PF · 203 trades

Winter Only

Also a pattern strategy.

14.53 PF · 49 trades

Turn Of The Month

Also a pattern strategy.

4.86 PF · 47 trades

Talk candle pattern systems with other ProRealTime traders. Join the ProRealAlgos community 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