mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 16:54:17 +08:00
- K-line: daily+ periods output 'date' only, minute periods output 'datetime' - Transactions (tick-by-tick): combine date param + hour/minute into 'datetime' - XdxrRecord, HistoricalFundFlow: year/month/day merged to 'date' - MinuteBar: rename unknown_1 to _unknown_1 (hidden from DataFrame) - MinuteBar: add datetime column computed from bar index (A-share 240-bar pattern) - get_minute_time_data: use history endpoint only (current-day endpoint broken in pytdx too) - Update all examples to reflect new DataFrame column names
19 lines
637 B
Python
19 lines
637 B
Python
"""演示:批量获取实时五档行情。最多支持 80 只/次。"""
|
|
|
|
from easy_tdx import Market, TdxClient
|
|
|
|
with TdxClient.from_best_host() as c:
|
|
stocks = [
|
|
(Market.SH, "600000"), # 浦发银行
|
|
(Market.SH, "600519"), # 贵州茅台
|
|
(Market.SZ, "000001"), # 平安银行
|
|
(Market.SZ, "000858"), # 五粮液
|
|
]
|
|
df = c.get_security_quotes(stocks)
|
|
df["change_pct"] = (df["price"] - df["pre_close"]) / df["pre_close"] * 100
|
|
print(
|
|
df[
|
|
["code", "price", "change_pct", "open", "high", "low", "pre_close", "vol", "amount"]
|
|
].to_string(index=False)
|
|
)
|