EA-18229 · Hedging

HTH Trader

A multi-symbol hedging EA that trades four currency pairs simultaneously based on daily deviation from previous day's close. It opens correlated hedge positions at the start of each trading day and closes all positions at 23:00 or when profit/loss thresholds are hit, with an emergency doubling mechanism for losing portfolios.

Open the interactive view (equity curve, symbol switch)

Key facts

CategoryHedging
RiskHigh risk
Blow-up riskElevated
Rating★★☆☆☆
TypeTrading EA
TimeframesD1, M1
IndicatorsClose Price Deviation
AuthorMetaQuotes Software Corp.

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD0.00%0.00%0.00%0—————Not convertible yet
GBPUSD0.00%0.00%0.00%0—————Not convertible yet
USDJPY0.00%0.00%0.00%0—————Not convertible yet
XAUUSD0.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: Elevated

  • Has no stop loss or trailing stop
  • Can hold up to 4 positions at once

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 strategy concept is based on multi-symbol correlation hedging, calculating the percentage deviation of four currency pairs (EURUSD, USDCHF, GBPUSD, AUDUSD) from the previous day's close to determine market direction. Entry conditions: within the 0:00-1:00 time window (minutes 5-12), four hedged positions are simultaneously opened based on the previous day's deviation direction (d_c11>0 for positive deviation, d_c11<0 for negative deviation). For positive deviation, it buys EURUSD and USDCHF, sells GBPUSD, and buys AUDUSD; for negative deviation, all directions are reversed. Exit conditions are threefold: forced close at 23:00, profit target at InpProfit (80 pips), or loss limit at InpLoss (40 pips). Position sizing uses a fixed lot size of InpLot (0.01), but in emergency situations (total loss reaching emergency_loss=60 pips), profitable positions are doubled with a different magic number (E_MagicNumber). Money management is weak as there are no stop-loss or take-profit price levels set (all 0.0), relying entirely on programmatic closing logic.

Strengths

  • Multi-symbol hedging strategy reduces directional risk on a single instrument, utilizing currency pair correlations for diversified trading
  • Has a clearly defined trading time window (between 0:00-1:00, minutes 5-12), avoiding low-liquidity periods
  • Built-in emergency doubling and profit/loss threshold closing mechanisms provide layered risk control

Weaknesses

  • All orders have no stop-loss or take-profit price levels set (all 0.0), meaning positions are infinitely exposed to risk if the program stops unexpectedly
  • The emergency doubling mechanism (DoublePositions) is effectively a variant Martingale strategy, doubling profitable positions during losses which can amplify overall risk
  • Critical BUG in DoublePositions: the symbol filter condition (symbol!=A || symbol!=B) is always true due to logical OR, making it impossible to correctly filter non-target symbols
  • Redundant code in IsTradeAllowed: TERMINAL_TRADE_ALLOWED is checked twice identically (line 460 and 465)
  • Only opens positions within a narrow daily time window (minutes 5-12 of hour 0), with no retry mechanism if the window is missed

Possible improvements

  • Fix the critical logical BUG in DoublePositions: change (symbol!=A || symbol!=B) to (symbol!=A && symbol!=B), otherwise the function incorrectly processes non-target symbol positions
  • Set actual stop-loss and take-profit price levels for each order instead of relying solely on programmatic closing, preventing uncontrolled positions when the EA exits unexpectedly
  • Add a maximum number of emergency doubling iterations to prevent unlimited position expansion during consecutive losses
  • Add spread filter and slippage control to avoid opening positions during high-spread periods

Risk assessment

Overall risk: High risk

  • Logical operator BUG in DoublePositions may execute emergency doubling on non-target symbols, causing unintended trades
  • All positions have no stop-loss or take-profit, leaving them completely unprotected if the program crashes or disconnects
  • The emergency doubling mechanism increases position size during losses, fundamentally increasing risk exposure rather than reducing it

Evaluation scores

Code quality2.0
Strategy logic2.0
Risk management2.0
Robustness1.0
Innovation3.0
Documentation1.0
Overall1.8

Parameters

ParameterDefaultDescription
tradetrueAllow trading
InpSymbol_1EURUSDFirst trading symbol
InpSymbol_2USDCHFSecond trading symbol
InpSymbol_3GBPUSDThird trading symbol
InpSymbol_4AUDUSDFourth trading symbol
show_profittrueDisplay profit/loss information
enable_profitfalseEnable take profitexit
enable_lossfalseEnable stop lossexit
emergency_loss60Emergency loss threshold in points
InpProfit80Take profit target in points
InpLoss40Stop loss threshold in points
MagicNumber1243EURUSD magic number
MagicNumber2244USDCHF magic number
MagicNumber3245GBPUSD magic number
MagicNumber4256AUDUSD magic number
E_MagicNumber257Emergency add-on position magic number
InpLot0.01Trading lot size

Similar Hedging 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.