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
828fe9bd
Commit
828fe9bd
authored
Mar 12, 2021
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
波动率,最大回撤
parent
7722f600
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
portfolio_diagnose.py
app/service/portfolio_diagnose.py
+4
-5
No files found.
app/service/portfolio_diagnose.py
View file @
828fe9bd
...
...
@@ -735,7 +735,7 @@ class PortfolioDiagnose(object):
self
.
proposal_fund
.
append
(
proposal
)
prod
=
prod
[(
prod
.
index
>=
self
.
start_date
)
&
(
prod
.
index
<=
self
.
end_date
)]
prod
=
resample
(
prod
,
get_trade_cal
(),
m
in
(
self
.
freq_list
))
prod
=
resample
(
prod
,
get_trade_cal
(),
m
ax
(
self
.
freq_list
))
if
'cal_date'
in
prod
.
columns
:
prod
.
drop
(
labels
=
'cal_date'
,
inplace
=
True
,
axis
=
1
)
if
'end_date'
in
prod
.
columns
:
...
...
@@ -1199,13 +1199,10 @@ class PortfolioDiagnose(object):
# 新组合累积收益
new_return_ratio
=
propose_fund_return_limit_data
[
"new_return"
]
.
values
[
-
1
]
# 新组合区间年化收益率
freq_max
=
group_order_df
[
"freq"
]
.
m
ax
()
freq_max
=
group_order_df
[
"freq"
]
.
m
in
()
n_freq
=
freq_days
(
int
(
freq_max
))
new_return_ratio_year
=
annual_return
(
propose_fund_return_limit_data
[
"new_return"
]
.
values
[
-
1
],
propose_fund_return_limit_data
,
n_freq
)
# 新组合波动率
new_volatility
=
volatility
(
propose_fund_return_limit_data
[
"new_return"
]
+
1
,
n_freq
)
# 新组合最大回撤
new_drawdown
=
max_drawdown
(
propose_fund_return_limit_data
[
"new_return"
]
+
1
)
...
...
@@ -1218,6 +1215,8 @@ class PortfolioDiagnose(object):
new_sharpe
=
0
except
:
new_sharpe
=
0
# 新组合波动率
new_volatility
=
volatility
(
sim
,
n_freq
)
# 指数收益
index_return
=
index_return
[
index_return
.
index
>=
group_order_start_date
]
...
...
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