ref/profitStatsTracker: TradeCollector is move to core pkg

This commit is contained in:
Andy Cheng 2023-07-10 16:33:27 +08:00
parent 4c1639cf00
commit 2a80d708af
No known key found for this signature in database
GPG Key ID: 936427CF651A9D28

View File

@ -2,6 +2,7 @@ package report
import ( import (
"github.com/c9s/bbgo/pkg/bbgo" "github.com/c9s/bbgo/pkg/bbgo"
"github.com/c9s/bbgo/pkg/core"
"github.com/c9s/bbgo/pkg/fixedpoint" "github.com/c9s/bbgo/pkg/fixedpoint"
"github.com/c9s/bbgo/pkg/types" "github.com/c9s/bbgo/pkg/types"
) )
@ -48,7 +49,7 @@ func (p *ProfitStatsTracker) Init(market types.Market, ts *types.TradeStats) {
p.InitOld(market, &ps, ts) p.InitOld(market, &ps, ts)
} }
func (p *ProfitStatsTracker) Bind(session *bbgo.ExchangeSession, tradeCollector *bbgo.TradeCollector) { func (p *ProfitStatsTracker) Bind(session *bbgo.ExchangeSession, tradeCollector *core.TradeCollector) {
tradeCollector.OnProfit(func(trade types.Trade, profit *types.Profit) { tradeCollector.OnProfit(func(trade types.Trade, profit *types.Profit) {
if profit == nil { if profit == nil {
return return