This commit is contained in:
2026-09-07 13:34:26 +08:00
parent ad9245abdd
commit 359f9ae2e4
23 changed files with 2260 additions and 513 deletions

View File

@@ -139,12 +139,11 @@ def _to_date(v) -> date | None:
def _to_code_suffix(code: str) -> str:
"""6 位代码 → 交易所后缀60/68 沪00/30 深4/8/92 北交所)。"""
if code.startswith(("60", "68", "90")):
return ".SH"
if code.startswith(("00", "30", "20")):
return ".SZ"
return ".BJ"
"""6 位代码 → 交易所后缀。委托 to_ts_code含场内 ETF51/56/58 沪、159 深)。"""
from .data.symbols import to_ts_code
ts_code = to_ts_code(code)
return ts_code[ts_code.index("."):]
def _direction(op: str) -> str | None: