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
80e62fb9
Commit
80e62fb9
authored
Dec 22, 2020
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小数位
parent
92ca134f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
portfolio_diagnose.py
app/service/portfolio_diagnose.py
+9
-9
result_service_v2.py
app/service/result_service_v2.py
+7
-7
No files found.
app/service/portfolio_diagnose.py
View file @
80e62fb9
...
...
@@ -844,15 +844,15 @@ class PortfolioDiagnose(object):
"xlabels"
:
return_compare_df
[
"date"
]
.
values
}
# 指标对比
old_indicator
=
{
"group_name"
:
"现有持仓组合"
,
"return_ratio"
:
round
((
old_return
-
1
)
*
100
,
2
),
"return_ratio_year"
:
round
(
old_return_ratio_year
*
100
,
2
),
"volatility"
:
round
(
old_volatility
*
100
,
2
),
"max_drawdown"
:
round
(
old_max_drawdown
[
0
]
*
100
,
2
),
"sharpe"
:
round
(
old_sharpe
,
2
)}
index_indicator
=
{
"group_name"
:
"中证500"
,
"return_ratio"
:
round
(
index_return_ratio
*
100
,
2
),
"return_ratio_year"
:
round
(
index_return_ratio_year
*
100
,
2
),
"volatility"
:
round
(
index_volatility
*
100
,
2
),
"max_drawdown"
:
round
(
index_drawdown
[
0
]
*
100
,
2
),
"sharpe"
:
round
(
index_sharpe
,
2
)}
old_indicator
=
{
"group_name"
:
"现有持仓组合"
,
"return_ratio"
:
"
%.2
f"
%
round
((
old_return
-
1
)
*
100
,
2
),
"return_ratio_year"
:
"
%.2
f"
%
round
(
old_return_ratio_year
*
100
,
2
),
"volatility"
:
"
%.2
f"
%
round
(
old_volatility
*
100
,
2
),
"max_drawdown"
:
"
%.2
f"
%
round
(
old_max_drawdown
[
0
]
*
100
,
2
),
"sharpe"
:
"
%.2
f"
%
round
(
old_sharpe
,
2
)}
index_indicator
=
{
"group_name"
:
"中证500"
,
"return_ratio"
:
"
%.2
f"
%
round
(
index_return_ratio
*
100
,
2
),
"return_ratio_year"
:
"
%.2
f"
%
round
(
index_return_ratio_year
*
100
,
2
),
"volatility"
:
"
%.2
f"
%
round
(
index_volatility
*
100
,
2
),
"max_drawdown"
:
"
%.2
f"
%
round
(
index_drawdown
[
0
]
*
100
,
2
),
"sharpe"
:
"
%.2
f"
%
round
(
index_sharpe
,
2
)}
old_indicator_compare
=
[
old_indicator
,
index_indicator
]
return
ret
,
old_return_compare_result
,
old_indicator_compare
...
...
app/service/result_service_v2.py
View file @
80e62fb9
...
...
@@ -158,14 +158,14 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
folio_report_data
[
"group_nav_info"
]
=
result_fund_nav_info
folio_report_data
[
"group_hoding_info"
]
=
result_fund_hoding_info
folio_report_data
[
"group_hoding_info_total"
]
=
\
{
"total_cost"
:
"
.2f"
%
round
(
total_cost
/
10000.0
,
2
),
"cur_month_profit"
:
".2f"
%
round
(
cur_month_profit
/
10000.0
,
2
),
"cur_month_profit_ratio"
:
".2f"
%
round
(
cur_month_profit_ratio
*
100
,
2
),
"ending_assets"
:
".2f"
%
round
(
ending_assets
/
10000.0
,
2
),
{
"total_cost"
:
"
%.2
f"
%
round
(
float
(
total_cost
)
/
10000.0
,
2
),
"cur_month_profit"
:
"
%
.2
f"
%
round
(
cur_month_profit
/
10000.0
,
2
),
"cur_month_profit_ratio"
:
"
%
.2
f"
%
round
(
cur_month_profit_ratio
*
100
,
2
),
"ending_assets"
:
"
%
.2
f"
%
round
(
ending_assets
/
10000.0
,
2
),
"weight"
:
100
,
"cumulative_profit"
:
".2f"
%
round
(
cumulative_profit
/
10000.0
,
2
),
"cumulative_return"
:
".2f"
%
round
((
cumulative_return
-
1
)
*
100
,
2
),
"return_ratio_year"
:
".2f"
%
round
(
return_ratio_year
*
100
,
2
)}
"cumulative_profit"
:
"
%
.2
f"
%
round
(
cumulative_profit
/
10000.0
,
2
),
"cumulative_return"
:
"
%
.2
f"
%
round
((
cumulative_return
-
1
)
*
100
,
2
),
"return_ratio_year"
:
"
%
.2
f"
%
round
(
return_ratio_year
*
100
,
2
)}
# 对应指数数据
index_df
=
self
.
get_customer_index_nav_data
()
...
...
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