From 420d128f8a7010e419e23edf577532c3f6872c45 Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 23 Dec 2024 14:07:17 +0800 Subject: [PATCH] xnav: subscribe BTCUSDT symbol --- pkg/strategy/xnav/strategy.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/strategy/xnav/strategy.go b/pkg/strategy/xnav/strategy.go index ae82b8a2f..15811e21d 100644 --- a/pkg/strategy/xnav/strategy.go +++ b/pkg/strategy/xnav/strategy.go @@ -148,9 +148,17 @@ func (s *Strategy) Validate() error { return nil } +const anchorSymbol = "BTCUSDT" + var ten = fixedpoint.NewFromInt(10) -func (s *Strategy) CrossSubscribe(sessions map[string]*bbgo.ExchangeSession) {} +func (s *Strategy) CrossSubscribe(sessions map[string]*bbgo.ExchangeSession) { + for _, session := range sessions { + session.Subscribe(types.KLineChannel, anchorSymbol, types.SubscribeOptions{ + Interval: types.Interval1m, + }) + } +} func (s *Strategy) recordNetAssetValue(ctx context.Context, sessions map[string]*bbgo.ExchangeSession) { log.Infof("recording net asset value...")