Skip to content

Proposal: demand-driven dynamic max_open_trades (e.g. 6 → 8 → 10) so long-running grind positions don't starve new entries #1037

Description

@SN105400

Motivation

X7's quick winners close in hours, but grind-mode trades can occupy a slot for days or weeks. With a static max_open_trades, a handful of concurrent grinds progressively blocks the strategy from taking its bread-and-butter quick entries — precisely the trades that fund recovery while the grinds work themselves out.

What we run (wrapper-level; the strategy file itself is untouched)

A thin subclass adjusts self.config["max_open_trades"] in-memory in bot_loop_start, demand-driven with three tiers:

SLOT_FLOOR, SLOT_MID, SLOT_CEIL = 6, 8, 10

def _adjust_dynamic_slots(self):
    open_count = Trade.get_open_trade_count()
    if open_count >= SLOT_MID:
        target = SLOT_CEIL
    elif open_count >= SLOT_FLOOR:
        target = SLOT_MID
    else:
        target = SLOT_FLOOR
    if self.config["max_open_trades"] != target:
        self.config["max_open_trades"] = target

Properties: expands only when the current tier is fully occupied; contracts back as trades close; never sets the cap below the current open count (no trade is orphaned); hard ceiling bounds total exposure; freqtrade core reads the dict live so no restart is needed; the on-disk config is never modified.

Live evidence (four weeks, spot + futures 3×, v17.4.185)

30 of our 138 trades (~22%) existed only because of expansion slots (concurrent open count was ≥6 at their entry):

  • Spot: 21 expansion-slot trades, 19 closed, +$18.10, no losses.
  • Futures: 7 organic expansion-slot closes, +$65.87 (two further expansion-slot trades were closed by an external force-exit on our side — excluded as not strategy-attributable).

So on our (small) sample the marginal trades the mechanism enables are profitable and behave like normal X7 quick entries.

Known trade-offs (why we'd value the author's view)

  1. Correlated-stress timing: slots fill up exactly when the market is moving — expansion adds exposure at correlated-risk moments. An upstream version might gate expansion on market state (e.g. skip expansion when the BTC downtrend protections are active), which the strategy can do far more cleanly than an external wrapper.
  2. Stake-sizing interaction: with stake_amount: "unlimited", raising the cap shrinks per-trade stake for new entries; the tier sizes effectively re-tranche capital.
  3. The right tier sizes likely depend on account size and mode (spot vs futures); ours (6/8/10) were chosen for a small account and are not tuned claims.

If this is of interest we're glad to share the full wrapper and the per-trade evidence. And if the idea conflicts with the intended slot economics of grind mode, that reasoning would be valuable to us too. Thanks for NFI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions