from huobi import SubscriptionClient from huobi.model import * from huobi.exception.huobiapiexception import HuobiApiException from huobi import RequestClient
request_client = RequestClient()
# Get the timestamp from Huobi server and print on console timestamp = request_client.get_exchange_timestamp print(timestamp)
# Get the latest btcusdt‘s candlestick data and print the highest price on console candlestick_list = request_client.get_latest_candlestick("btcusdt", CandlestickInterval.DAY1, 20) for item in candlestick_list: print(item.high)
启动一个临时容器,测试一下我们的 SDK 是否安装正确
1
docker run -it --rm -v $(pwd):/app ety001/huobi-lib:1.0.5 python3 /app/a.py