EA-32957 · Candlestick Pattern

CandlePatternsExample

This EA demonstrates the use of MQL5 built-in candlestick pattern recognition classes from the Standard Library. It detects classic Japanese candlestick patterns (Engulfing, Harami, Hammer, Doji Star, etc.) and automatically opens buy or sell positions based on the identified pattern signals, using fixed lot sizes and configurable stop-loss/take-profit levels.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Blow-up riskLow
Rating★★★☆☆
TypeTrading EA
TimeframesH1, H4, D1
IndicatorsCandlestick Patterns, CCandlePattern
AuthorYTMJ

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD0.00%0.00%0.00%0—————Not convertible yet
GBPUSD0.00%0.00%0.00%0—————Not convertible yet
USDJPY0.00%0.00%0.00%0—————Not convertible yet
XAUUSD0.00%0.00%0.00%0—————Not convertible yet

Why this EA never traded: no entry rule survived the conversion.

Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.

Blow-up risk: No blow-up pattern found

  • Has no stop loss or trailing stop

On its own this is not a typical blow-up pattern, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.

High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →

Strategy analysis

The core strategy of this EA is based on classic Japanese candlestick pattern recognition for trading decisions, leveraging the CCandlePattern class and its derivatives from the MQL5 Standard Library to detect multiple reversal and continuation patterns. Entry conditions: long positions are opened when bullish candlestick patterns (such as bullish engulfing, morning star, hammer) are detected, and short positions are opened when bearish patterns (such as bearish engulfing, evening star, hanging man) are identified. Exit conditions rely on fixed stop-loss and take-profit levels with no dynamic trailing stop mechanism. Position sizing uses a fixed lot approach without dynamic adjustment based on account balance or risk ratios. Money management is simplistic, lacking maximum position limits or drawdown control mechanisms. The overall strategy represents a classical pattern recognition trading approach, best suited for learning MQL5 EA development frameworks and pattern recognition class usage.

Strengths

  • Leverages MQL5 Standard Library pattern recognition classes with clean, well-structured code serving as an excellent learning example
  • Covers multiple classic candlestick patterns with intuitive and easy-to-understand strategy logic for easy comprehension and extension
  • Built on the Standard Library for high reusability, making it convenient to develop more complex pattern recognition strategies on this foundation
  • High degree of code modularity with pattern detection and trading logic properly separated, providing sound architecture

Weaknesses

  • Fixed lot sizing without dynamic position management cannot adapt to market volatility or account risk
  • Lacks multi-layer filtering mechanisms; relying solely on single candlestick pattern signals easily generates frequent false signals
  • No drawdown control or maximum position limits, leading to significant risk exposure during consecutive losses
  • Stop-loss and take-profit use fixed pip values without considering ATR or other volatility indicators for dynamic adjustment
  • As a sample EA, its live trading performance is limited, lacking sufficient real-market verification and optimization

Possible improvements

  • Add multi-timeframe confirmation and multi-indicator filtering (e.g., trend direction, volume confirmation) to reduce false signals
  • Introduce ATR-based dynamic stop-loss/take-profit and risk-ratio-based dynamic position sizing
  • Add drawdown control mechanisms and maximum simultaneous position limits to enhance money management safety

Risk assessment

Overall risk: Medium

  • Single candlestick pattern signals easily generate false trades without multi-dimensional confirmation
  • Fixed stop-loss/take-profit ignores market volatility; stops may be too tight during high-volatility conditions
  • No drawdown control or maximum position limit mechanisms in place

Evaluation scores

Code quality4.0
Strategy logic3.0
Risk management2.0
Robustness3.0
Innovation2.0
Documentation4.0
Overall3.0

Parameters

ParameterDefaultDescription
LotSize0.1Fixed lot size per trade
StopLoss50Stop loss in points
TakeProfit100Take profit in points (profit target)
Expiration10Signal validity period (in bars)
CandlePatternType0Candlestick pattern type selection

Similar Candlestick Pattern EAs

Backtests are historical simulations and do not guarantee future results. Not financial advice.

Get the weekly Arena report

One email a week: ranking changes, new signals and new research. No spam; unsubscribe any time.