RE: šŸš€ Introducing the DLMMQB DCA Bot - Hive/HBD Dollar-Cost-Averaging Strategy on the internal market! šŸ‚ 🧸

avatar
(Edited)

You are viewing a single comment's thread:

It can switch regimes instantly once the new signal is detected, so pretty much on the very next round after the signal. The signals are stable so no whipsaws, or way less since the ai is looking at the larger daily trend. Usually trends continue so most of the time there will be ample time to make money after a switch. For instance right now it's been bearish for a while and will continue to be bearish until the price can prove otherwise. Eventually we'll break out and flip though and that will be a good thing. On average I haven't been seeing signal changes that often, the shorter trends last about 1-2 weeks, so not so much whipsaw action. The other good part is both the bull strategy and bear strategy can work in either trend. On a major downtrend the bullish mode can be buying massive dips, and taking advantage of dead cat bounces along the way, and vice versa.



0
0
0.000
3 comments
avatar

That helps a lot. When Auto flips, do you cancel any open ladder orders and reseed for the new mode, or let the old ones finish while placing a new set? Is there any cooldown or hysteresis so a couple of borderline days don’t cause back-to-back flips? Also curious how you handle slippage and dust on a breakout at the switch, and if the Mongo logs record regime timestamps so we can line up ROI around pivots.

0
0
0.000
avatar
(Edited)

Good questions.

When auto-mode flips (BULL ↔ BEAR)

Do we cancel old ladder orders?
The bot almost never leaves resting ā€œladderā€ orders behind in the first place. It uses FOK (fill-or-kill) whenever book depth allows. When it must place a non-FOK order (e.g., thin book), it does a short post-check and cancels if it’s still open. so there’s nothing lingering to clean up when a flip happens.

What actually happens on a flip?
The bot marks a pending flip-init and on the next cycle executes exactly one ā€œinitialā€ trade for the new mode (buy for bull / sell for bear), then sets fresh targets for that mode and stops for that loop. It does not try to force-close the opposite side instantly; it just seeds the new regime and lets targets/logic manage position from there.

Cooldown / hysteresis (avoiding whipsaw)

Duplicate-flip de-dupe: The bot ignores repeat flip flags for a short window so you don’t run the flip-init twice in quick succession.

Reseed cooldown: After a flip-init (or a reseed), it sets a cooldown ≄ the loop interval so it won’t immediately try to reseed again.

What it doesn’t do: There’s no long, explicit ā€œmust-stay-in-this-mode for N hours/daysā€ hysteresis. If your AI source flips back and forth day-to-day, the bot will still follow it—just without double-triggering within the same short window. (If you want stronger hysteresis, we can add a min-hold timer or a banded price filter and I'm thinking about this as we speak)

Slippage & dust at the moment of the switch

Slippage: Your slippage (e.g., 0.2%) is applied as safety on the min-receive / max-pay calculations so the flip-init trade won’t fail on a breakout.

Depth-aware chunking: The bot sizes to visible book depth: if there’s enough depth it goes FOK (instant or no trade); otherwise it uses a smaller/non-FOK attempt and auto-cancels if still open after a brief delay. That’s how it avoids getting stranded when price is jumping.

Dust guard: It treats anything below ~10% of the base lot as dust when evaluating whether it’s worth seeding/adding, so you don’t write useless micro-fills at the pivot.

Can we line up ROI with regime changes?

Yes. Every order saved to OrderHistory includes:

a mode field (bull/bear) and

a createdAt timestamp.
We can also get timestamps in the control/state collections (e.g., pending flip time, state updatedAt). And your BalanceSnapshots (used by the ROI endpoint) are timestamped.
Put together, we can:

find the flip moment (first order whose mode differs from prior),

or read the flip-init timestamp from control flags,

then compare ROI windows (before vs after) using the snapshot/ROI API.

Your question got me thinking more about anti-whipsaw behavior, if we want to safeguard it more we can add:

a minimum-hold timer (e.g., must stay in the new mode ≄ X hours),

or a 3-step confirm (AI must repeat the same regime thrice (3 times) within Y minutes or hours),

or a price-band hysteresis (require price to exceed a wider band to flip back). Let me know what you think about these last three potentially added safeguards, i'm thinking they could be added pretty easily. Funny thing is I was just thinking about this same thing earlier so an update will probably be in the works on this ASAP.

0
0
0.000
avatar

Flip-init with a short de-dupe and depth-aware FOK/cancel sounds tight. I’d vote for price-band hysteresis driven by ATR or a simple percent, plus a small min-hold like 1 to 2 hours, and make multi-confirm optional on a higher timeframe to dodge noise. Could you make those per-mode and per-market settings, and add a reason field in logs when a flip is skipped or accepted, like min-hold left, band not cleared, or confirm count? Are dust threshold and base lot user-set, and could the ROI API return pre/post aggregates by detected flip window so we can pull before vs after in one call?

0
0
0.000