Files
lm_code/币安/test.py
2025-10-22 17:05:04 +08:00

13 lines
513 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from binance.client import Client
if __name__ == '__main__':
client = Client()
# 获取ETHUSDT过去的K线数据时间间隔为30分钟
klines = client.get_historical_klines("ETHUSDT", Client.KLINE_INTERVAL_30MINUTE, "1 month ago UTC")
# 打印K线数据
for kline in klines:
print(kline)
# [1758542400000, '4181.63000000', '4190.00000000', '4169.17000000', '4184.14000000', '6409.29720000', 1758544199999, '26785429.32668800', 57484, '3256.65840000', '13611461.63871100', '0']