mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
kucoin: integrate list tickers
This commit is contained in:
parent
0b6e66348e
commit
3b5015e1ca
|
@ -136,6 +136,24 @@ func (e *Exchange) QueryTickers(ctx context.Context, symbols ...string) (map[str
|
||||||
return tickers, nil
|
return tickers, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
allTickers, err := e.client.MarketDataService.ListTickers()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, s := range allTickers.Ticker {
|
||||||
|
tickers[ s.Symbol ] = types.Ticker{
|
||||||
|
Time: s.Time.Time(),
|
||||||
|
Volume: s.Volume.Float64(),
|
||||||
|
Last: s.Last.Float64(),
|
||||||
|
Open: s.Last.Float64() - s.ChangePrice.Float64(),
|
||||||
|
High: s.High.Float64(),
|
||||||
|
Low: s.Low.Float64(),
|
||||||
|
Buy: s.Buy.Float64(),
|
||||||
|
Sell: s.Sell.Float64(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return tickers, nil
|
return tickers, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user