Files
easy-tdx/src/xmtdx/ex/commands/get_instrument_count.py
T
GitHubandClaude Opus 4.7 9c5672b4d2 feat: add extended market, offline data reader, rewrite README
- Add ExTdxClient/AsyncExTdxClient for futures, HK stocks, etc (port 7727)
- Add offline module: read daily bars, minute bars, blocks, gbbq, financials
  from local TDX installation directory (inspired by pytdx)
- Add examples 09 (file download) and 10 (offline data reading)
- Rewrite README with comprehensive API docs and code examples
- Add TdxFileNotFoundError and TdxOfflineError exceptions

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 23:03:08 +08:00

18 lines
518 B
Python

"""获取扩展行情商品数量。"""
from ..._binary import unpack_from
from ...commands.base import BaseCommand
class GetExInstrumentCountCmd(BaseCommand[int]):
"""获取扩展行情市场中商品总数。"""
def build_request(self) -> bytes:
return bytes.fromhex("01 03 48 66 00 01 02 00 02 00 f0 23")
def parse_response(self, body: bytes) -> int:
if len(body) < 23:
return 0
(count,) = unpack_from("<I", body, 19, "ex instrument count")
return count