mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 15:44:15 +08:00
- Add example scripts for all API categories (connection, market info, kline, minute, transaction, finance, block, fund flow) - Fix GetIndexBarsCmd: index bar records have 4 extra bytes (advance/ decline counts) that were not consumed, causing pos drift and corrupted dates/volumes for all records after the first - Fix price_limits.py example (SecurityQuote has no name attr) - Fix finance_info.py display (scientific notation -> formatted numbers) - Add PostToolUse ruff hook (scripts/ruff_hook.py) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
10 lines
303 B
Python
10 lines
303 B
Python
"""演示:获取市场证券总数。"""
|
|
|
|
from xmtdx import TdxClient, Market
|
|
|
|
with TdxClient.from_best_host() as c:
|
|
sh_count = c.get_security_count(Market.SH)
|
|
sz_count = c.get_security_count(Market.SZ)
|
|
print(f"沪市证券总数: {sh_count}")
|
|
print(f"深市证券总数: {sz_count}")
|