Exp_CoeffofLine_true
This EA trades based on the CoeffofLine_true custom indicator, which measures the coefficient of a linear regression line to determine market momentum direction. It opens buy positions when the indicator crosses from negative to positive territory and sell positions when it crosses from positive to negative, with configurable stop loss and take profit levels.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
Why this EA never traded: no entry rule survived the conversion.
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
This EA uses the CoeffofLine_true indicator as its core strategy signal, which measures the strength and direction of price trends based on the linear regression coefficient. Entry conditions are: buy when the indicator crosses from negative to positive (Value[1]>0 and Value[0]<0 crossover confirmation), and sell when the indicator crosses from positive to negative (Value[1]<0 and Value[0]>0 crossover confirmation). Exit conditions include fixed stop loss and take profit levels, as well as reverse signal exits (long positions close on sell signals, short positions close on buy signals). Position sizing is controlled through the MM parameter, where negative values represent fixed lot sizes and positive values represent deposit percentage-based sizing. Money management relies on external TradeAlgorithms.mqh library functions including BuyPositionOpen and SellPositionOpen. The EA uses an IsNewBar mechanism to ensure signals are calculated only once per bar, preventing duplicate trades, while the SignalBar parameter allows immediate signal response on the current bar when set to zero.
Strengths
- New bar detection mechanism prevents duplicate trades within the same bar, reducing overtrading risk
- Independent buy/sell permission switches provide high flexibility for directional strategy testing
- Fixed stop loss and take profit cap risk exposure, preventing unlimited losses
- Linear regression coefficient for momentum assessment provides stronger statistical significance than simple MA crossovers
Weaknesses
- Depends on external custom indicator CoeffofLine_true and TradeAlgorithms.mqh library, lacking portability and self-containment
- Default stop loss of 1000 points and take profit of 2000 points are excessively large, creating unreasonable risk-reward for most instruments
- No spread filter means the EA may trigger false signals in high-spread environments leading to losses
- Lacks multi-timeframe confirmation, single indicator signals are prone to false breakouts
- MM parameter design is counterintuitive, negative values for fixed lots can easily cause misuse
Possible improvements
- Add a spread filter to pause opening positions when spread exceeds a threshold, avoiding excessive slippage losses
- Add multi-timeframe confirmation, only opening positions when the higher timeframe trend aligns, improving signal reliability
- Redesign the MM parameter using an enum to distinguish between fixed lot and percentage modes, eliminating negative value confusion
Risk assessment
Overall risk: Medium
- Default 1000-point stop loss is excessively large, potentially causing significant losses in extreme market conditions
- No spread filter or margin check poses risk of opening positions in high-cost environments
- Dependency on external library and indicator means trading failure if they fail to load
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | -0.1 | Trade fraction or fixed lot; negative value = lots |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Max price slippage deviation in points |
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 timeframe |
SMMAPeriod | 5 | Smoothed Moving Average period |
SignalBar | 1 | Bar index for entry signal |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.