From 1a90cd0322cc7779d7c3aebf8c7a608392babaeb Mon Sep 17 00:00:00 2001 From: Andy Cheng Date: Tue, 11 Jul 2023 10:24:07 +0800 Subject: [PATCH] improve/profitStatsTracker: rename InitOld() to InitLegacy() --- pkg/report/profit_stats_tracker.go | 6 +++--- pkg/strategy/supertrend/strategy.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/report/profit_stats_tracker.go b/pkg/report/profit_stats_tracker.go index 7330cf16f..1f61cacd6 100644 --- a/pkg/report/profit_stats_tracker.go +++ b/pkg/report/profit_stats_tracker.go @@ -25,8 +25,8 @@ func (p *ProfitStatsTracker) Subscribe(session *bbgo.ExchangeSession, symbol str 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 -func (p *ProfitStatsTracker) InitOld(market types.Market, ps **types.ProfitStats, ts *types.TradeStats) { +// InitLegacy is for backward capability. ps is the ProfitStats of the strategy, Market is the strategy Market +func (p *ProfitStatsTracker) InitLegacy(market types.Market, ps **types.ProfitStats, ts *types.TradeStats) { p.Market = market if *ps == nil { @@ -46,7 +46,7 @@ func (p *ProfitStatsTracker) InitOld(market types.Market, ps **types.ProfitStats // Init initialize the tracker with the given Market func (p *ProfitStatsTracker) Init(market types.Market, ts *types.TradeStats) { ps := types.NewProfitStats(p.Market) - p.InitOld(market, &ps, ts) + p.InitLegacy(market, &ps, ts) } func (p *ProfitStatsTracker) Bind(session *bbgo.ExchangeSession, tradeCollector *core.TradeCollector) { diff --git a/pkg/strategy/supertrend/strategy.go b/pkg/strategy/supertrend/strategy.go index ea5764a77..a0942b064 100644 --- a/pkg/strategy/supertrend/strategy.go +++ b/pkg/strategy/supertrend/strategy.go @@ -358,7 +358,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se // Setup profit tracker if s.ProfitStatsTracker != nil { if s.ProfitStatsTracker.CurrentProfitStats == nil { - s.ProfitStatsTracker.InitOld(s.Market, &s.ProfitStats, s.TradeStats) + s.ProfitStatsTracker.InitLegacy(s.Market, &s.ProfitStats, s.TradeStats) } // Add strategy parameters to report