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
e36c4580
Commit
e36c4580
authored
Dec 03, 2020
by
李宗熹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新组合评价
parent
6c75e21f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
portfolio_diagnose.py
app/service/portfolio_diagnose.py
+25
-9
No files found.
app/service/portfolio_diagnose.py
View file @
e36c4580
...
...
@@ -732,9 +732,25 @@ class PortfolioDiagnose(object):
exc
=
excess_return
(
sim
,
BANK_RATE
,
n_freq
)
new_sharpe
=
sharpe_ratio
(
exc
,
sim
,
n_freq
)
return
suggestions_result
,
suggestions_result_asset
propose_fund_id_list_name
=
[]
# 基金名称,策略分级
sentence
=
"在保留{}的基础上,建议赎回{},并增配{}后,整体组合波动率大幅降低,最大回撤从{}降到不足{},年化收益率提升{}个点"
hold_fund
=
set
(
self
.
portfolio
)
-
set
(
self
.
abandon_fund_score
+
self
.
abandon_fund_corr
)
abandon_fund
=
(
self
.
abandon_fund_score
+
self
.
abandon_fund_corr
)
proposal_fund
=
self
.
proposal_fund
sentence
=
""
if
hold_fund
is
not
None
:
sentence
.
join
(
"在保留"
.
join
(
hold_fund
)
+
"的基础上,"
)
if
abandon_fund
is
not
None
:
sentence
.
join
(
"建议赎回"
.
join
(
abandon_fund
)
+
","
)
if
proposal_fund
is
not
None
:
sentence
.
join
(
"增配"
.
join
(
proposal_fund
)
+
"后,"
)
if
new_drawdown
<
old_max_drawdown
:
sentence
.
join
(
"整体组合波动率大幅降低,"
)
if
new_return_ratio_year
>
old_return_ratio_year
:
sentence
.
join
(
"年化收益率提升{}个点。"
.
format
(
round
(
new_return_ratio_year
-
old_return_ratio_year
,
1
)))
return
suggestions_result
,
suggestions_result_asset
,
sentence
def
single_evaluation
(
self
,
fund_id
):
"""
...
...
@@ -884,10 +900,10 @@ portfolio = ['HF00002JJ2', 'HF00005DBQ', 'HF0000681Q', 'HF00006693', 'HF00006AZF
portfolio_diagnose
=
PortfolioDiagnose
(
client_type
=
1
,
portfolio
=
portfolio
,
invest_amount
=
10000000
)
portfolio_diagnose
.
optimize
()
if
__name__
==
'__main__'
:
#
print(portfolio_diagnose.single_fund_radar())
#
print(portfolio_diagnose.propose_fund_radar())
#
print(portfolio_diagnose.old_portfolio_evaluation())
#
print('旧组合相关性:', portfolio_diagnose.old_correlation)
#
print('新组合相关性:', portfolio_diagnose.new_correlation)
print
(
portfolio_diagnose
.
single_fund_radar
())
print
(
portfolio_diagnose
.
propose_fund_radar
())
print
(
portfolio_diagnose
.
old_portfolio_evaluation
())
print
(
'旧组合相关性:'
,
portfolio_diagnose
.
old_correlation
)
print
(
'新组合相关性:'
,
portfolio_diagnose
.
new_correlation
)
print
(
'旧组合个基评价:'
,
portfolio_diagnose
.
old_portfolio_evaluation
())
print
(
'新组合个基评价:'
,
portfolio_diagnose
.
propose_fund_evaluation
())
\ No newline at end of file
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