Commit 104dabc4 authored by 赵杰's avatar 赵杰

月度收益率*100,数据库mysqldb,持仓表单位

parent a95d70ca
...@@ -26,7 +26,7 @@ config = yaml.load(open(CFG_FILEPATH, 'r'), Loader=yaml.FullLoader) ...@@ -26,7 +26,7 @@ config = yaml.load(open(CFG_FILEPATH, 'r'), Loader=yaml.FullLoader)
tamp_product_engine = create_engine( tamp_product_engine = create_engine(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'.format( 'mysql+mysqldb://{user}:{password}@{host}:{port}/{db}?charset={charset}'.format(
db=config[env]['MySQL']['tamp_product_db'], db=config[env]['MySQL']['tamp_product_db'],
host=config[env]['MySQL']['host'], host=config[env]['MySQL']['host'],
port=config[env]['MySQL']['port'], port=config[env]['MySQL']['port'],
...@@ -40,7 +40,7 @@ tamp_product_engine = create_engine( ...@@ -40,7 +40,7 @@ tamp_product_engine = create_engine(
pool_recycle=600 pool_recycle=600
) )
tamp_order_engine = create_engine( tamp_order_engine = create_engine(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'.format( 'mysql+mysqldb://{user}:{password}@{host}:{port}/{db}?charset={charset}'.format(
db=config[env]['MySQL']['tamp_order_db'], db=config[env]['MySQL']['tamp_order_db'],
host=config[env]['MySQL']['host'], host=config[env]['MySQL']['host'],
port=config[env]['MySQL']['port'], port=config[env]['MySQL']['port'],
...@@ -55,7 +55,7 @@ tamp_order_engine = create_engine( ...@@ -55,7 +55,7 @@ tamp_order_engine = create_engine(
) )
tamp_user_engine = create_engine( tamp_user_engine = create_engine(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'.format( 'mysql+mysqldb://{user}:{password}@{host}:{port}/{db}?charset={charset}'.format(
db=config[env]['MySQL']['tamp_user_db'], db=config[env]['MySQL']['tamp_user_db'],
host=config[env]['MySQL']['host'], host=config[env]['MySQL']['host'],
port=config[env]['MySQL']['port'], port=config[env]['MySQL']['port'],
...@@ -70,7 +70,7 @@ tamp_user_engine = create_engine( ...@@ -70,7 +70,7 @@ tamp_user_engine = create_engine(
) )
tamp_fund_engine = create_engine( tamp_fund_engine = create_engine(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'.format( 'mysql+mysqldb://{user}:{password}@{host}:{port}/{db}?charset={charset}'.format(
db=config[env]['MySQL']['tamp_fund_db'], db=config[env]['MySQL']['tamp_fund_db'],
host=config[env]['MySQL']['host'], host=config[env]['MySQL']['host'],
port=config[env]['MySQL']['port'], port=config[env]['MySQL']['port'],
......
...@@ -380,7 +380,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor): ...@@ -380,7 +380,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
last_month_cnav = float(last_month_cnav_serise.values[-1]) last_month_cnav = float(last_month_cnav_serise.values[-1])
fund_hoding_info["profit"] = round(float(row["confirm_share"]) * (fund_basic_info["cur_cnav"] - last_month_cnav)/10000, 2) fund_hoding_info["profit"] = round(float(row["confirm_share"]) * (fund_basic_info["cur_cnav"] - last_month_cnav)/10000, 2)
# 当月收益率 # 当月收益率
fund_hoding_info["month_return_ratio"] = round(fund_hoding_info["profit"] / fund_hoding_info["market_values"], 2) fund_hoding_info["month_return_ratio"] = round(fund_hoding_info["profit"] / fund_hoding_info["market_values"]*100, 2)
# 累积收益 # 累积收益
fund_hoding_info["cum_profit"] = round(float(row["confirm_share"]) * (fund_basic_info["cur_cnav"] - confirm_cnav) / 10000, 2) fund_hoding_info["cum_profit"] = round(float(row["confirm_share"]) * (fund_basic_info["cur_cnav"] - confirm_cnav) / 10000, 2)
# 累积收益率 # 累积收益率
......
...@@ -1567,14 +1567,14 @@ ...@@ -1567,14 +1567,14 @@
<th>基金简称</th> <th>基金简称</th>
<th>买入时间</th> <th>买入时间</th>
<th>存续年数</th> <th>存续年数</th>
<th>投资本金 (万)</th> <th>投资本金</th>
<th>当月收益 (万)</th> <th>当月收益</th>
<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>
{% for one in group_result["group_hoding_info"] %} {% for one in group_result["group_hoding_info"] %}
<tr> <tr>
...@@ -1582,26 +1582,26 @@ ...@@ -1582,26 +1582,26 @@
<td>{{one.fund_name}}</td> <td>{{one.fund_name}}</td>
<td>{{one.confirm_date}}</td> <td>{{one.confirm_date}}</td>
<td>{{one.hold_year}}</td> <td>{{one.hold_year}}</td>
<td>{{one.cost}}</td> <td>{{one.cost| round(precision=2)}}万</td>
<td>{{one.profit}}</td> <td>{{one.profit}}</td>
<td>{{one.month_return_ratio}}</td> <td>{{one.month_return_ratio}}%</td>
<td>{{one.market_values}}</td> <td>{{one.market_values}}</td>
<td>{{one.weight}}</td> <td>{{one.weight}}%</td>
<td>{{one.cum_profit}}</td> <td>{{one.cum_profit}}</td>
<td>{{one.cum_profit_ratio}}</td> <td>{{one.cum_profit_ratio}}%</td>
<td>{{one.return_ratio_year}}</td> <td>{{one.return_ratio_year}}%</td>
</tr> </tr>
{% endfor %} {% endfor %}
<tr class="gray"> <tr class="gray">
<td colspan="4">总计</td> <td colspan="4">总计</td>
<td>{{group_result["group_hoding_info_total"]["total_cost"]}}</td> <td>{{group_result["group_hoding_info_total"]["total_cost"]}}</td>
<td>{{group_result["group_hoding_info_total"]["cur_month_profit"]}}</td> <td>{{group_result["group_hoding_info_total"]["cur_month_profit"]}}</td>
<td>{{group_result["group_hoding_info_total"]["cur_month_profit_ratio"]}}</td> <td>{{group_result["group_hoding_info_total"]["cur_month_profit_ratio"]}}%</td>
<td>{{group_result["group_hoding_info_total"]["ending_assets"]}}</td> <td>{{group_result["group_hoding_info_total"]["ending_assets"]}}</td>
<td>100%</td> <td>100.00%</td>
<td>{{group_result["group_hoding_info_total"]["cumulative_profit"]}}</td> <td>{{group_result["group_hoding_info_total"]["cumulative_profit"]}}</td>
<td>{{group_result["group_hoding_info_total"]["cumulative_return"]}}</td> <td>{{group_result["group_hoding_info_total"]["cumulative_return"]}}</td>
<td>{{group_result["group_hoding_info_total"]["return_ratio_year"]}}</td> <td>{{group_result["group_hoding_info_total"]["return_ratio_year"]}}%</td>
</tr> </tr>
</table> </table>
</div> </div>
...@@ -2179,7 +2179,7 @@ ...@@ -2179,7 +2179,7 @@
<div class="financial_scene"> <div class="financial_scene">
<img src={{scene}} alt="" class="financial_scene_img"> <img src={{scene}} alt="" class="financial_scene_img">
<div class="financial_scene_text"> <div class="financial_scene_text">
我们挣的是⻆度和变化的钱⽽不是纠正市场错误的钱,市场永远是正确的,关键是在其正确被反复证明后的逆向⽽⾏,⼀定是避开它的正确被展开的过程。 我们挣的是⻆度和变化的钱而不是纠正市场错误的钱,市场永远是正确的,关键是在其正确被反复证明后的逆向而行,一定是避开它的正确被展开的过程。
</div> </div>
<div class="financial_scene_author"> <div class="financial_scene_author">
......
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