From ebcef65b01e641c26336f53fef9092fddc617ac5 Mon Sep 17 00:00:00 2001 From: c9s Date: Tue, 16 Mar 2021 10:58:51 +0800 Subject: [PATCH] mark trades with the strategy ID --- pkg/strategy/grid/strategy.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/strategy/grid/strategy.go b/pkg/strategy/grid/strategy.go index 07d233df2..2624187d7 100644 --- a/pkg/strategy/grid/strategy.go +++ b/pkg/strategy/grid/strategy.go @@ -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 }