We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b4dfa3 commit f20d000Copy full SHA for f20d000
pkg/strategy/xmaker/strategy.go
@@ -2739,6 +2739,10 @@ func (s *Strategy) CrossRun(
2739
})
2740
s.connectorManager.Add(s.marketTradeStream)
2741
}
2742
+ s.marketTradeStream.OnMarketTrade(types.TradeWith(s.Symbol, func(trade types.Trade) {
2743
+ // set the last price to enable the unrealized PnL calculation
2744
+ s.Position.SetLastPrice(trade.Price)
2745
+ }))
2746
2747
if s.FastCancel != nil && s.FastCancel.Enabled {
2748
if err := s.FastCancel.InitializeAndBind(sessions, s); err != nil {
0 commit comments