feat(selection): add Zhixing line indicators to selection chart and update related components
This commit is contained in:
@@ -147,7 +147,7 @@ class SelectionStockResponse(BaseModel):
|
||||
|
||||
|
||||
class SelectionChartPointResponse(BaseModel):
|
||||
"""One date-aligned qfq OHLCV and KDJ point."""
|
||||
"""One date-aligned qfq OHLCV, KDJ, and Zhixing-line point."""
|
||||
|
||||
trade_date: date
|
||||
open: float | None
|
||||
@@ -158,6 +158,8 @@ class SelectionChartPointResponse(BaseModel):
|
||||
k: float | None
|
||||
d: float | None
|
||||
j: float | None
|
||||
trend_white: float | None
|
||||
trend_yellow: float | None
|
||||
|
||||
|
||||
class SelectionChartResponse(BaseModel):
|
||||
@@ -268,7 +270,7 @@ def get_selection_chart(
|
||||
target_trade_date: date,
|
||||
service: Annotated[GetSelectionChart, Depends(get_selection_chart_service)],
|
||||
) -> SelectionChartResponse:
|
||||
"""Return one stock's bounded qfq OHLCV and KDJ history."""
|
||||
"""Return one stock's bounded qfq OHLCV, KDJ, and Zhixing-line history."""
|
||||
|
||||
try:
|
||||
chart = service.execute(ts_code, target_trade_date)
|
||||
@@ -482,6 +484,8 @@ def _chart_response(chart: SelectionChart) -> SelectionChartResponse:
|
||||
k=point.k,
|
||||
d=point.d,
|
||||
j=point.j,
|
||||
trend_white=point.trend_white,
|
||||
trend_yellow=point.trend_yellow,
|
||||
)
|
||||
for point in chart.points
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user