Files
easy_tdx_max/examples/12_mac_kline/kline_offset.py
T
GitHubandClaude Opus 4.7 4820b4a049 feat: v1.1.0 - MAC protocol, CLI tool, extended markets, unified client
- Add MacClient/AsyncMacClient with full MAC protocol support (quotes, kline
  with adjustment, tick charts, transactions, boards, capital flow, auction,
  unusual, symbol info, server info)
- Add MacExClient/AsyncMacExClient for extended markets (HK, US, futures)
- Add UnifiedTdxClient auto-routing between A-share and extended markets
- Add `easy-tdx` CLI tool with JSON default output, Agent-friendly
- Add field bitmap protocol for custom quote field selection
- Fix quote-list missing fields (default to BASIC+VOLUME preset)
- Add config.py with centralized host management and auto-discovery
- Add 50+ examples covering all APIs (01-20)
- Rewrite README with CLI-first, Agent-friendly documentation
- Bump version to 1.1.0

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 22:44:45 +08:00

24 lines
645 B
Python
Raw 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.
"""演示:K 线偏移信息。
通过 MacClient 的 get_kline_offset() 获取 K 线数据的偏移量信息,用于确定当前可用
K 线总数和数据偏移位置。通常用于确认服务器上的 K 线数据总量。
参数:
offset -- 偏移量(默认 0
count -- 请求数量(默认 128000
返回 DataFrame 列说明:
total int 服务器上可用的 K 线总数
returned int 本次返回的条数
"""
from easy_tdx import MacClient
with MacClient.from_best_host() as c:
df = c.get_kline_offset()
print(df.to_string(index=False))
# 运行结果:
# total returned
# 128000 2