EA-68704 · Candlestick Pattern

Price Action Day Trader

A daily price action EA that identifies pin bar, engulfing, and inside bar candlestick patterns to generate trade signals, filtered by EMA trend direction and support/resistance proximity. It employs risk-based position sizing, daily loss limits, breakeven and trailing stop management, with automated broker filling mode detection for robust order execution.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskLow
Blow-up riskLow
Rating★★★☆☆
TypeTrading EA
TimeframesH1, H4, D1
IndicatorsEMA
AuthorPrice Action Day Trader

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

None of the usual blow-up patterns were found in the code, 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 trades classic price action candlestick patterns, including pin bars (long-wick reversal patterns), bullish/bearish engulfing patterns, and inside bar breakouts. Entry conditions require candlestick pattern signals to align with the EMA trend direction (determined by the crossover relationship between the 20-period fast and 50-period slow EMAs), and pin bars must additionally form near support/resistance levels. Exit conditions include fixed stop loss and take profit based on a configurable risk:reward ratio, breakeven stop loss movement, and a trailing stop mechanism. Position sizing dynamically calculates lot size based on a risk percentage of account balance, ensuring each trade's risk is controlled and proportional. Money management incorporates a daily maximum loss percentage limit that halts new trading when the daily loss threshold is breached, along with an optional end-of-day position closure feature.

Strengths

  • Comprehensive risk management system including risk-based dynamic position sizing, daily maximum loss limit, and configurable risk:reward ratio
  • Multiple candlestick pattern recognition with EMA trend filtering and support/resistance confirmation provides relatively strict entry conditions
  • Robust order execution with auto-detection of broker filling modes, alternative filling mode retry on failure, stop level validation, and freeze level checks

Weaknesses

  • Only one position at a time is allowed (new entries require PositionsTotal()==0), severely limiting the strategy's profit potential and flexibility
  • Support/resistance identification is overly simplistic, using only a fixed tolerance to match historical highs/lows without proper key level clustering logic
  • No spread filter or slippage protection, which can cause candlestick pattern distortion and excessive trading costs in high-spread environments
  • Inside bar breakout signal uses the current unclosed bar (index=0) for breakout confirmation, leading to unstable signals and potential repeated triggers

Possible improvements

  • Add a spread filter mechanism to skip trading when the spread exceeds a threshold, avoiding irrational entries in high-spread environments
  • Improve support/resistance identification by introducing price clustering or fractal-based detection with strength scoring for better filtering quality
  • Allow multiple simultaneous positions or add a maximum position count parameter to improve profitability when multiple signals occur concurrently

Risk assessment

Overall risk: Low

  • Inside bar breakout signal uses the unclosed current bar for confirmation, which may generate false signals before bar closure leading to unnecessary entries
  • No spread filter present, potentially encountering significant slippage and wide spreads during low-liquidity sessions (e.g., at the 2 AM trading start hour)

Evaluation scores

Code quality4.0
Strategy logic3.0
Risk management4.0
Robustness4.0
Innovation2.0
Documentation2.0
Overall3.2

Parameters

ParameterDefaultDescription
RiskPercent1.5Risk per trade as balance percentage
StopLossPips40Stop loss in points
TakeProfitRatio2.0Risk-reward ratio (TP/SL)
MaxDailyLoss3.0Max daily loss as balance percentage
PinBarPipSize10Pin Bar minimum wick size in points
PinBarRatio2.0Pin Bar wick-to-body ratio
EngulfingMinPips15Engulfing pattern minimum candle size in points
SRLookback20Support/resistance lookback period count
SRTolerance10Support/resistance tolerance in points
FastMA20Fast MA period
SlowMA50Slow MA period
MAMethodMODE_EMAMA calculation method
StartHour2Trading start hour (broker time)
EndHour20Trading end hour (broker time)
CloseAtEndOfDaytrueClose positions at end of trading day
MagicNumber123456EA magic number
UseBreakEventrueEnable move SL to break-even
BreakEvenPips20Points to trigger break-even
UseTrailingStoptrueEnable trailing stop
TrailingStopPips30Trailing stop distance in points
TrailingStepPips10Trailing stop step in points
FillingModeORDER_FILLING_FOKPreferred filling mode
AutoDetectFillingtrueAuto-detect broker filling mode

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.