mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
check dust quantity by taker price
This commit is contained in:
parent
541d19d826
commit
502685f5d8
|
@ -119,20 +119,17 @@ 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
|
||||
|
||||
if position.IsShort() {
|
||||
side = types.SideTypeBuy
|
||||
takerPrice = ticker.Sell
|
||||
} else if position.IsLong() {
|
||||
side := types.SideTypeBuy
|
||||
takerPrice := ticker.Sell
|
||||
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,
|
||||
Type: types.OrderTypeLimit,
|
||||
|
|
Loading…
Reference in New Issue
Block a user