Commit 4c1ceda0 authored by 赵杰's avatar 赵杰

suggest

parent 245cf95b
......@@ -1125,7 +1125,7 @@ class PortfolioDiagnose(object):
propose_fund_asset = [round(self.new_weights[i] * total_asset, 2) for i in range(len(propose_fund_id_name_list))]
propose_info = {propose_fund_id_strategy_name_list[i]:
propose_info = {propose_fund_id_list[i]:
{"fund_name": propose_fund_id_name_list[i],
"substrategy": propose_fund_id_strategy_name_list[i],
"asset": propose_fund_asset[i],
......@@ -1155,19 +1155,19 @@ class PortfolioDiagnose(object):
for key, value in propose_info.items():
if value["fund_name"] not in old_hold_fund_name_list:
suggestions = {}
if key not in suggestions_result.keys():
suggestions_result[key] = {}
if value["substrategy"] not in suggestions_result.keys():
suggestions_result[value["substrategy"]] = {}
suggestions["fund_strategy_name"] = value["substrategy"]
suggestions["fund_name"] = value["fund_name"]
suggestions["before_optimization"] = 0
suggestions["after_optimization"] = value["asset"]
suggestions["fund_id"] = value["fund_id"]
suggestions["fund_type"] = value["fund_type"]
suggestions_result[key][suggestions["fund_name"]] = suggestions
suggestions_result[value["substrategy"]][suggestions["fund_name"]] = suggestions
else:
if default > 0:
continue
suggestions_result[key][value["fund_name"]]["after_optimization"] = value["asset"]
suggestions_result[value["substrategy"]][value["fund_name"]]["after_optimization"] = value["asset"]
for key, value in suggestions_result.items():
suggestions_result[key] = list(value.values())
......
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