mark trades with the strategy ID

This commit is contained in:
c9s 2021-03-16 10:58:51 +08:00
parent 478bef526d
commit ebcef65b01

View File

@ -332,6 +332,12 @@ func (s *Strategy) tradeUpdateHandler(trade types.Trade) {
if s.orderStore.Exists(trade.OrderID) {
log.Infof("received trade update of order %d: %+v", trade.OrderID, trade)
if s.TradeService != nil {
if err := s.TradeService.MarkStrategyID(context.Background(), trade.ID, ID) ; err != nil {
log.WithError(err).Error("mark strategy ID error")
}
}
if trade.Side == types.SideTypeSelf {
return
}