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.
Best run of 1. Gold, 4 hours, spread 0.6, from run sweeps:2026-09-23-GOLD-4h-opt.tsv:2.
| Period | Up to 2026-09-23 |
| Instrument | Gold, 4 hours |
| Spread | 0.6 points |
| Contracts | 1 |
| Starting capital | 1,000,000 |
| Costs | Spread only. Commissions and overnight financing are not included. |
| Bars | Up to 200,000 bars, fewer where the instrument has less history |
| Last tested | 2026-09-23 |
| positionSize Contracts per trade | 1 |
| stopLossPoints Protective stop | 30 |
| takeProfitPoints Profit target | 45 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 4 hours | n/a | 2,564 | 39.74 | 1,463 EUR | -860 |
Charts
The code
// ============================================================ // 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.
Setup
Questions
Yes, it needs only candle colours and fixed stop and target. The rewritten code is not compile-checked yet.
Only Gold 4 hours, which made EUR 1,463.1 over 2,564 trades.
The Gold run had a max drawdown of EUR 860.1 with 1 contract.
Three candles in a row on 4 hour Gold means a move lasting many hours, which fits the 45 point target.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.