新模版8

parent f1613008
......@@ -360,7 +360,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
fund_hoding_info["cum_profit_ratio"] = round((fund_basic_info["cur_cnav"] - confirm_cnav)/confirm_cnav*100, 2)
# 累积年化收益率
cur_resample_df = resample_df[[row["fund_id"]]].dropna()
return_ratio_year = annual_return(fund_hoding_info["cum_profit_ratio"]/100.0, resample_df, n_freq)
return_ratio_year = annual_return(fund_hoding_info["cum_profit_ratio"]/100.0, cur_resample_df, n_freq)
fund_hoding_info["return_ratio_year"] = float(return_ratio_year)
group_fund_hoding_info.append(fund_hoding_info)
return group_fund_basic_info, group_fund_hoding_info
......
......@@ -1504,87 +1504,22 @@
<th>累计收益率</th>
<th>年化收益率</th>
</tr>
{% for one in group_hoding_info %}
<tr>
<td rowspan="2">宏观策略</td>
<td>1.半夏宏观对冲</td>
<td class="text_red">0.40</td>
<td class="text_green">0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
</tr>
<tr>
<td>2.丹羿-锐进1号</td>
<td class="text_red">0.40</td>
<td class="text_green">0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
</tr>
</table>
</div>
<div style="position: relative;">
<div class="tss3_tag">
公募基金
<div class="tss3_tri"></div>
</div>
<table border="1" style="margin: 0;">
<tr>
<th colspan="5">投资本金</th>
<th colspan="4">10月业绩</th>
<th colspan="3">累计业绩</th>
</tr>
<tr>
<th>投资策略</th>
<th>基金简称</th>
<th>买入时间</th>
<th>存续年数</th>
<th>投资本金 (万元)</th>
<th>当月收益</th>
<th>当月收益率</th>
<th>月末市值 (万元)</th>
<th>月末占比</th>
<th>累计收益</th>
<th>累计收益率</th>
<th>年化收益率</th>
</tr>
<tr>
<td rowspan="2">宏观策略</td>
<td>1.半夏宏观对冲</td>
<td class="text_red">0.40</td>
<td class="text_green">0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
</tr>
<tr>
<td>2.丹羿-锐进1号</td>
<td class="text_red">0.40</td>
<td class="text_green">0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td>0.40</td>
<td rowspan="1">{{one.fund_strategy_name}}</td>
<td>{{one.fund_name}}</td>
<td class="text_red">{{one.confirm_date}}</td>
<td class="text_green">{{one.hold_year}}</td>
<td>{{one.cost}}</td>
<td>{{one.profit}}</td>
<td>{{one.month_return_ratio}}</td>
<td>{{one.market_values}}</td>
<td>{{one.weight}}</td>
<td>{{one.cum_profit}}</td>
<td>{{one.cum_profit_ratio}}</td>
<td>{{one.return_ratio_year}}</td>
</tr>
{% endfor %}
<tr class="gray">
<td colspan="4">总计</td>
<td class="text_red">0.40</td>
......
......@@ -3,7 +3,7 @@ import time
from jinja2 import PackageLoader, Environment
from app.service.portfolio_diagnose import portfolio_diagnose
from app.service.result_service import UserCustomerResultAdaptor
from app.service.result_service_v2 import UserCustomerResultAdaptor
import numpy as np
# 准备数据
......
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