Commit 7ebc83ed authored by 赵杰's avatar 赵杰

月度回报表格数据模板联调2

parent ca9d8dbf
......@@ -296,7 +296,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
now_year = datetime.datetime.now().year
month_return_data_dict = {}
for i in range(now_year-start_year+1):
month_return_data_dict[start_year+i] = {j+1: {"profit": 0, "net_amount": 0} for j in range(12)}
month_return_data_dict[start_year+i] = {j+1: {"profit": 0, "net_amount": 0} for j in range(13)}
for d_index, d_row in month_sum.items():
cur_year = int(d_index[:4])
cur_month = int(d_index[5:])
......
......@@ -1123,97 +1123,99 @@
累计/月均
</th>
</tr>
{%for key, value in monthly_table_return.items() %}
<tr class="yellow">
<td rowspan="2" class="gray">
2020
{{key}}
</td>
<td>
盈亏
</td>
<td class="text_red">
4.34
{{value[1]["profit"]}}
</td>
<td class="text_green">
4.34
{{value[2]["profit"]}}
</td>
<td>
4.34
{{value[3]["profit"]}}
</td>
<td>
4.34
{{value[4]["profit"]}}
</td>
<td>
4.34
{{value[5]["profit"]}}
</td>
<td>
4.34
{{value[6]["profit"]}}
</td>
<td>
4.34
{{value[7]["profit"]}}
</td>
<td>
4.34
{{value[8]["profit"]}}
</td>
<td>
4.34
{{value[9]["profit"]}}
</td>
<td>
4.34
{{value[10]["profit"]}}
</td>
<td>
4.34
{{value[11]["profit"]}}
</td>
<td>
4.34
{{value[12]["profit"]}}
</td>
<td>
4.34
{{value[13]["profit"]}}
</td>
</tr>
<tr>
<td>
期末资产
</td>
<td>
4.34
<td class="text_red">
{{value[1]["net_amount"]}}
</td>
<td>
4.34
<td class="text_green">
{{value[2]["net_amount"]}}
</td>
<td>
4.34
{{value[3]["net_amount"]}}
</td>
<td>
4.34
{{value[4]["net_amount"]}}
</td>
<td>
4.34
{{value[5]["net_amount"]}}
</td>
<td>
4.34
{{value[6]["net_amount"]}}
</td>
<td>
4.34
{{value[7]["net_amount"]}}
</td>
<td>
4.34
{{value[8]["net_amount"]}}
</td>
<td>
4.34
{{value[9]["net_amount"]}}
</td>
<td>
4.34
{{value[10]["net_amount"]}}
</td>
<td>
4.34
{{value[11]["net_amount"]}}
</td>
<td>
4.34
{{value[12]["net_amount"]}}
</td>
<td>
4.34
{{value[13]["net_amount"]}}
</td>
</tr>
{%endfor%}
</table>
</div>
......
......@@ -24,6 +24,8 @@ class DataIntegrate:
self.get_summarize()
# 月度回报
self.get_month_return()
# 月度回报表格
self.get_month_table_return()
# 旧持仓组合点评
self.comments_on_position_portfolio()
# 贡献分解
......@@ -59,6 +61,9 @@ class DataIntegrate:
xlabels, product_list, cumulative = self.user_customer.get_month_return_chart()
self.monthly_return_performance_pic = draw_month_return_chart(xlabels, product_list, cumulative)
def get_month_table_return(self):
self.monthly_table_return = self.df["month_return_data_dict"]
def comments_on_position_portfolio(self):
"""旧持仓组合点评."""
self.old_evaluation = portfolio_diagnose.old_evaluation('default', self.d, self.user_customer)
......@@ -183,6 +188,7 @@ class DataIntegrate:
'volatility': self.index_volatility, 'max_withdrawal': self.index_max_withdrawal,
'sharpe_ratio': self.index_sharpe_ratio},
'monthly_return_performance_pic': self.monthly_return_performance_pic,
'monthly_table_return': self.monthly_table_return,
'group_nav_info': self.group_nav_info,
'group_hoding_info': self.group_hoding_info,
'old_evaluation': self.old_evaluation,
......
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