fix(HEL-356): preserve derived limit streaks
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -55,16 +55,24 @@ class DashboardMixin:
|
||||
if not limit_rows:
|
||||
limit_data_source = "derived"
|
||||
notices.append("涨跌停高级接口当日数据尚未更新,已使用日线数据推算。")
|
||||
limit_rows = self._derive_limits(trade_date, daily)
|
||||
limit_rows = self._derive_limits(
|
||||
trade_date,
|
||||
daily,
|
||||
previous_limit_rows=previous_limit_rows,
|
||||
)
|
||||
except TushareError as exc:
|
||||
limit_data_source = "derived"
|
||||
notices.append(f"涨跌停高级接口不可用,已使用日线数据推算:{exc}")
|
||||
limit_rows = self._derive_limits(trade_date, daily)
|
||||
previous_daily = self._load_daily(previous_trade_date)
|
||||
previous_limit_rows = [
|
||||
row for row in self._derive_limits(previous_trade_date, previous_daily)
|
||||
if row.get("limit_type") == "U"
|
||||
]
|
||||
limit_rows = self._derive_limits(
|
||||
trade_date,
|
||||
daily,
|
||||
previous_limit_rows=previous_limit_rows,
|
||||
)
|
||||
|
||||
up_rows = [row for row in limit_rows if row.get("limit_type") == "U"]
|
||||
down_rows = [row for row in limit_rows if row.get("limit_type") == "D"]
|
||||
|
||||
Reference in New Issue
Block a user