mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
Merge pull request #1662 from c9s/narumi/fix-atrpin-qty
FIX: [atrpin] fix position quantity
This commit is contained in:
commit
9bf635de5f
|
@ -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