feat: 自动候选筛选与股票研究工作台

This commit is contained in:
2026-10-09 20:39:23 +08:00
parent 92329ddce2
commit 57882ff568
32 changed files with 1343 additions and 87 deletions
+143 -8
View File
@@ -1,7 +1,7 @@
openapi: 3.0.3
info:
title: Veyra API
version: 0.12.0
version: 0.15.0
description: 开发身份、账户、供应商配置、候选、计划、成交账本、站内通知、研究策略、Python 回测与公开 A 股开发行情。模拟工作流仅限 local/test;正式行情授权、完整交易规则及远程推送未完成。
servers:
- url: http://127.0.0.1:8080
@@ -1538,6 +1538,91 @@ paths:
$ref: "#/components/responses/Error"
"503":
$ref: "#/components/responses/Error"
/api/admin/v1/strategy-screenings:
get:
tags:
- Admin
summary: 最近自动日线筛选记录
description: 管理员专用。只记录已完成筛选;不满足数据时效或来源失败时不生成候选。SIGNAL 提交到待审核,不自动发布。
security:
- adminCookie: []
responses:
"200": &a3
description: 成功
content:
application/json:
schema:
$ref: "#/components/schemas/Envelope"
"401":
$ref: "#/components/responses/Error"
"403":
$ref: "#/components/responses/Error"
"503":
$ref: "#/components/responses/Error"
/api/admin/v1/strategy-screenings/{id}:
get:
tags:
- Admin
summary: 查看自动筛选不可覆盖的参数与日线输入快照
description: 管理员专用。只记录已完成筛选;不满足数据时效或来源失败时不生成候选。SIGNAL 提交到待审核,不自动发布。
security:
- adminCookie: []
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
"200": *a3
"401":
$ref: "#/components/responses/Error"
"403":
$ref: "#/components/responses/Error"
"404":
$ref: "#/components/responses/Error"
"503":
$ref: "#/components/responses/Error"
/api/admin/v1/strategy-screening-status:
get:
operationId: getScreeningWorkerState
summary: 当前进程的最近一批筛选状态
description: 状态与数量仅对应当前进程最近一批;持久化结果使用 strategy-screenings。
security:
- adminCookie: []
responses:
"200":
description: 成功
content: &a5
application/json:
schema:
$ref: "#/components/schemas/Envelope"
"401": &a4
$ref: "#/components/responses/Error"
"403": *a4
"503": *a4
/api/admin/v1/strategy-screenings/run:
post:
operationId: requestStrategyScreening
summary: 请求立即自动筛选
description: 同源管理员请求,异步执行。运行中或已排队时复用现有请求,不另起 Worker。每批最多 20 只,固定范围最大 100 只;不自动发布候选。
security:
- adminCookie: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/EmptyObject"
responses:
"202":
description: 已排队或已有正在执行的任务
content: *a5
"401": *a4
"403": *a4
"422": *a4
"503": *a4
components:
securitySchemes:
adminCookie:
@@ -2219,7 +2304,7 @@ components:
code: *a2
name: *a2
description: *a2
expected_version: &a3
expected_version: &a6
type: integer
parameters:
type: object
@@ -2230,11 +2315,13 @@ components:
- slippage_bps
- lot_size
properties:
short_window: *a3
long_window: *a3
fee_bps: *a3
slippage_bps: *a3
lot_size: *a3
short_window: *a6
long_window: *a6
fee_bps: *a6
slippage_bps: *a6
lot_size: *a6
screening:
$ref: "#/components/schemas/ScreeningParameters"
StrategyDeployment:
type: object
required:
@@ -2248,7 +2335,7 @@ components:
enum:
- ACTIVE
- PAUSED
expected_version: *a3
expected_version: *a6
reason: *a2
HistoricalBar:
type: object
@@ -2318,3 +2405,51 @@ components:
code: *a2
message: *a2
request_id: *a2
ScreeningParameters:
type: object
additionalProperties: false
required:
- securities
- entry_band_bps
- stop_loss_bps
- target_bps
- valid_hours
properties:
securities:
type: array
minItems: 1
maxItems: 100
uniqueItems: true
items:
type: object
additionalProperties: false
required:
- symbol
- exchange
properties:
symbol:
type: string
pattern: ^[0-9]{6}$
exchange:
type: string
enum:
- SSE
- SZSE
entry_band_bps:
type: integer
minimum: 0
maximum: 1000
stop_loss_bps:
type: integer
minimum: 1
maximum: 5000
description: 必须大于 entry_band_bps
target_bps:
type: integer
minimum: 1
maximum: 10000
description: 必须大于 entry_band_bps
valid_hours:
type: integer
minimum: 1
maximum: 168