mirror of
https://ghfast.top/https://github.com/aeroxw/easy_tdx_max.git
synced 2026-09-12 21:34:21 +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
15 lines
412 B
Python
15 lines
412 B
Python
"""演示:获取指数 K 线数据。
|
|
|
|
常用指数代码:
|
|
上证指数: Market.SH, "000001"
|
|
深证成指: Market.SZ, "399001"
|
|
创业板指: Market.SZ, "399006"
|
|
"""
|
|
|
|
from easy_tdx import KlineCategory, Market, TdxClient
|
|
|
|
with TdxClient.from_best_host() as c:
|
|
df = c.get_index_bars(Market.SH, "999999", KlineCategory.DAY, 0, 10)
|
|
print("上证指数 日K线:")
|
|
print(df.to_string(index=False))
|