Exp_ColorHMA
This EA trades based on the ColorHMA (Hull Moving Average) indicator, opening buy positions when the HMA slope turns upward and sell positions when it turns downward. It uses the color changes of the HMA to detect trend reversals and manages positions with configurable stop loss, take profit, and multiple money management modes. Trades are only executed on new bars to avoid redundant signals.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
Not backtested yet — this EA could not be converted automatically.
Strategy analysis
The core strategy of this EA is a trend-following approach based on the Hull Moving Average (HMA). Entry conditions: a buy signal is generated when HMA values rise from the previous bar to the current bar (Value[0]>Value[1]) and the previous bar's value is below the bar before it (Value[1]<Value[2]); a sell signal is generated when HMA values decline from the previous bar to the current bar (Value[0]<Value[1]) and the previous bar's value is above the bar before it (Value[1]>Value[2]). Exit conditions rely on fixed stop loss and take profit settings in points, and also support reverse-signal closing — long positions are closed when a sell signal appears, and short positions are closed when a buy signal appears. Position sizing supports five modes: percentage of free margin, percentage of balance, percentage of free margin minus floating loss, percentage of balance minus floating loss, and fixed lot size. Money management is controlled via the MM parameter and MMMode enumeration. The EA also uses an IsNewBar mechanism to ensure signals are calculated only once per bar, preventing duplicate entries on the same bar. The SignalBar parameter allows users to select which bar's values to use for signal calculation, defaulting to 1 (the most recently completed bar).
Strengths
- Uses Hull Moving Average which has less lag and more smoothness than standard MA, capturing trend changes faster
- Comprehensive money management system with five position sizing modes, flexibly adapting to different trading needs
- New bar detection mechanism prevents redundant signal calculation and duplicate entries on the same bar
- Buy and sell directions can be independently toggled, allowing single-direction trading or close-only mode
- Complete stop loss and take profit parameters with reverse-signal closing for dual exit protection
Weaknesses
- No position check logic — may open duplicate positions in the same direction, leading to position stacking risk
- No spread filter — entering during high spread conditions may cause slippage losses, especially when switching timeframes
- HMA period is fixed at 13 with no adaptivity, potentially generating many false signals in highly variable volatility markets
- Default stop loss of 1000 points and take profit of 2000 points are large and may not suit all instruments and volatility environments
- No trailing stop mechanism to lock in floating profits during trending moves
Possible improvements
- Add position check logic before opening trades to confirm no existing same-direction positions, preventing position stacking
- Add spread filter and volatility adaptation mechanism to pause trading during high spread or low volatility conditions
- Add trailing stop functionality to dynamically lock in profits during trending markets
Risk assessment
Overall risk: Medium
- No position check may cause duplicate same-direction entries leading to position stacking risk
- Fixed stop loss and take profit may not adapt to all market conditions; stops may be insufficient in extreme moves
- No spread filter may cause additional losses when entering during high-spread periods
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Money management ratio or lot size |
MMMode | LOT | Lot calculation mode (Free Margin/Balance/Margin Loss/Balance Loss/Fixed Lot) |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Maximum slippage in points |
BuyPosOpen | true | Allow opening buy positions |
SellPosOpen | true | Allow opening sell positions |
BuyPosClose | true | Allow closing buy positions |
SellPosClose | true | Allow closing sell positions |
InpInd_Timeframe | PERIOD_H8 | DecEMA indicator timeframe |
HMA_Period | 13 | Hull Moving Average period |
SignalBar | 1 | Bar index for signal calculation |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.