补充 2401-2412、2501-2512 合约数据

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
vipg
2026-07-18 15:55:48 +08:00
parent 2918712bdc
commit 3345572c88
25 changed files with 5836 additions and 2 deletions
+5 -2
View File
@@ -172,8 +172,11 @@ def sync_csv_to_db():
if __name__ == "__main__":
# 活跃合约
active = get_active_contracts("CZCE", "FG")
# 已退市合约:FG2601-FG2607
extra_codes = {f"FG{suffix}.ZCE" for suffix in [f"26{i:02d}" for i in range(1, 8)]}
# 已退市合约:FG2401-FG2412、FG2501-FG2512、FG2601-FG2607
extra_codes = {f"FG{suffix}.ZCE" for suffix in
[f"24{i:02d}" for i in range(1, 13)] +
[f"25{i:02d}" for i in range(1, 13)] +
[f"26{i:02d}" for i in range(1, 8)]}
all_fg = get_all_contracts("CZCE", "FG")
active_codes = {c["ts_code"] for c in active}
extra = [c for c in all_fg if c["ts_code"] in extra_codes and c["ts_code"] not in active_codes]