mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-23 23:35:14 +00:00
20 lines
410 B
Go
20 lines
410 B
Go
package rebalance
|
|
|
|
import (
|
|
"github.com/c9s/bbgo/pkg/types"
|
|
)
|
|
|
|
type ProfitStatsMap map[string]*types.ProfitStats
|
|
|
|
func (m ProfitStatsMap) CreateProfitStats(markets map[string]types.Market) ProfitStatsMap {
|
|
for symbol, market := range markets {
|
|
if _, ok := m[symbol]; ok {
|
|
continue
|
|
}
|
|
|
|
log.Infof("creating profit stats for symbol %s", symbol)
|
|
m[symbol] = types.NewProfitStats(market)
|
|
}
|
|
return m
|
|
}
|