exp_trendmagic
This EA implements the Trend Magic strategy, which combines the Commodity Channel Index (CCI) with Average True Range (ATR) to generate a trailing stop line that changes color based on trend direction. It opens buy positions when the Trend Magic line turns bullish and sell positions when it turns bearish, using the indicator line as both entry signal and dynamic stop loss. The strategy aims to capture sustained trends while providing clear exit signals through trend reversal detection.
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 Trend Magic strategy core concept combines the CCI indicator with ATR to construct a dynamic trend judgment and stop-loss line. Specifically, it calculates the ATR value multiplied by a coefficient as an offset, then uses the CCI indicator to determine the current trend direction: when CCI is above the threshold, it's an uptrend and the Trend Magic line takes the previous low minus the ATR offset; when CCI is below the threshold, it's a downtrend and the line takes the previous high plus the ATR offset. Entry conditions are triggered when the Trend Magic line color flips: a flip from downtrend to uptrend line signals a buy, and vice versa for a sell. Exit conditions also rely on the Trend Magic line flip signal, meaning positions are closed when the holding direction conflicts with the new trend direction, and the line also serves as a dynamic stop-loss level. Position sizing allows the user to set a fixed lot size for trading, but there is no dynamic position adjustment or equity-proportional ordering logic. Money management is lacking, with no hard stop-loss setting, maximum position limits, or drawdown control mechanisms, relying entirely on the indicator signal flip for exits, which poses significant risk during extreme market conditions.
Strengths
- Clear trend-following logic combining CCI and ATR for effective trend identification and dynamic stop-loss placement
- Color-flip mechanism provides intuitive and unambiguous entry/exit signals, reducing subjective judgment interference
- ATR-adaptive stop-loss distance automatically adjusts to market volatility, adapting to different market conditions
Weaknesses
- Lacks hard stop-loss protection, relying entirely on indicator flip for exits, which may cause large losses during gaps or extreme market moves
- Fixed lot sizing lacks money management logic, with no dynamic position adjustment based on account equity or risk ratio
- No new bar check mechanism, potentially leading to repeated entries on the same bar or over-trading from frequent signals
Possible improvements
- Add hard stop-loss and take-profit settings, plus a trailing stop feature to lock in profits before trend reversal
- Add a money management module supporting dynamic position sizing based on risk ratio and maximum drawdown limits
- Add new bar check, spread filter, and position check to improve trading stability and safety
Risk assessment
Overall risk: Medium
- No hard stop-loss, potentially suffering significant losses during extreme market conditions
- No new bar check, potentially opening repeated positions on the same bar
- Fixed lot size without money management may cause small accounts to take excessive risk
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
CCI_Period | 50 | CCI indicator calculation period |
ATR_Period | 5 | ATR indicator calculation period |
ATR_Multiplier | 1.0 | ATR offset multiplier, controls stop loss distance |
LotSize | 0.1 | Fixed trading lot size |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.