Files
sanguo_vnpy_v2/sanguo_live/__main__.py
T
claude_dev 96b1924fd5 feat: 实盘模拟(live) + 组合回测MVP(portfolio)
[live] 实盘模拟 vnpy+miniQMT 直连(supervisor 轮询, 前后端):
- sanguo_live: LiveTradingEngine + AShareCtaTemplate(定寸/禁做空) + runner_supervisor(DB驱动) + persistence(4表WAL)
- sanguo_api/routes_live: 9路由(create/start/stop/positions/trades/account/status)
- frontend live: New/List/Monitor + api/live.ts; config/live.yaml

[portfolio] 组合回测 MVP(BulletTrade, 链路代码完成待验证):
- runner_backtest 加 JSON 入口(--json, BacktestEngine 顶层 import)
- sanguo_api/routes_portfolio: POST /portfolio/backtest SSH 触发 VPS 跑
- frontend PortfolioBacktest.vue + api/portfolio.ts: 表单+结果+净值曲线
- 路由/菜单注册(/backtest/portfolio 组合回测)
- 已知: MVP 链路未端到端验证, agent 改至中途被停; 待 Mac 起服务联调
2026-07-18 20:04:16 +08:00

18 lines
536 B
Python

"""python -m sanguo_live [config_path | --supervisor [db_path]]
默认(无参 / yaml 路径):config 驱动单实例模式(run)。
--supervisor [db_path]:DB 驱动 supervisor,轮询 live_accounts.status 管理多实例。
"""
import sys
from sanguo_live.runner import run, run_supervisor
if __name__ == "__main__":
args = sys.argv[1:]
if args and args[0] == "--supervisor":
db_path = args[1] if len(args) > 1 else None
run_supervisor(db_path)
else:
cfg = args[0] if args else None
run(cfg)