Exp_KalmanFilter
This EA trades based on signals from the KalmanFilter custom indicator, which uses a Kalman filter algorithm to estimate price trends. It opens buy positions when the indicator signals an upward trend and sell positions on downward trends, with configurable entry/exit switches and fixed stop-loss/take-profit levels. The strategy supports two signal modes: trend-based and Kalman-based, operating on a user-defined timeframe.
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 is based on the Kalman Filter indicator, which uses a recursive optimal estimation algorithm to extract trend signals from noisy price data. Entry conditions: when indicator buffer 1 equals 1 (uptrend) and the previous value was 0, a buy signal is triggered; when the value equals 0 (downtrend) and the previous value was 1, a sell signal is triggered. Exit conditions rely on independent buy/sell close switches that trigger position closure upon trend reversal. Position sizing is controlled by the MM parameter and MMMode enumeration, supporting five modes: free margin-based, balance-based, loss-free margin, loss-balance, and fixed lot size. For money management, the EA uses fixed stop-loss (default 1000 points) and take-profit (default 2000 points), yielding a 2:1 reward-to-risk ratio with positive expectancy. The strategy also implements a new bar detection mechanism (IsNewBar) to prevent repeated trading on the same bar, and allows users to select the signal bar offset via the SignalBar parameter for backtesting flexibility.
Strengths
- Kalman filter algorithm provides superior noise filtering and trend tracking compared to simple moving averages
- Five position sizing modes and independent buy/sell switches offer flexible risk control for traders
- 2:1 take-profit to stop-loss ratio provides positive expectancy, combined with new bar detection to avoid overtrading
- Clear signal logic based on state transitions (0→1 or 1→0) reduces false signals in choppy markets
Weaknesses
- Depends on external custom indicator KalmanFilter; EA fails to run if the indicator file is missing
- Fixed point-based stop-loss and take-profit do not adapt to market volatility changes, risking premature stops in volatile periods and distant targets in quiet periods
- No spread filter or trading session filter, potentially leading to unfavorable fills during high-spread periods
- No trailing stop mechanism to lock in floating profits during trending moves
- No explicit check for existing positions or duplicate same-direction orders, posing risk of repeated entries
Possible improvements
- Add ATR-based dynamic stop-loss and take-profit to make risk management adaptive to market volatility
- Implement spread filter and trading session restrictions to avoid opening positions under unfavorable conditions
- Add trailing stop functionality to progressively lock in profits during trending markets
Risk assessment
Overall risk: Medium
- Dependency on external indicator file causes initialization failure but no financial loss
- Fixed 1000-point stop-loss may be insufficient during extreme market moves, with no slippage protection cap
- No duplicate same-direction position check may lead to multiple entries when signal persists across bars
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Deposit fraction or fixed lot; negative for fixed lot |
MMMode | LOT | Lot sizing mode: free margin/balance/post-loss balance/post-loss free margin/fixed lot |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Maximum allowed slippage |
BuyPosOpen | true | Allow opening long positions |
SellPosOpen | true | Allow opening short positions |
BuyPosClose | true | Allow closing long positions |
SellPosClose | true | Allow closing short positions |
InpInd_Timeframe | PERIOD_H3 | Timeframe for indicator calculation |
Kf | 1.0 | Kalman filter adjustment coefficient |
IPC | PRICE_WEIGHTED | Price type applied to indicator |
Signalf | Kalman | Signal mode: trend or Kalman mode |
SignalBar | 1 | Bar index for signal retrieval |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.