Exp_LSMA_Angle
This EA trades based on the LSMA (Least Squares Moving Average) Angle indicator, opening buy positions when the angle crosses upward above threshold and sell positions when it crosses downward. It uses a custom indicator handle to read angle values (0-4 scale) and generates signals on new bar formation, with configurable money management and separate open/close controls for long and short positions.
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 concept of this strategy is based on the slope angle of the Least Squares Moving Average (LSMA) to determine trend direction and strength. Entry conditions: a buy position is opened when the indicator value crosses up to 4 (uptrend confirmed), and a sell position is opened when the indicator value crosses down to 0 (downtrend confirmed). Exit conditions: long positions are closed when the indicator value drops below 2, and short positions are closed when the indicator value rises above 1. Position sizing relies on the TradeAlgorithms.mqh library's BuyPositionOpen/SellPositionOpen functions, supporting multiple money management modes including free margin, balance, loss-adjusted balance/margin, and fixed lot. Money management is controlled by the MM parameter for risk ratio and MMMode for calculation mode, with a 1000-point stop loss, 2000-point take profit, yielding a 1:2 risk-reward ratio.
Strengths
- Uses LSMA angle for trend detection, reducing lag compared to simple MA crossovers
- Independent buy/sell open/close switches provide flexible market adaptation
- Supports multiple money management modes catering to different risk preferences
Weaknesses
- Depends on external custom indicator LSMA_Angle; EA fails if indicator is missing
- 1000-point stop loss is very wide, potentially causing large losses on volatile instruments
- Lacks spread filter and trading session filter, may open positions under unfavorable conditions
Possible improvements
- Add spread filter and trading session filter to avoid trading during high spread and low liquidity periods
- Replace fixed stop loss/take profit with ATR-based dynamic calculation for better market adaptation
Risk assessment
Overall risk: Medium
- Fixed 1000-point stop loss does not adapt to instrument volatility, potentially too wide or too narrow
- No spread filter mechanism, may execute at high slippage during low liquidity
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Money management parameter controlling position size |
MMMode | LOT | Lot calculation mode (fixed lot or margin ratio) |
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_H1 | Indicator calculation timeframe |
LSMAPeriod | 25 | LSMA calculation period |
AngleTreshold | 15 | Angle threshold |
StartLSMAShift | 4 | LSMA starting bar shift |
EndLSMAShift | 0 | LSMA end shift bar count |
SignalBar | 1 | Bar index for signal detection |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.