mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +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()
|
position := s.Strategy.OrderExecutor.Position()
|
||||||
log.Infof("position: %+v", position)
|
log.Infof("position: %+v", position)
|
||||||
if !position.IsDust() {
|
|
||||||
|
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)
|
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.SideTypeSell
|
|
||||||
takerPrice = ticker.Buy
|
|
||||||
}
|
|
||||||
|
|
||||||
orderForms = append(orderForms, types.SubmitOrder{
|
orderForms = append(orderForms, types.SubmitOrder{
|
||||||
Symbol: s.Symbol,
|
Symbol: s.Symbol,
|
||||||
Type: types.OrderTypeLimit,
|
Type: types.OrderTypeLimit,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user