mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
strategy: cache orders.IDs() in orderIds
This commit is contained in:
parent
822fea44fc
commit
b94096cb2e
|
@ -428,8 +428,9 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
|||
if err != nil {
|
||||
log.WithError(err).Error("submit profit trailing stop order error")
|
||||
} else {
|
||||
if len(orders.IDs()) > 0 {
|
||||
s.trailingStopControl.OrderID = orders.IDs()[0]
|
||||
orderIds := orders.IDs()
|
||||
if len(orderIds) > 0 {
|
||||
s.trailingStopControl.OrderID = orderIds[0]
|
||||
} else {
|
||||
log.Error("submit profit trailing stop order error. unknown error")
|
||||
s.trailingStopControl.OrderID = 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user