mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 15:44:15 +08:00
- 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>
18 lines
518 B
Python
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
|