mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 15:44:15 +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
17 lines
535 B
Python
17 lines
535 B
Python
"""演示:计算个股涨跌停价格。"""
|
|
|
|
from easy_tdx import Market, TdxClient
|
|
|
|
CODE = "600519"
|
|
NAME = "贵州茅台"
|
|
|
|
with TdxClient.from_best_host() as c:
|
|
quotes = c.get_security_quotes([(Market.SH, CODE)])
|
|
if not quotes.empty:
|
|
q = quotes.iloc[0]
|
|
limit_up, limit_down = c.get_price_limits(Market.SH, CODE, NAME, q["pre_close"])
|
|
print(f"代码: {CODE} 名称: {NAME}")
|
|
print(f"昨收: {q['pre_close']}")
|
|
print(f"涨停价: {limit_up}")
|
|
print(f"跌停价: {limit_down}")
|