Skip to content

Commit

Permalink
Merge pull request #1579 from c9s/narumi/xgap/orderbook
Browse files Browse the repository at this point in the history
CHORE: [xgap] subscribe to level 5 book
  • Loading branch information
narumiruna authored Mar 13, 2024
2 parents 51a340e + a5e7091 commit 747b75f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/strategy/xgap/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ func (s *Strategy) CrossSubscribe(sessions map[string]*bbgo.ExchangeSession) {
}

sourceSession.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: "1m"})
sourceSession.Subscribe(types.BookChannel, s.Symbol, types.SubscribeOptions{})
sourceSession.Subscribe(types.BookChannel, s.Symbol, types.SubscribeOptions{Depth: types.DepthLevel5})

tradingSession, ok := sessions[s.TradingExchange]
if !ok {
panic(fmt.Errorf("trading session %s is not defined", s.TradingExchange))
}

tradingSession.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: "1m"})
tradingSession.Subscribe(types.BookChannel, s.Symbol, types.SubscribeOptions{})
tradingSession.Subscribe(types.BookChannel, s.Symbol, types.SubscribeOptions{Depth: types.DepthLevel5})
}

func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, sessions map[string]*bbgo.ExchangeSession) error {
Expand Down

0 comments on commit 747b75f

Please sign in to comment.