From 67fd15c88f0f75326f10e07960c0355e1c19e68f Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 25 Sep 2024 16:23:06 +0800 Subject: [PATCH] xdepthmaker: log covered position --- pkg/strategy/xdepthmaker/strategy.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/strategy/xdepthmaker/strategy.go b/pkg/strategy/xdepthmaker/strategy.go index 74c2477f6..2d57e2ae1 100644 --- a/pkg/strategy/xdepthmaker/strategy.go +++ b/pkg/strategy/xdepthmaker/strategy.go @@ -150,12 +150,17 @@ func (s *CrossExchangeMarketMakingStrategy) Initialize( s.HedgeOrderExecutor.ActiveMakerOrders().OnCanceled(func(o types.Order) { remaining := o.Quantity.Sub(o.ExecutedQuantity) + + log.Infof("canceled order #%d, remaining quantity: %f", o.OrderID, remaining.Float64()) + switch o.Side { case types.SideTypeSell: remaining = remaining.Neg() } s.CoveredPosition.Sub(remaining) + + log.Infof("coveredPosition - %f => %f", remaining.Float64(), s.CoveredPosition.Get().Float64()) }) s.HedgeOrderExecutor.TradeCollector().OnTrade(func(trade types.Trade, profit, netProfit fixedpoint.Value) {