mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
xgap: check sourceSymbol
This commit is contained in:
parent
2ea0c86c67
commit
ab9faba1af
|
@ -105,13 +105,15 @@ func (s *Strategy) Defaults() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Strategy) CrossSubscribe(sessions map[string]*bbgo.ExchangeSession) {
|
func (s *Strategy) CrossSubscribe(sessions map[string]*bbgo.ExchangeSession) {
|
||||||
sourceSession, ok := sessions[s.SourceExchange]
|
if len(s.SourceExchange) > 0 && len(s.SourceSymbol) > 0 {
|
||||||
if !ok {
|
sourceSession, ok := sessions[s.SourceExchange]
|
||||||
panic(fmt.Errorf("source session %s is not defined", s.SourceExchange))
|
if !ok {
|
||||||
}
|
panic(fmt.Errorf("source session %s is not defined", s.SourceExchange))
|
||||||
|
}
|
||||||
|
|
||||||
sourceSession.Subscribe(types.KLineChannel, s.SourceSymbol, types.SubscribeOptions{Interval: "1m"})
|
sourceSession.Subscribe(types.KLineChannel, s.SourceSymbol, types.SubscribeOptions{Interval: "1m"})
|
||||||
sourceSession.Subscribe(types.BookChannel, s.SourceSymbol, types.SubscribeOptions{Depth: types.DepthLevel5})
|
sourceSession.Subscribe(types.BookChannel, s.SourceSymbol, types.SubscribeOptions{Depth: types.DepthLevel5})
|
||||||
|
}
|
||||||
|
|
||||||
tradingSession, ok := sessions[s.TradingExchange]
|
tradingSession, ok := sessions[s.TradingExchange]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user