Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
fund_report
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭熊
fund_report
Commits
104dabc4
Commit
104dabc4
authored
Dec 18, 2020
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
月度收益率*100,数据库mysqldb,持仓表单位
parent
a95d70ca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
30 deletions
+30
-30
engine.py
app/api/engine.py
+4
-4
result_service_v2.py
app/service/result_service_v2.py
+1
-1
monthReportV2.1.html
app/templates/v2/monthReportV2.1.html
+25
-25
No files found.
app/api/engine.py
View file @
104dabc4
...
...
@@ -26,7 +26,7 @@ config = yaml.load(open(CFG_FILEPATH, 'r'), Loader=yaml.FullLoader)
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'
],
host
=
config
[
env
][
'MySQL'
][
'host'
],
port
=
config
[
env
][
'MySQL'
][
'port'
],
...
...
@@ -40,7 +40,7 @@ tamp_product_engine = create_engine(
pool_recycle
=
600
)
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'
],
host
=
config
[
env
][
'MySQL'
][
'host'
],
port
=
config
[
env
][
'MySQL'
][
'port'
],
...
...
@@ -55,7 +55,7 @@ tamp_order_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'
],
host
=
config
[
env
][
'MySQL'
][
'host'
],
port
=
config
[
env
][
'MySQL'
][
'port'
],
...
...
@@ -70,7 +70,7 @@ tamp_user_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'
],
host
=
config
[
env
][
'MySQL'
][
'host'
],
port
=
config
[
env
][
'MySQL'
][
'port'
],
...
...
app/service/result_service_v2.py
View file @
104dabc4
...
...
@@ -380,7 +380,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
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
[
"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
)
# 累积收益率
...
...
app/templates/v2/monthReportV2.1.html
View file @
104dabc4
...
...
@@ -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>
</tr>
{% for one in group_result["group_hoding_info"] %}
<tr>
...
...
@@ -1582,26 +1582,26 @@
<td>
{{one.fund_name}}
</td>
<td>
{{one.confirm_date}}
</td>
<td>
{{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>
<td>
{{one.cost
| round(precision=2)}}万
</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>
{{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_ratio"]}}
</td>
<td>
{{group_result["group_hoding_info_total"]["ending_assets"]}}
</td>
<td>
100%
</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"]["return_ratio_year"]}}
</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_ratio"]}}
%
</td>
<td>
{{group_result["group_hoding_info_total"]["ending_assets"]}}
万
</td>
<td>
100
.00
%
</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"]["return_ratio_year"]}}
%
</td>
</tr>
</table>
</div>
...
...
@@ -2179,7 +2179,7 @@
<div
class=
"financial_scene"
>
<img
src=
{{scene}}
alt=
""
class=
"financial_scene_img"
>
<div
class=
"financial_scene_text"
>
我们挣的是⻆度和变化的钱
⽽不是纠正市场错误的钱,市场永远是正确的,关键是在其正确被反复证明后的逆向⽽⾏,⼀
定是避开它的正确被展开的过程。
我们挣的是⻆度和变化的钱
而不是纠正市场错误的钱,市场永远是正确的,关键是在其正确被反复证明后的逆向而行,一
定是避开它的正确被展开的过程。
</div>
<div
class=
"financial_scene_author"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment