mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
fix/profitStatsTracker: market is initiated after strategy Subscribe()
This commit is contained in:
parent
2ccce12cbf
commit
4c1639cf00
|
@ -20,8 +20,8 @@ type ProfitStatsTracker struct {
|
|||
tradeStats *types.TradeStats
|
||||
}
|
||||
|
||||
func (p *ProfitStatsTracker) Subscribe(session *bbgo.ExchangeSession) {
|
||||
session.Subscribe(types.KLineChannel, p.Market.Symbol, types.SubscribeOptions{Interval: p.Interval})
|
||||
func (p *ProfitStatsTracker) Subscribe(session *bbgo.ExchangeSession, symbol string) {
|
||||
session.Subscribe(types.KLineChannel, symbol, types.SubscribeOptions{Interval: p.Interval})
|
||||
}
|
||||
|
||||
// InitOld is for backward capability. ps is the ProfitStats of the strategy, Market is the strategy Market
|
||||
|
|
|
@ -133,7 +133,7 @@ func (s *Strategy) Subscribe(session *bbgo.ExchangeSession) {
|
|||
|
||||
// Profit tracker
|
||||
if s.ProfitStatsTracker != nil {
|
||||
s.ProfitStatsTracker.Subscribe(session)
|
||||
s.ProfitStatsTracker.Subscribe(session, s.Symbol)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user