Exp_LinearRegSlope_V1
This EA trades based on the Linear Regression Slope indicator, opening buy positions when the slope crosses above the signal line and sell positions when it crosses below. It uses customizable smoothing methods and price types, with configurable stop-loss, take-profit, and money management parameters. The strategy is a systematic trend-following system that enters in the direction of the linear regression slope crossover.
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
Strategy concept: This EA uses the Linear Regression Slope indicator to determine market trend direction, with positive slope indicating an uptrend and negative slope indicating a downtrend. Entry conditions: A buy signal is triggered when the upper line (UpValue) was above the lower line (DnValue) on the previous bar and a crossover occurs on the current bar (UpValue[0]<=DnValue[0]); a sell signal is triggered when the lower line was above and a reverse crossover occurs. Exit conditions: A buy signal simultaneously closes sell positions, and a sell signal simultaneously closes buy positions; additionally, there are independent stop-loss and take-profit mechanisms. Position sizing: The MoneyManagement (MM) parameter controls lot size, with negative values indicating risk percentage mode, supporting both fixed lots and proportional sizing. Money management: Implemented via the MM parameter, default -0.1 means using risk percentage to calculate position size, with default stop-loss and take-profit of 1000 and 2000 points respectively. Signals are calculated on each new bar using the SignalBar parameter for signal delay, and a Recount mechanism ensures data reliability when CopyBuffer fails.
Strengths
- Uses linear regression slope indicator with a statistical foundation, more scientific than simple moving averages
- Supports 10 smoothing algorithms and 11 price types, offering high flexibility
- Has conflicting signal handling mechanism (cancels all signals when buy and sell signals appear simultaneously)
- Built-in new bar detection mechanism prevents repeated trading on the same bar
- Supports independent buy/sell open and close switches for flexible control
Weaknesses
- Default stop-loss of 1000 points and take-profit of 2000 points are excessively large, posing high risk on non-H4 timeframes
- No spread filter, which may generate false signals during high-spread conditions
- Lacks existing position check, potentially opening duplicate positions
- Depends on external custom indicator LinearRegSlope_V1, increasing deployment complexity
- No maximum position or maximum drawdown limit mechanism
Possible improvements
- Add a spread filter mechanism to avoid entering during excessively wide spreads
- Add position existence check logic to prevent duplicate openings in the same direction
- Add maximum drawdown protection and maximum position count limits
Risk assessment
Overall risk: Medium
- Large default stop-loss/take-profit values may cause significant losses on smaller timeframes
- No spread filter means slippage during high-volatility periods may exceed expectations
- Lack of position check may lead to duplicate openings increasing risk exposure
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | -0.1 | Money management ratio or 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_H4 | Indicator calculation timeframe |
SlMethod | MODE_SMA | Smoothing algorithm type |
SlLength | 12 | Smoothing period length |
SlPhase | 15 | Smoothing phase parameter |
IPC | PRICE_CLOSE | Applied price type |
TriggerShift | 1 | Trigger shift offset |
SignalBar | 1 | Signal bar index |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.