Patch note — auto-clearing one-shot reset flags
What changed
The three "one-shot" knobs you use to recover a stuck pair now actually behave like one-shots. You flip them on, restart, and the strategy clears the flag itself after the reset fires. No more manually flipping them back to false and restarting again.
Which flags
RESET_BREAKER_ONCE(clears the consecutive-losses breaker)RESET_STATS_ONCE(zeros wins / losses / trade count / daily PnL)- The V2 PnL math reset (the one that wipes the contaminated
Total PnLbaseline) now piggybacks onRESET_STATS_ONCE, so the same flag fires both
How it works under the hood
When the reset fires, the strategy writes false back into two places:
- The in-memory
wssnapshot (so nothing else in this cycle re-fires). - The persistent
pairLedger.whatstratconfig (so the GUI shows the flag cleared and the next cycle starts clean).
Why this matters for the current stuck pairs
Until this patch, leaving RESET_STATS_ONCE: true set across restarts caused the stats to be wiped every single cycle. That is exactly why the InvBalancer trade counter on NEAR stayed pinned at 0 even after the fix landed. With auto-clear, the wipe runs exactly once and the new counters start accumulating immediately after.
Strategies covered
glostenMilgrom, hawkesMM, inventoryBalancer, cartaJaiMicroMM, harrisScalpMM, rollModelMM, microPriceMM, queueReactiveMM, ofiFlashMM, parabolicSarMM, kalmanGrid.
Operator workflow now
- Set the flag to
truefor the pairs you want reset. - Restart Gunbot.
- Watch the next cycle log for the reset warning.
- That's it. The flag is already cleared, no follow-up edit needed.
Bonus correctness fix
In GM and Hawkes there was a subtle ordering issue: the stats-reset block runs near the top of the script and the V2 PnL reset runs further down. With auto-clear in place, the first block would have wiped the flag before the second block could see it. A small "hand-off" marker (_qResetStatsJustFired) bridges the two so both fire on the same cycle, then the marker is consumed.