This commit is contained in:
2026-09-01 15:49:09 +08:00
parent 556e21d624
commit 66ccd42d4e
10 changed files with 31 additions and 32 deletions

View File

@@ -111,7 +111,7 @@ def RunOnce(run: Runtime, signals:list[SignalItem]) -> None:
log.info("[运行] 非交易时间,跳过本轮")
return
print("=" * 40 + f" RunOnce {datetime.now().strftime('%Y-%m-%d %H:%M:%S')} " +"=" * 40)
print("=" * 40 + f" Ticker {datetime.now().strftime('%Y-%m-%d %H:%M:%S')} " +"=" * 40)
started_at = time.monotonic()
@@ -119,7 +119,7 @@ def RunOnce(run: Runtime, signals:list[SignalItem]) -> None:
try:
run.orders.refresh(run.client)
except Exception:
log.exception("[订单] 刷新订单失败")
log.exception("[Order] 刷新订单失败")
return
@@ -131,7 +131,7 @@ def RunOnce(run: Runtime, signals:list[SignalItem]) -> None:
return
allow_open_by_cash = assets.available >= assets.total * run.account_cfg.min_cash_ratio
if not allow_open_by_cash:
log.info("[开仓] 禁止开仓:可用资金不足,可用=%.2f,总资产=%.2f", assets.available, assets.total)
log.info("[Status] 禁止开仓:可用资金不足,可用=%.2f,总资产=%.2f", assets.available, assets.total)
# 3. 获取大盘状态,只有大盘信号允许时才执行开仓。
market_ok = market_allow_open()
@@ -140,7 +140,7 @@ def RunOnce(run: Runtime, signals:list[SignalItem]) -> None:
try:
position_codes, positions = run.client.positions()
except Exception:
log.exception("[持仓] 获取持仓失败")
log.exception("[Position] 获取持仓失败")
return
# 5. 验证有效开仓信号:排除已有持仓和未决订单。