完善知行短线

This commit is contained in:
2026-08-17 00:47:02 +08:00
parent 436a126e3b
commit 5029a22de1
12 changed files with 517 additions and 15 deletions

View File

@@ -402,3 +402,26 @@ class MarketOverviewResponse(BaseModel):
indexes: list[IndexQuoteOut] = []
stats: MarketStatsOut | None = None
errors: list[str] = [] # 部分来源失败的说明(透明但不阻塞展示)
# ---------- 筹码峰(个股详情) ----------
class ChipRowOut(BaseModel):
price: float # 已按 adjust 换算的价位
percent: float # 该价位筹码占比0~1全价位合计 ≈1
class ChipsResponse(BaseModel):
ts_code: str
trade_date: str | None = None # 筹码截面所在交易日YYYYMMDD
adjust: str # rows[].price 的复权口径 bfq/qfq/hfq
rows: list[ChipRowOut] = Field(default_factory=list)
his_low: float | None = None # 历史最低/最高价(换算后)
his_high: float | None = None
cost_5pct: float | None = None # 成本分位换算后5/95 即 90% 筹码成本区间
cost_15pct: float | None = None
cost_50pct: float | None = None
cost_85pct: float | None = None
cost_95pct: float | None = None
weight_avg: float | None = None # 平均成本(换算后)
winner_rate: float | None = None # 获利比例 %
error: str | None = None # 无数据时的提示2018 前无数据等)