all: add more futures channel types

This commit is contained in:
c9s 2023-03-22 22:01:59 +08:00
parent e607fc19ac
commit 98b0ffa510
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 12 additions and 11 deletions

View File

@ -107,12 +107,6 @@ func (s *Strategy) CrossSubscribe(sessions map[string]*bbgo.ExchangeSession) {
}
func (s *Strategy) Subscribe(session *bbgo.ExchangeSession) {
// session.Subscribe(types.BookChannel, s.Symbol, types.SubscribeOptions{})
// session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{
// Interval: string(s.Interval),
// })
for _, detection := range s.SupportDetection {
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{
Interval: detection.Interval,

View File

@ -2,8 +2,15 @@ package types
type Channel string
var BookChannel = Channel("book")
var KLineChannel = Channel("kline")
var BookTickerChannel = Channel("bookticker")
var MarketTradeChannel = Channel("trade")
var AggTradeChannel = Channel("aggTrade")
const (
BookChannel = Channel("book")
KLineChannel = Channel("kline")
BookTickerChannel = Channel("bookTicker")
MarketTradeChannel = Channel("trade")
AggTradeChannel = Channel("aggTrade")
// channels for futures
MarkPriceChannel = Channel("markPrice")
LiquidationOrderChannel = Channel("liquidationOrder")
ContractChannel = Channel("contract")
)