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
1969887c
Commit
1969887c
authored
Dec 02, 2020
by
李宗熹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'冲突'
parent
1cf3fd20
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
portfolio_diagnose.py
app/service/portfolio_diagnose.py
+3
-4
No files found.
app/service/portfolio_diagnose.py
View file @
1969887c
...
...
@@ -3,7 +3,6 @@ from app.utils.risk_parity import *
from
app.pypfopt
import
risk_models
from
app.pypfopt
import
expected_returns
from
app.pypfopt
import
EfficientFrontier
from
app.utils.week_evaluation
import
*
def
cal_correlation
(
prod
):
...
...
@@ -456,7 +455,7 @@ class PortfolioDiagnose(object):
# weights = ef.nonconvex_objective(deviation_risk_parity, ef.cov_matrix)
ef
.
efficient_return
(
0.3
)
clean_weights
=
ef
.
clean_weights
()
ef
.
portfolio_performance
(
verbose
=
True
)
#
ef.portfolio_performance(verbose=True)
self
.
new_weights
=
np
.
array
(
list
(
clean_weights
.
values
()))
print
(
clean_weights
)
end4
=
time
.
time
()
...
...
@@ -705,10 +704,10 @@ class PortfolioDiagnose(object):
else
:
evaluation
=
choose_bad_evaluation
(
data
)
ret
=
[]
ret
=
""
for
k
,
v
in
evaluation
.
items
():
# print(translate_single(content[k], v))
ret
.
append
(
sentence
[
k
]
%
translate_single
(
content
[
k
],
v
)
)
ret
=
ret
+
sentence
[
k
]
%
translate_single
(
content
[
k
],
v
)
fund_name
=
get_fund_name
(
fund_id
)
.
values
[
0
][
0
]
return
{
'name'
:
fund_name
,
'data'
:
ret
}
...
...
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