feat dev6

This commit is contained in:
2026-09-01 14:28:49 +08:00
parent dedbf63a92
commit 556e21d624
27 changed files with 334 additions and 144 deletions

View File

@@ -14,12 +14,12 @@ def main():
_, positions = client.positions()
print(f"总资产:{assets.total:.2f}元,可用资金:{assets.available:.2f}")
for p in sorted(positions, key=lambda item: item.stock_code):
if p.volume > 0: print(f"{p.stock_code} {p.stock_name} 持仓={p.volume} 可用={p.can_use_volume} 成本={p.open_price:.3f} 现价={p.last_price:.3f}")
if p.volume > 0: print(f"{p.stock_code} {p.stock_name} 持仓={p.volume} 可用={p.can_use_volume} 成本={p.open_price:.2f} 现价={p.last_price:.2f}")
data_dir = os.environ.get("QMT_DATA_DIR", "").strip()
if not data_dir: raise SystemExit("环境变量 QMT_DATA_DIR 为空")
codes = json.loads((Path(data_dir) / "pass_codes.json").read_text(encoding="utf-8"))
for code, tick in sorted(client.full_tick(codes).items()):
print(f"{code} last={tick.last_price:.3f} close={tick.last_close:.3f}")
print(f"{code} last={tick.last_price:.2f} close={tick.last_close:.2f}")
if __name__ == "__main__": main()