Commit c0cfc2ab authored by 赵杰's avatar 赵杰

修复策略名,1月1日没收益

parent 015b6122
...@@ -138,6 +138,9 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor): ...@@ -138,6 +138,9 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
cur_profit_ratio = return_ratio_df.loc[cur_year_date:, "cum_return_ratio"].values cur_profit_ratio = return_ratio_df.loc[cur_year_date:, "cum_return_ratio"].values
if len(last_profit_ratio) <= 0: if len(last_profit_ratio) <= 0:
cur_year_profit_ratio = cur_profit_ratio[-1] - 1 cur_year_profit_ratio = cur_profit_ratio[-1] - 1
else:
if len(cur_profit_ratio) < 1:
cur_year_profit_ratio = 0
else: else:
cur_year_profit_ratio = (cur_profit_ratio[-1] - last_profit_ratio[-1]) / last_profit_ratio[-1] cur_year_profit_ratio = (cur_profit_ratio[-1] - last_profit_ratio[-1]) / last_profit_ratio[-1]
folio_report_data["cur_year_profit_ratio"] = float(cur_year_profit_ratio) folio_report_data["cur_year_profit_ratio"] = float(cur_year_profit_ratio)
...@@ -301,6 +304,9 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor): ...@@ -301,6 +304,9 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
cur_profit_ratio = return_ratio_df.loc[cur_year_date:, "cum_return_ratio"].values cur_profit_ratio = return_ratio_df.loc[cur_year_date:, "cum_return_ratio"].values
if len(last_profit_ratio) <= 0: if len(last_profit_ratio) <= 0:
cur_year_profit_ratio = cur_profit_ratio[-1] - 1 cur_year_profit_ratio = cur_profit_ratio[-1] - 1
else:
if len(cur_profit_ratio) < 1:
cur_year_profit_ratio = 0.0
else: else:
cur_year_profit_ratio = (cur_profit_ratio[-1] - last_profit_ratio[-1]) / last_profit_ratio[-1] cur_year_profit_ratio = (cur_profit_ratio[-1] - last_profit_ratio[-1]) / last_profit_ratio[-1]
report_data["cur_year_profit_ratio"] = float(cur_year_profit_ratio) report_data["cur_year_profit_ratio"] = float(cur_year_profit_ratio)
...@@ -434,6 +440,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor): ...@@ -434,6 +440,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
# 基金持仓数据 # 基金持仓数据
total_market_values = p_sum_profit + p_total_amount # 月末总市值 total_market_values = p_sum_profit + p_total_amount # 月末总市值
fund_strategy_name = dict_substrategy[int(row["substrategy"])]
if "长富" in row["fund_name"] or "盈沛" in row["fund_name"]: if "长富" in row["fund_name"] or "盈沛" in row["fund_name"]:
fund_strategy_name = "FOF" fund_strategy_name = "FOF"
fund_hoding_info = {"fund_strategy_name": fund_strategy_name, "fund_name": row["fund_name"]} fund_hoding_info = {"fund_strategy_name": fund_strategy_name, "fund_name": row["fund_name"]}
......
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