revised_self_adaptive_ea
This EA detects Bullish and Bearish Engulfing candlestick patterns confirmed by RSI overbought/oversold levels, and draws signal arrows on the chart. It initializes ATR and MA indicators for planned dynamic stop-loss, take-profit, and trailing stop functionality, but the OnTick handler is incomplete and does not execute any trades. The code appears to be a work-in-progress with only the signal detection and visualization components implemented.
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 candlestick pattern recognition, primarily utilizing Engulfing Patterns as reversal signals. Entry conditions are: a Bullish Engulfing pattern (previous bearish candle engulfed by current bullish candle) with RSI below 30 generates a buy signal; a Bearish Engulfing pattern (previous bullish candle engulfed by current bearish candle) with RSI above 70 generates a sell signal. For exit conditions, the code declares dynamic stop-loss, dynamic take-profit, and trailing stop variables, but the OnTick function does not implement any exit logic. Position sizing includes a fixed lot parameter (0.05) and a maximum risk percentage parameter (1.0%), but the risk percentage is never actually used to calculate position size. Money management includes a maximum spread filter parameter, but it is not applied in the signal detection logic. The overall strategy logic is incomplete, with a disconnect between signal detection and trade execution, and ATR and MA indicators are initialized but never referenced by any logic.
Strengths
- Combining Engulfing patterns with RSI confirmation provides dual filtering to reduce false signals
- ATR-based dynamic stop-loss and take-profit mechanism is a sound design that adapts to market volatility
- Includes maximum spread filter and risk percentage parameters, showing consideration for trading costs and money management
- Uses a magic number to distinguish EA orders, avoiding conflicts with other strategies
- Signal visualization with arrow markers facilitates backtesting and strategy verification
Weaknesses
- The OnTick function is incomplete with no trade execution logic implemented, making the EA unable to actually trade
- ATR and MA indicators are initialized but never used; dynamicStopLoss and other variables are declared but never assigned values
- MaxRiskPercent and MaxSpread parameters are never called in any logic, rendering them effectively useless
- The engulfing pattern detection logic is flawed: using shift=1 and shift=2 comparisons does not correctly identify a true engulfing pattern
- No new bar detection mechanism exists, causing signal re-evaluation on every tick which may produce duplicate signals
- Missing position check and duplicate order protection, potentially opening multiple positions in the same direction
Possible improvements
- Complete the OnTick function with full trade execution logic including entry, stop-loss/take-profit placement, and trailing stop implementation
- Fix the engulfing pattern detection logic to ensure the current candle body fully engulfs the previous candle body
- Add a new bar detection mechanism to avoid redundant signal checking and arrow drawing on every tick
- Implement dynamic position sizing using MaxRiskPercent and set dynamic stop-loss/take-profit using ATR values
- Add position check and spread filter logic to prevent duplicate orders and trading in high-spread environments
Risk assessment
Overall risk: High risk
- EA trade logic is incomplete, with uninitialized variable usage risk that could introduce severe bugs in future development
- No position check mechanism exists; if trade logic is completed without protection, it could lead to unlimited position opening
- No new bar detection means signal checking triggers on every tick, potentially causing frequent trade entries
- The engulfing pattern detection logic is flawed, potentially generating false signals leading to losing trades
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
InpAverBodyPeriod | 3 | Candle body averaging period |
InpMAPeriod | 2 | Moving average period |
InpPeriodRSI | 6 | RSI indicator period |
InpPrice | PRICE_CLOSE | Applied price type |
InpLot | 0.05 | Fixed trading lot size |
MaxRiskPercent | 1.0 | Maximum risk percentage per trade |
MaxSpread | 20.0 | Maximum allowed spread |
UseTrailingStop | true | Usetrailing stop |
InpMagicNumber | 121300 | EA trading magic number |
Similar Candlestick Pattern EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.