123

parent 105ee636
...@@ -622,5 +622,8 @@ portfolio_diagnose = PortfolioDiagnose(client_type=1, portfolio=portfolio, inves ...@@ -622,5 +622,8 @@ portfolio_diagnose = PortfolioDiagnose(client_type=1, portfolio=portfolio, inves
portfolio_diagnose.optimize() portfolio_diagnose.optimize()
if __name__ == '__main__': if __name__ == '__main__':
# 相关性
print(portfolio_diagnose.old_correlation) print(portfolio_diagnose.old_correlation)
# 个基点评
# print(portfolio_diagnose.single_fund_radar())
# print(portfolio_diagnose.propose_fund_evaluation()) # print(portfolio_diagnose.propose_fund_evaluation())
...@@ -105,7 +105,7 @@ def draw_contribution_chart(xlabels, product_list, cumulative): ...@@ -105,7 +105,7 @@ def draw_contribution_chart(xlabels, product_list, cumulative):
fontsize = 22 fontsize = 22
# 初始化 # 初始化
fig = plt.figure(figsize=figsize) fig = plt.figure(figsize=figsize)
ax1 = fig.add_subplot(111) ax1 = fig.add_subplot()
ax2 = ax1.twiny() ax2 = ax1.twiny()
max_x_count = max([x['data'].size for x in product_list]) max_x_count = max([x['data'].size for x in product_list])
loc = np.arange(max_x_count) # the x locations for the groups loc = np.arange(max_x_count) # the x locations for the groups
...@@ -145,12 +145,12 @@ def draw_contribution_chart(xlabels, product_list, cumulative): ...@@ -145,12 +145,12 @@ def draw_contribution_chart(xlabels, product_list, cumulative):
ax2.plot(loc, cumulative['data'], color='#C6A774', marker='', linewidth=3, label=cumulative['name']) ax2.plot(loc, cumulative['data'], color='#C6A774', marker='', linewidth=3, label=cumulative['name'])
ax2.legend(loc='upper left', fontsize=fontsize) ax2.legend(loc='upper left', fontsize=fontsize)
# plt.show() plt.show()
imgdata = BytesIO() # imgdata = BytesIO()
fig.savefig(imgdata, format='png') # fig.savefig(imgdata, format='png')
imgdata.seek(0) # rewind the data # imgdata.seek(0) # rewind the data
month_return_img = 'data:image/png;base64,' + base64.b64encode(imgdata.getvalue()).decode('utf-8') # month_return_img = 'data:image/png;base64,' + base64.b64encode(imgdata.getvalue()).decode('utf-8')
return month_return_img # return month_return_img
def draw_comment_chart(xlabels, source_prod, target_prod): def draw_comment_chart(xlabels, source_prod, target_prod):
......
This diff is collapsed.
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