bbgo_origin/pkg/strategy/rebalance/profit_stats_map.go
2023-03-14 19:27:41 +08:00

18 lines
412 B
Go

package rebalance
import "github.com/c9s/bbgo/pkg/types"
type ProfitStatsMap map[string]*types.ProfitStats
func (m ProfitStatsMap) createProfitStats(markets []types.Market) ProfitStatsMap {
for _, market := range markets {
if _, ok := m[market.Symbol]; ok {
continue
}
log.Infof("creating profit stats for symbol %s", market.Symbol)
m[market.Symbol] = types.NewProfitStats(market)
}
return m
}