mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
fixup! get marketcap values from coinmarketcap
This commit is contained in:
parent
e7a7e21b68
commit
71ae75df73
|
@ -23,7 +23,7 @@ func init() {
|
|||
}
|
||||
|
||||
type Strategy struct {
|
||||
Datasource *coinmarketcap.DataSource
|
||||
datasource *coinmarketcap.DataSource
|
||||
|
||||
Interval types.Interval `json:"interval"`
|
||||
BaseCurrency string `json:"baseCurrency"`
|
||||
|
@ -40,7 +40,7 @@ type Strategy struct {
|
|||
|
||||
func (s *Strategy) Initialize() error {
|
||||
apiKey := os.Getenv("COINMARKETCAP_API_KEY")
|
||||
s.Datasource = coinmarketcap.New(apiKey)
|
||||
s.datasource = coinmarketcap.New(apiKey)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ func (s *Strategy) getTargetWeights(ctx context.Context) types.ValueMap {
|
|||
|
||||
// get marketcap from coinmarketcap
|
||||
// set higher query limit to avoid target currency not in the list
|
||||
marketcaps, err := s.Datasource.QueryMarketCapInUSD(ctx, 100)
|
||||
marketcaps, err := s.datasource.QueryMarketCapInUSD(ctx, 100)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("failed to query market cap")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user