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
fcca9df3
Commit
fcca9df3
authored
Dec 22, 2020
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
默认收益和回撤评价
parent
80e62fb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
portfolio_diagnose.py
app/service/portfolio_diagnose.py
+11
-10
No files found.
app/service/portfolio_diagnose.py
View file @
fcca9df3
...
...
@@ -684,16 +684,17 @@ class PortfolioDiagnose(object):
total_profit
=
round
(
group_result
[
group_name
][
"cumulative_profit"
]
/
10000
,
2
)
# 整体表现 回撤能力
fund_rank_data
=
fund_rank
[
fund_rank
[
"fund_id"
]
.
isin
(
self
.
portfolio
)]
z_score
=
fund_rank_data
[
"z_score"
]
.
mean
()
drawdown_rank
=
group_result
[
group_name
][
"max_drawdown"
][
0
]
z_score
=
(
group_result
[
group_name
][
"cumulative_return"
]
-
1
)
*
100
drawdown_rank
=
group_result
[
group_name
][
"max_drawdown"
][
0
]
*
100
return_rank_df
=
fund_rank_data
[
"annual_return_rank"
]
z_score_level
=
np
.
select
([
z_score
>=
80
,
50
<=
z_score
<
80
,
z_score
<
50
],
[
0
,
1
,
2
])
.
item
()
drawdown_level
=
np
.
select
([
drawdown_rank
<=
0.05
,
0.05
<=
drawdown_rank
<
0.1
,
0.1
<=
drawdown_rank
<
0.15
,
drawdown_rank
>
0.15
],
[
0
,
1
,
2
,
3
])
.
item
()
z_score_level
=
np
.
select
([
z_score
>
20
,
15
<=
z_score
<
20
,
10
<=
z_score
<
15
,
z_score
<
10
],
[
0
,
1
,
2
,
3
])
.
item
()
drawdown_level
=
np
.
select
([
drawdown_rank
<=
5
,
5
<=
drawdown_rank
<
7
,
7
<=
drawdown_rank
<
10
,
drawdown_rank
>
10
],
[
0
,
1
,
2
,
3
])
.
item
()
# 收益稳健
fund_rank_re
=
fund_rank_data
[
fund_rank_data
[
"annual_return_rank"
]
>
0.8
]
return_rank_evaluate
=
""
...
...
@@ -748,7 +749,7 @@ class PortfolioDiagnose(object):
fund_corr_evaluate
=
";"
num_fund
=
len
(
self
.
portfolio
)
evaluate_enum
=
[[
"优秀"
,
"良好"
,
"一般"
],
evaluate_enum
=
[[
"优秀"
,
"良好"
,
"一般"
,
"较差"
],
[
"优秀"
,
"良好"
,
"合格"
,
"较差"
]]
if
data_adaptor
.
total_result_data
[
"cumulative_profit"
]
<
0
and
z_score_level
==
0
:
...
...
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