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
f835f1df
Commit
f835f1df
authored
Feb 18, 2021
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回退
parent
7ecdc557
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
folio_comment_service.py
app/service/folio_comment_service.py
+1
-1
week_evaluation.py
app/utils/week_evaluation.py
+6
-4
No files found.
app/service/folio_comment_service.py
View file @
f835f1df
...
...
@@ -83,5 +83,5 @@ def recalculation_fund_comment(args):
except
Exception
as
e
:
print
(
traceback
.
print_exc
())
return
False
print
(
json
.
dumps
(
dict_result
,
cls
=
npEncoder
,
ensure_ascii
=
False
))
#
print(json.dumps(dict_result, cls=npEncoder, ensure_ascii=False))
return
json
.
dumps
(
dict_result
,
cls
=
npEncoder
,
ensure_ascii
=
False
)
app/utils/week_evaluation.py
View file @
f835f1df
...
...
@@ -69,10 +69,12 @@ def volatility(simple_return, n):
:param n:数据类型, 周(52), 月(12), 日(250)
:return:
"""
new_s_r
=
simple_return
/
simple_return
.
shift
(
1
)
new_s_r
.
fillna
(
1
)
new_s_r
=
simple_return
.
apply
(
lambda
x
:
math
.
log
(
x
))
d
=
math
.
sqrt
(
len
(
simple_return
))
*
new_s_r
.
std
(
ddof
=
1
)
# new_s_r = simple_return / simple_return.shift(1)
# new_s_r.fillna(1)
# new_s_r = simple_return.apply(lambda x: math.log(x))
# d = math.sqrt(len(simple_return)) * new_s_r.std(ddof=1)
d
=
math
.
sqrt
(
n
)
*
simple_return
.
std
(
ddof
=
1
)
return
d
...
...
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