grid2: debug submitOrder before sending them to the api

This commit is contained in:
c9s 2022-12-15 18:30:28 +08:00
parent bc8d7e9968
commit ac8186d43d
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 7 additions and 3 deletions

View File

@ -52,8 +52,12 @@ exchangeStrategies:
## for example, when the last price hit 17_000.0 then open a grid with the price range 13_000 to 20_000
# triggerPrice: 16_900.0
## stopLossPrice is used for closing the grid and sell all the inventory to stop loss.
## (optional)
stopLossPrice: 16_000.0
## takeProfitPrice is used for closing the grid and sell all the inventory at higher price to take profit
## (optional)
takeProfitPrice: 20_000.0
## profitSpread is the profit spread of the arbitrage order (sell order)
@ -85,4 +89,4 @@ exchangeStrategies:
keepOrdersWhenShutdown: false
## skipSpreadCheck skips the minimal spread check for the grid profit
# skipSpreadCheck: true
skipSpreadCheck: true

View File

@ -809,13 +809,13 @@ func (s *Strategy) openGrid(ctx context.Context, session *bbgo.ExchangeSession)
return err
}
s.debugGridOrders(submitOrders, lastPrice)
createdOrders, err2 := s.orderExecutor.SubmitOrders(ctx, submitOrders...)
if err2 != nil {
return err
}
s.debugGridOrders(submitOrders, lastPrice)
for _, order := range createdOrders {
s.logger.Info(order.String())
}