From d030cfc91f6a87685356c1c4e8db12c8ac7d5c12 Mon Sep 17 00:00:00 2001 From: claude_dev Date: Thu, 13 Aug 2026 18:32:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(paper):=20=E7=BB=84=E5=90=88=E7=AD=96?= =?UTF-8?q?=E7=95=A5=E6=8E=A5=E5=85=A5=E6=A8=A1=E6=8B=9F=E7=9B=98=E5=AE=9E?= =?UTF-8?q?=E8=B5=B0(E1+E2):=20paper=5Faccounts=E5=8A=A0strategy=5Ftype?= =?UTF-8?q?=E5=88=97(=E5=90=AB=E8=BF=81=E7=A7=BB);=20portfolio=5Fpaper?= =?UTF-8?q?=E6=AF=8F=E6=99=9A20:30=E5=85=A8=E9=87=8F=E9=87=8D=E6=94=BE?= =?UTF-8?q?=E2=86=92=E5=BD=93=E6=97=A5=E6=88=90=E4=BA=A4/=E6=9C=AB?= =?UTF-8?q?=E6=97=A5=E6=8C=81=E4=BB=93/=E5=87=80=E5=80=BC=E8=90=BDpaper?= =?UTF-8?q?=E8=A1=A8(=E5=B9=82=E7=AD=89,=E5=9B=9E=E6=B5=8B=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E4=B8=BA=E5=8D=95=E4=B8=80=E7=9C=9F=E7=9B=B8=E6=BA=90?= =?UTF-8?q?);=20run=5Flive=5Fstep=E6=8C=89=E7=B1=BB=E5=9E=8B=E5=88=86?= =?UTF-8?q?=E6=B5=81;=20create=E6=94=AF=E6=8C=81portfolio(=E4=BB=85live);?= =?UTF-8?q?=20=E5=89=8D=E7=AB=AF=E6=96=B0=E5=BB=BA=E6=A8=A1=E6=8B=9F?= =?UTF-8?q?=E7=9B=98=E7=AD=96=E7=95=A5=E7=B1=BB=E5=9E=8B=E9=80=89=E6=8B=A9?= =?UTF-8?q?+=E7=BB=84=E5=90=88=E5=AD=97=E6=AE=B5(=E7=AD=96=E7=95=A5/?= =?UTF-8?q?=E6=B1=A0/=E4=B8=8A=E9=99=90/=E5=9F=BA=E5=87=86)=20[vps]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/paper.ts | 6 ++ frontend/src/views/paper/New.vue | 130 ++++++++++++++++++++--- sanguo_api/routes_paper.py | 20 ++++ sanguo_trader/live_orchestrator.py | 16 ++- sanguo_trader/persistence.py | 13 ++- sanguo_trader/portfolio_paper.py | 148 +++++++++++++++++++++++++++ tests/trader/test_portfolio_paper.py | 120 ++++++++++++++++++++++ 7 files changed, 434 insertions(+), 19 deletions(-) create mode 100644 sanguo_trader/portfolio_paper.py create mode 100644 tests/trader/test_portfolio_paper.py diff --git a/frontend/src/api/paper.ts b/frontend/src/api/paper.ts index e67a12b..07ef7e5 100644 --- a/frontend/src/api/paper.ts +++ b/frontend/src/api/paper.ts @@ -16,6 +16,11 @@ export interface PaperCreate { initial_capital: number start: string end: string + // 组合策略实走(E1):strategy_type=portfolio 时 mode 须 live + strategy_type?: string + pool?: string + max_pool?: number + benchmark?: string } export interface PaperAccount { @@ -24,6 +29,7 @@ export interface PaperAccount { mode: string interval: string status: string + strategy_type?: string symbols?: string initial_capital?: number start_date?: string diff --git a/frontend/src/views/paper/New.vue b/frontend/src/views/paper/New.vue index bb72255..a6e3a25 100644 --- a/frontend/src/views/paper/New.vue +++ b/frontend/src/views/paper/New.vue @@ -1,5 +1,5 @@