
CandlePatternBot
In 9 months, I earned what you see on the screenshot — the CandlePatternBot harnesses classic candlestick formations with strict entry/exit rules and a direction bias. It opens on bar close, filters noise with body-size thresholds, and can exit by SL/TP or on the next pattern so it adapts fast when the market tone flips.
Disclaimer: figures shown are from my run and for illustration only; past performance doesn’t guarantee future results. Always validate on your own data and size risk appropriately.
CandlePatternBot — User Guide
What it does
- Scans the last 2–3 bars for enabled candlestick patterns.
- Enters at bar close (market orders).
- Optional Trend Bias to trade all, bullish-only, or bearish-only signals.
- Exits by SL/TP and/or on the next detected pattern (configurable).
- Controls trading frequency with One Trade Per Bar and Max Concurrent Positions.
Settings
Core
- Pattern Start
Confirmed
— builds patterns on already closed bars (i-1, i-2, i-3). Cleaner, less noise.Immediate
— includes the just-closed bar (i, i-1, i-2). Earlier signals, more noise.
- MA Period (AvgBody) — window length for the average candle body; used in size filters.
- Min Body Ratio vs Avg — minimum body size as a fraction of AvgBody (0 = disabled).
Example:0.5
→ each required body must be ≥ 50% of the average. - Trend Bias
All
— trade all signals,BullOnly
— only bullish (longs),BearOnly
— only bearish (shorts).
- One Trade Per Bar — prevent more than one entry per bar.
- Max Concurrent Positions — cap simultaneous positions per symbol (0 = no cap).
Exit (when to close)
- Exit Rule
TP_SL_Only
— close only by stop/target.NextOpposite
— close positions against the next pattern’s direction.NextAny
— close all positions on any new pattern.TP_SL_or_NextOpposite
— SL/TP or opposite pattern (whichever comes first).TP_SL_or_NextAny
— SL/TP or any new pattern.
Risk
- Volume (Units) — trade size in units (on FX, ~100,000 units ≈ 1.00 lot).
- Stop Loss (pips), Take Profit (pips) — levels in instrument pips.
0
= don’t set.
Pattern toggles
Enable/disable each formation individually (see logic below). Keep only those that prove effective for your symbol/timeframe.
Candlestick Patterns
Bullish (long)
- Three White Soldiers — three consecutive bullish candles; each closes above the previous; bodies meet the
Min Body Ratio × AvgBody
threshold. - Piercing Line — after a bearish candle, the next opens below its low and closes above the midpoint of the first body, yet below its open.
- Morning Doji — big bearish, then a small-body/doji, then a solid bullish closing above the first candle’s midpoint; gap down then up behavior.
- Bullish Engulfing — bearish candle followed by a bullish candle whose body fully engulfs the prior body; bullish body is sufficiently large (≥ ~2 × AvgBody × MinRatio in code).
- Morning Star — big bearish, small “star” below, then bullish closing above the first candle’s midpoint.
- Hammer — small body, long lower shadow (> 2× body), short upper shadow; in a downward context (prior close > current high).
- Bullish Harami — large bearish candle, then a small bullish inside the first body (both open/close inside); body2 ≤ 50% of body1.
- Bullish Meeting Lines — bearish then bullish; gap down on open; closes nearly equal (difference ≤ 0.1 × AvgBody) plus bullish confirmation on the current bar.
Bearish (short)
- Three Black Crows — three consecutive bearish candles; each closes below the previous; bodies satisfy the
Min Body Ratio × AvgBody
filter. - Dark Cloud Cover — after a strong bullish candle, the next opens above its high and closes below its midpoint but above its open.
- Evening Doji — big bullish, then small-body/doji above, then a solid bearish that closes below the first candle’s midpoint; gaps present.
- Bearish Engulfing — bullish candle followed by bearish whose body fully engulfs the prior body; bearish body large enough (≥ ~2 × AvgBody × MinRatio).
- Evening Star — big bullish, small “star” above, then bearish closing below the first candle’s midpoint.
- Hanging Man — small body, very long lower shadow (> 3× body), short upper shadow; in an upward context (prior close < current high).
- Bearish Harami — large bullish, then small bearish inside the first body; body2 ≤ 50% of body1.
- Bearish Meeting Lines — bullish then bearish; gap up on open; closes nearly equal (≤ 0.1 × AvgBody) with bearish confirmation on the current bar.
Notes on implementation
- “Small body” for stars/doji is
|Open - Close| < ~0.1 × AvgBody
. - Context checks enforce downtrend/uptrend surroundings for Hammer/Hanging Man.
- Many models also require minimum body size via
Min Body Ratio × AvgBody
.
Practical tips
- Reduce noise:
Pattern Start = Confirmed
,Min Body Ratio ≥ 0.5
. - Directional focus:
Trend Bias = BullOnly
orBearOnly
. - Control trade frequency: enable a core subset (Engulfing, Stars, Soldiers/Crows, Hammer/Hanging Man).
- Adaptive exits:
TP_SL_or_NextOpposite
balances profit-taking with quick tone changes;NextAny
is more aggressive.