If the reseed's partial close failed AFTER the older leg was already closed, the
hedge was released to loss management at full (un-reduced) size. Now the partial
close runs FIRST; on failure the chain is left fully intact and the caller
releases both legs cleanly via ReleaseChainToLossMgmt - never a half-dismantled
chain.
After COVERED closes the older leg, the hedge's break-even lock only floored the
SL at the hedge's OWN entry, so it could trail back down and the pair ended net
negative even though coverage hit HedgeRecoveryPct momentarily. The graduated
hedge now carries a hedgeLockProfit = coverNeeded (HedgeRecoveryPct% of the
older leg's locked loss); ManageTrailingTPSL floors the SL at that profit level
(independent of the trailing gate) so the pair can never net below the recovery
target, while HedgeTrailATR still rides the SL above it.
Drop the 'License' word from the BSD-3-Clause tag in the #property description block. The combined description exceeded MQL5's 512-char total cap, causing a compiler warning and truncation of the last description line in the compiled .ex5. Keeps the correct BSD-3-Clause SPDX name.
A graduated/released hedge carries a large martingale lot. The dollar-based
TrailingDistanceValue converts to a near-zero PRICE gap on that lot, so the
trailing stop landed at market and closed the position instantly (or via the
emergency-close on a rejected too-tight modify) - cutting profit that could
have run. Graduated and released chain legs now trail at HedgeTrailATR x ATR
(default 1.0, lot-independent); set 0 to use the normal trailing settings.
Added HedgeTrailATR to all profiles.
A wick/spike that crosses HedgeTriggerATR intrabar no longer opens a doubled
hedge: the chain only starts when the reverse-direction signal score >=
HedgeMinSignalScore (HedgeRequireSignal, default on). If it was a spike the
position recovers; if the reversal is real the score builds and the hedge
fires on a later tick. Added the two inputs to all profiles (score matched to
each profile's entry threshold) and documented the gate.
- Active hedge-chain legs are excluded from CheckBasketStop, so a chain's
intentional transient drawdown no longer trips the portfolio basket stop;
released legs are covered by it again.
- At max cycles / lot ceiling the chain is RELEASED to adaptive loss
management (flagged noRehedge) instead of being force-closed.
- Hard chain loss cap (HedgeMaxChainLossPct) now defaults to 0 (off); the
chain is bounded by cycles + max lot, then released.
Rolling reverse-hedge that recovers losing positions: auto-recovery lot
sizing (computed to cover the loss within an ATR move), cycle reseeding
(partial-close the deepest hedge instead of unbounded lot growth), and an
equity-% / fixed-$ chain loss stop. Opt-in via EnableHedgeChain. Chain legs
are excluded from normal trailing/loss-management while active.
Track consecutive winning trades closed while a losing position is open,
then tighten SL to reduce max loss by accumulated realized gains.
- Add inputs: EnableProfitOffsetSL, ConsecutiveWinsRequired, MinOffsetProfit
- Extend ManagedPosition with per-position profit offset tracking fields
- Update SyncManagedPositions to accumulate/reset wins per open position
- Add Step 5 in ManageLosingPositions for profit-offset SL calculation
- Move SL to break-even when accumulated profit exceeds original risk
- Add ConsecutiveCandleThresholdBoost and MaxConsecutiveCandleBoosts input parameters
- Track consecutive trading candles per direction (buy/sell independently)
- Raise minimum signal threshold progressively for each consecutive candle that opened positions
- Resets when a candle passes without opening any position in that direction
- Fix self-assignment bug: currentBarTime = currentBarTime -> currentBarTime = currBarTime
- Move SIGNAL DAMPENING comment to correct position after candle escalation block
- Remove signal strength-based lot increase
- Remove velocity boost from lot sizing
- Remove VelocitySizeWeight input parameter
- Gate equity-drop lot increase behind MinSignalStrengthForLot
- Add Signal Dampening Settings input group (6 new parameters)
- Add GetOpenPositionLossState() helper to scan open position P&L
- Hard-block new entries when N same-direction positions are losing
- Apply score penalty per losing same-direction position
- Raise signal threshold during equity drawdown
- Track consecutive losses and activate cooldown after 3+ losses
- Core GetSignalStrength() indicator logic remains untouched
- Add scaled partial close (3-level signal decay: 75%/50%/25%)
- Add dynamic SL tightening proportional to health score
- Add break-even lock when profit exceeds spread cost
- Add virtual SL re-entry at better price after health exit
- Optimize defaults for M1 XAUUSD (MinHealthScore=0.40, MaxAdverseATR=1.5, GraceBars=2)
- Add PartialClosePosition and TryVirtualSLReentry helper functions
- Extend ManagedPosition struct with partialCloseLevel and breakEvenLocked
- Bump version to v36.0