mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
bbgo: fix quantity adjustment
This commit is contained in:
parent
50d5449b9a
commit
4b0db6b3af
|
@ -271,7 +271,7 @@ func (e *GeneralOrderExecutor) reduceQuantityAndSubmitOrder(ctx context.Context,
|
|||
var err error
|
||||
for i := 0; i < submitOrderRetryLimit; i++ {
|
||||
q := submitOrder.Quantity.Mul(fixedpoint.One.Sub(quantityReduceDelta))
|
||||
if !e.session.Futures {
|
||||
if !e.session.Futures && !e.session.Margin {
|
||||
if submitOrder.Side == types.SideTypeSell {
|
||||
if baseBalance, ok := e.session.GetAccount().Balance(e.position.Market.BaseCurrency); ok {
|
||||
q = fixedpoint.Min(q, baseBalance.Available)
|
||||
|
|
Loading…
Reference in New Issue
Block a user