Commit f835f1df authored by 赵杰's avatar 赵杰

回退

parent 7ecdc557
......@@ -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)
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment