VHF EA
This EA uses the Vertical Horizontal Filter (VHF) indicator to determine whether the market is in a trending or ranging phase, then executes trend-following trades when a trend is detected. It opens positions in the direction of the prevailing trend and uses the VHF reading as a filter to avoid trading in choppy, directionless markets. The EA is designed for medium-to-longer timeframe trend capture.
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
The core strategy of VHF EA is based on the Vertical Horizontal Filter (VHF) indicator, which measures trend strength by comparing the total price range to the net price movement over a given period. When the VHF value rises, it signals that the market is trending, and the EA opens positions in the direction of the prevailing trend. When VHF is low, it indicates a ranging or choppy market, and the EA avoids entering trades or exits existing positions. Entry conditions typically involve the VHF reading exceeding a threshold level combined with a directional price movement confirmation. Exit conditions may include VHF falling below the threshold, fixed stop-loss and take-profit levels, or trend reversal signals. Position sizing generally uses fixed lots or a simple account-balance-based proportion, while money management relies on the VHF filter to reduce false signals during ranging periods, though it lacks explicit risk-percentage calculation or dynamic position sizing modules.
Strengths
- The VHF indicator effectively distinguishes trending from ranging markets, reducing false signals
- The strategy logic is simple and clear, making it easy to understand and optimize parameters
- Trend-following strategies perform well in strong trending markets with favorable risk-reward ratios
- Avoiding frequent trades in choppy markets reduces transaction costs and equity erosion
Weaknesses
- VHF is a lagging indicator, causing delayed trend identification that may miss early trend phases
- Lacks dynamic stop-loss and trailing stop mechanisms to effectively protect accumulated profits
- Fixed lot or simple proportional sizing lacks sophisticated money management
- VHF signals are unstable during trend transitions, potentially causing consecutive losses
Possible improvements
- Add a trailing stop mechanism to lock in trend profits and prevent givebacks
- Combine with additional trend confirmation indicators (e.g., ADX or MA crossover) to improve entry signal reliability
Risk assessment
Overall risk: Medium
- VHF lagging nature may cause entries at trend end stages, increasing loss probability
- Fixed stop-loss may not suit all market volatility conditions and should adapt to ATR
- Lacks maximum drawdown control and consecutive loss protection mechanisms
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
VHF_Period | 28 | VHF indicator calculation period |
VHF_Threshold | 0.4 | VHF trend determination threshold |
LotSize | 0.1 | Lot size per trade |
StopLoss | 500 | Stop loss in points |
TakeProfit | 1000 | Take profit in points |
Timeframe | H1 | Trading timeframe |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.