Skip to content

Commit

Permalink
check dust quantity by taker price
Browse files Browse the repository at this point in the history
  • Loading branch information
narumiruna committed Feb 6, 2024
1 parent 541d19d commit 502685f
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions pkg/strategy/atrpin/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,16 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se

position := s.Strategy.OrderExecutor.Position()
log.Infof("position: %+v", position)
if !position.IsDust() {
log.Infof("%s position is not dust", s.Symbol)

side := types.SideTypeSell
takerPrice := fixedpoint.Zero
side := types.SideTypeBuy
takerPrice := ticker.Sell
if position.IsLong() {
side = types.SideTypeSell
takerPrice = ticker.Buy
}

if position.IsShort() {
side = types.SideTypeBuy
takerPrice = ticker.Sell
} else if position.IsLong() {
side = types.SideTypeSell
takerPrice = ticker.Buy
}
if !position.IsDust(takerPrice) {
log.Infof("%s position is not dust", s.Symbol)

orderForms = append(orderForms, types.SubmitOrder{
Symbol: s.Symbol,
Expand Down

0 comments on commit 502685f

Please sign in to comment.