mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
fix position quantity
This commit is contained in:
parent
ee09922865
commit
bbb1b8a9fa
|
@ -160,7 +160,8 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
||||||
takerPrice = ticker.Sell
|
takerPrice = ticker.Sell
|
||||||
}
|
}
|
||||||
|
|
||||||
if !s.Market.IsDustQuantity(base, takerPrice) {
|
positionQuantity := base.Abs()
|
||||||
|
if !s.Market.IsDustQuantity(positionQuantity, takerPrice) {
|
||||||
s.logger.Infof("%s position is not dust", s.Symbol)
|
s.logger.Infof("%s position is not dust", s.Symbol)
|
||||||
|
|
||||||
orderForms = append(orderForms, types.SubmitOrder{
|
orderForms = append(orderForms, types.SubmitOrder{
|
||||||
|
@ -168,7 +169,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
||||||
Type: types.OrderTypeLimit,
|
Type: types.OrderTypeLimit,
|
||||||
Side: side,
|
Side: side,
|
||||||
Price: takerPrice,
|
Price: takerPrice,
|
||||||
Quantity: base.Abs(),
|
Quantity: positionQuantity,
|
||||||
Market: s.Market,
|
Market: s.Market,
|
||||||
TimeInForce: types.TimeInForceGTC,
|
TimeInForce: types.TimeInForceGTC,
|
||||||
Tag: "takeProfit",
|
Tag: "takeProfit",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user