EA-1232 · Trend Following

Exp_LinearRegSlopeV2

This EA trades based on the slope of a linear regression line, using the ColorLinearRegSlope_V2 custom indicator. It opens buy positions when the regression slope turns positive and sell positions when it turns negative, with configurable smoothing methods and price types. Entry signals are confirmed on new bars by comparing current and previous indicator buffer values for crossover detection.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Blow-up riskLow
Rating★★★☆☆
TypeTrading EA
TimeframesH1, H4, D1
IndicatorsLinear Regression Slope, Custom SmoothAlgorithms (SMA/EMA/SMMA/LWMA/JJMA/JurX/ParMA/T3/VIDYA/AMA)
AuthorCopyright © 2011, Nikolay Kositsin

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD0.00%0.00%0.00%0—————Custom indicator approximated
GBPUSD0.00%0.00%0.00%0—————Custom indicator approximated
USDJPY0.00%0.00%0.00%0—————Custom indicator approximated
XAUUSD0.00%0.00%0.00%0—————Custom indicator approximated

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 core concept of this strategy is using the slope of a linear regression line to determine market trend direction — a positive slope indicates an uptrend while a negative slope indicates a downtrend. Entry conditions are triggered when the upper buffer crosses above the lower buffer (buy signal) or when the lower buffer crosses above the upper buffer (sell signal), with the previous bar already being in the corresponding trend state as confirmation. Exit conditions rely on fixed Stop Loss and Take Profit settings in points, and positions are also closed when a reverse signal appears (e.g., a long position is closed when a sell signal emerges). Position sizing is controlled via the MM parameter, where negative values represent fixed lot sizes and positive values represent deposit-proportional sizing. Money management leverages standard functions from the TradeAlgorithms library for order execution, including maximum price deviation control to limit slippage. The strategy also implements a signal conflict resolution mechanism that cancels all trading signals when buy and sell signals appear simultaneously, preventing contradictory dual-direction entries.

Strengths

  • Uses linear regression slope for trend determination, which has a stronger statistical foundation than simple moving average crossovers
  • Supports 10 smoothing methods and 9 price types, offering high parameter flexibility to adapt to different market conditions
  • Implements signal conflict resolution that cancels all signals when contradictory buy/sell signals appear simultaneously

Weaknesses

  • Fixed Stop Loss and Take Profit in points ignore market volatility (ATR), leading to inconsistent performance across varying volatility regimes
  • Lacks spread filter and trading session filter, potentially executing trades during high-spread or unfavorable trading hours
  • Depends on external indicator file ColorLinearRegSlope_V2 and two include libraries, increasing deployment complexity with no error recovery

Possible improvements

  • Replace fixed SL/TP with ATR-based dynamic stops to adapt to varying volatility environments
  • Add spread filter and trading session controls to prevent entries during unfavorable trading conditions

Risk assessment

Overall risk: Medium

  • No spread filter may cause unfavorable fills and additional slippage losses during high-spread periods
  • When MM is negative, fixed lot sizing lacks dynamic adjustment based on account balance changes
  • Depends on custom indicator and external libraries; handle creation failure only prints a warning but EA continues running without signals

Evaluation scores

Code quality3.0
Strategy logic3.0
Risk management2.0
Robustness2.0
Innovation3.0
Documentation2.0
Overall2.5

Parameters

ParameterDefaultDescription
MM-0.1Deposit fraction or lot size; negative=fixed lot
StopLoss_1000Stop loss in points
TakeProfit_2000Take profit in points
Deviation_10Max price slippage deviation (points)
BuyPosOpentrueAllow buy position opening
SellPosOpentrueAllow opening sell positions
BuyPosClosetrueAllow closing buy positions
SellPosClosetrueAllow closing sell positions
InpInd_TimeframePERIOD_H4Vortex indicator timeframe
SlMethodMODE_SMASmoothing method
SlLength12Smoothing depth
SlPhase15Smoothing parameter (JJMA range -100 to +100)
IPCPRICE_CLOSEPrice constant type
TriggerShift1Trigger bar shift
SignalBar1Bar index for entry signal

Similar Trend Following EAs

Backtests are historical simulations and do not guarantee future results. Not financial advice.

Get the weekly Arena report

One email a week: ranking changes, new signals and new research. No spam; unsubscribe any time.