pattern.mq5
This EA detects and trades based on classic Japanese candlestick patterns such as engulfing, doji, hammer, and shooting star formations. It generates entry signals when recognized patterns align with trend filters, automatically opening and managing positions. The strategy relies on pattern recognition combined with optional trend confirmation indicators.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.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 candlestick pattern recognition for trading decisions, including classic patterns such as bullish engulfing, bearish engulfing, hammer, shooting star, and doji. Entry conditions require identifying a valid candlestick pattern aligned with trend direction confirmation, for example going long when a bullish pattern appears in an uptrend. Exit conditions typically use fixed stop loss and take profit levels, and may also close positions when a reversal pattern is detected. Position sizing uses either fixed lots or percentage-based calculation tied to account balance. In terms of money management, the EA provides stop loss parameter settings but lacks dynamic position adjustment mechanisms, making risk control relatively simple. The overall strategy logic is clear but depends on the accuracy of pattern recognition, which may generate numerous false signals in ranging markets.
Strengths
- Based on classic candlestick pattern recognition with intuitive and easy-to-understand strategy logic that facilitates verification and optimization
- Provides a trend filter to reduce false signals in ranging markets, improving signal quality
- Parameterized design allows users to adjust pattern strength and risk parameters, offering reasonable flexibility
Weaknesses
- Candlestick pattern recognition is prone to false breakouts and fake signals on lower timeframes or in highly volatile markets
- Lacks dynamic position sizing and scaling mechanisms, unable to adaptively adjust risk based on market volatility
- No spread filter or trading session filter, which may lead to unfavorable fills during low-liquidity periods
Possible improvements
- Add ATR-based dynamic stop loss and take profit mechanism to adaptively adjust risk parameters based on market volatility
- Incorporate trading session and spread filters to avoid trading during low-liquidity periods and excessive spreads
Risk assessment
Overall risk: Medium
- Candlestick pattern recognition can generate consecutive false signals in ranging markets leading to multiple losses
- Fixed stop loss and take profit do not account for market volatility changes, potentially getting stopped out too easily during high volatility
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
LotSize | 0.1 | Fixed lot size (0 = dynamic calculation) |
StopLoss | 50 | Stop loss in points |
TakeProfit | 100 | Overall take profit target (points) |
PatternStrength | 2 | Pattern strength filter level |
UseTrendFilter | true | Enable trend filter |
TrendPeriod | 50 | Trend determination MA period |
MaxOpenOrders | 3 | Maximum simultaneous positions |
MagicNumber | 12345 | EA magic number to identify its own orders |
Similar Candlestick Pattern EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.