diff --git a/api/qmt_rest_new.py b/api/qmt_rest_new.py index 3a3577a..7e0d4cd 100644 --- a/api/qmt_rest_new.py +++ b/api/qmt_rest_new.py @@ -346,7 +346,6 @@ def format_holding(positions): return holding def format_orders(orders): - """显式转换委托/成交字段,保留原始数值类型。""" result = [] for order in orders: result.append({ @@ -370,7 +369,6 @@ def format_orders(orders): return result def format_deals(deals): - """显式转换委托/成交字段,保留原始数值类型。""" result = [] for d in deals: result.append({ diff --git a/py-client/libs/collector.py b/py-client/libs/collector.py index 3aee6ac..c654883 100644 --- a/py-client/libs/collector.py +++ b/py-client/libs/collector.py @@ -1,6 +1,7 @@ from dataclasses import asdict, is_dataclass from datetime import date, datetime from enum import Enum +import json from typing import Any from strategy.trend.boot import get_collector_snapshot import httpx @@ -43,6 +44,8 @@ def collector_push(account_id: str, assets: Any, positions: Any) -> None: "positions": positions, } ) + pretty_json = json.dumps(payload, indent=4, ensure_ascii=False) + print(pretty_json) httpx.post(COLLECTOR_URL, json=payload, timeout=3.0) except BaseException: # Collection must never interrupt or affect the trading workflow.