]> Piment Noir Git Repositories - freqai-strategies.git/commit
fix(quickadapter): preserve valid partial-exit remainder (#118)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 26 Jul 2026 19:05:39 +0000 (21:05 +0200)
committerGitHub <noreply@github.com>
Sun, 26 Jul 2026 19:05:39 +0000 (21:05 +0200)
commitd9d5819f99dd8f79db2262debf24099d842db820
tree29e2abee0595f21c6b52125ba4e0f540b58742bf
parentc53079356b84291dc31072eac40c96071174179c
fix(quickadapter): preserve valid partial-exit remainder (#118)

Trigger the take-profit partial exit at freqtrade's executable current_exit_rate
instead of the entry-side current_rate, and size the partial-exit remainder so it
survives freqtrade's minimum-stake guard.

- Evaluate the take-profit trigger and the remaining position at current_exit_rate
  (the rate the exit actually fills at); the previous current_rate is the entry rate
  in this callback and could fire a long exit below its bid target (symmetric short).
- freqtrade passes min_entry_stake as min_stake but rejects the partial exit when the
  remaining value is below the larger min_exit_stake. Size the remainder against a
  proven upper bound min_exit_stake <= min_stake * max(current_exit_rate/current_entry_rate,
  1/(1-|stoploss|)) (holds for both the cost- and amount-driven minimum), with a small
  rounding margin, so the shrunk remainder clears the guard. Leverage cancels; amount
  precision and final validation are left to freqtrade.
quickadapter/user_data/strategies/QuickAdapterV3.py