Commit c5a086a7 authored by 吕先亚's avatar 吕先亚

refactor(reports/web): 优化数据处理和接口逻辑

-将 funds_dict.keys() 转换为 list,确保兼容性- 修改 recommend 接口调用,使用 get_today_rec() 替代 get_last_signal()
parent 0339af79
......@@ -30,7 +30,7 @@ class FundSelectionProcessReportor(RoboReportor):
day = prev_workday(filter_weekend(max_date))
funds = self._datum.get_datums(type=DatumType.FUND)
funds_dict = {fund['id']: fund['chineseName'] for fund in funds}
fund_ids = funds_dict.keys()
fund_ids = list(funds_dict.keys())
pct_change = pd.DataFrame(self._optimize.get_pct_change(fund_ids, day))
pct_change.set_index('date', inplace=True)
pct_change = pct_change.truncate(before=(day - relativedelta(
......
......@@ -84,7 +84,7 @@ def load_report(max_date=None, min_date=None, combo: RoboReportor = None):
@app.get("/franklin/recommend")
async def recommend():
sig = get_last_signal()
sig = get_today_rec()
if sig:
if not fund_infos:
get_fund_infos()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment