Exp_CandleTrend
This EA generates trading signals based on a simple candlestick trend pattern: it opens a buy position when a configurable number of consecutive bullish candles appear, and a sell position when the same number of consecutive bearish candles appear. It includes stop loss, take profit, and multiple money management modes via the TradeAlgorithms.mqh library.
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
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 strategy concept is based on trend confirmation via consecutive same-direction candles, assuming that N consecutive bullish candles indicate strong upward momentum and N consecutive bearish candles indicate strong downward momentum. Entry conditions: buy when all candles in the lookback window (CandleTrendTotal, default 3) are bullish (close > open), sell when all are bearish (close < open). Exit conditions rely on fixed stop loss (1000 points) and take profit (2000 points), with optional position closing on reverse signals enabled by BuyPosClose/SellPosClose parameters. Position sizing offers five modes: free margin share, balance share, loss-based free margin share, loss-based balance share, and fixed lot size. Money management uses the MM parameter (default 0.1) to control position proportion, combined with MMMode to select the calculation method. Signal detection occurs only on new bars of the specified timeframe, preventing redundant calculations, though setting SignalBar=0 triggers recalculation on every tick.
Strengths
- Simple and clear strategy logic, easy to understand and verify
- Multiple money management modes providing good flexibility
- Includes stop loss and take profit settings for basic risk control
- Uses IsNewBar mechanism to avoid duplicate signals and reduce unnecessary trades
- Supports independent buy/sell open and close permission controls for flexibility
Weaknesses
- Strategy is overly simplistic; consecutive bullish/bearish candles don't necessarily indicate trend continuation, leading to frequent false signals
- Lacks a trend filter (e.g., MA, ADX), making it prone to frequent open/close cycles in ranging markets
- Stop loss and take profit use fixed points without considering market volatility (ATR), resulting in inconsistent performance across different market conditions
- Does not check for existing positions in the same direction, potentially causing duplicate entries
- No spread filter, which can lead to losses in low-liquidity markets where spreads are wide
Possible improvements
- Add a trend filter (e.g., MA direction or ADX threshold) to avoid frequent trading in ranging markets
- Replace fixed stop loss/take profit with ATR-based dynamic levels to adapt to varying market volatility
- Add position existence checks to prevent duplicate entries in the same direction
Risk assessment
Overall risk: Medium
- No check for existing same-direction positions, potentially causing duplicate entries and overexposure
- Fixed stop loss/take profit may be inappropriate across different volatility environments; stops may be too tight in high volatility
- Consecutive candle pattern signals trigger frequently in ranging markets, potentially leading to consecutive losses
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Trading share ratio |
MMMode | LOT | Lot calculation method (free margin/balance/loss share/fixed lot) |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Max allowed slippage in points |
BuyPosOpen | true | Allow opening long positions |
SellPosOpen | true | Allow opening short positions |
BuyPosClose | true | Allow closing long positions by indicator signal |
SellPosClose | true | Allow closing short positions by indicator signal |
InpInd_Timeframe | PERIOD_H4 | Indicator timeframe |
CandleTrendTotal | 3 | Number of same-direction candles |
SignalBar | 1 | Bar index for entry signal |
Similar Candlestick Pattern EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.