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
5547bb25
Commit
5547bb25
authored
Jan 18, 2021
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基金指数对比图
parent
184b3a5d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
fund_service.py
app/service/fund_service.py
+11
-1
No files found.
app/service/fund_service.py
View file @
5547bb25
...
...
@@ -7,6 +7,7 @@
# @Software : PyCharm
# -----------------------------------------------------------------------------
from
app.service.portfolio_diagnose
import
*
from
app.utils.draw
import
draw_index_combination_chart
def
get_tamp_nav
(
fund
,
start_date
,
rollback
=
False
,
invest_type
=
2
):
...
...
@@ -172,7 +173,16 @@ def fund_index_compare(fund_id, invest_type=2, index_id='000905.SH'):
compare
=
pd
.
merge
(
index_daily
,
fund_nav
,
how
=
'inner'
,
left_index
=
True
,
right_index
=
True
)
compare
[
index_id
+
'_return_ratio'
]
=
(
compare
[
index_id
]
/
compare
[
index_id
]
.
iloc
[
0
]
-
1
)
*
100
compare
[
fund_id
+
'_return_ratio'
]
=
(
compare
[
fund_id
]
/
compare
[
fund_id
]
.
iloc
[
0
]
-
1
)
*
100
return
compare
xlabels
=
[
""
for
i
in
range
(
len
(
compare
))]
chart_data
=
{
"xlabels"
:
xlabels
,
"index"
:
{
'name'
:
'中证500'
,
'data'
:
compare
[
"index_return_ratio"
]
.
values
},
"fund"
:
{
'name'
:
fund_id
,
'data'
:
compare
[
fund_id
+
"_return_ratio"
]
.
values
},
}
r
=
draw_index_combination_chart
(
chart_data
)
return
r
def
get_fund_evaluation
(
args
):
...
...
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