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
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: 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
Parameters
| Parameter | Default | Description |
|---|---|---|
trade | true | Allow trading |
InpSymbol_1 | EURUSD | First trading symbol |
InpSymbol_2 | USDCHF | Second trading symbol |
InpSymbol_3 | GBPUSD | Third trading symbol |
InpSymbol_4 | AUDUSD | Fourth trading symbol |
show_profit | true | Display profit/loss information |
enable_profit | false | Enable take profitexit |
enable_loss | false | Enable stop lossexit |
emergency_loss | 60 | Emergency loss threshold in points |
InpProfit | 80 | Take profit target in points |
InpLoss | 40 | Stop loss threshold in points |
MagicNumber1 | 243 | EURUSD magic number |
MagicNumber2 | 244 | USDCHF magic number |
MagicNumber3 | 245 | GBPUSD magic number |
MagicNumber4 | 256 | AUDUSD magic number |
E_MagicNumber | 257 | Emergency add-on position magic number |
InpLot | 0.01 | Trading lot size |
Similar Hedging EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.