mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
fix cross exchange strategy subscription
This commit is contained in:
parent
cd34c2f4e7
commit
d38b16fb3e
|
@ -128,6 +128,12 @@ func (trader *Trader) Run(ctx context.Context) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, strategy := range trader.crossExchangeStrategies {
|
||||||
|
if subscriber, ok := strategy.(CrossExchangeSessionSubscriber); ok {
|
||||||
|
subscriber.Subscribe(trader.environment.sessions)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := trader.environment.Init(ctx); err != nil {
|
if err := trader.environment.Init(ctx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -224,12 +230,6 @@ func (trader *Trader) Run(ctx context.Context) error {
|
||||||
sessions: trader.environment.sessions,
|
sessions: trader.environment.sessions,
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, strategy := range trader.crossExchangeStrategies {
|
|
||||||
if subscriber, ok := strategy.(CrossExchangeSessionSubscriber); ok {
|
|
||||||
subscriber.Subscribe(trader.environment.sessions)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, strategy := range trader.crossExchangeStrategies {
|
for _, strategy := range trader.crossExchangeStrategies {
|
||||||
rs := reflect.ValueOf(strategy)
|
rs := reflect.ValueOf(strategy)
|
||||||
if rs.Elem().Kind() == reflect.Struct {
|
if rs.Elem().Kind() == reflect.Struct {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user