mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-15 03:23:52 +00:00
18 lines
412 B
Go
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
|
|
}
|