Added more volatility tests

This commit is contained in:
Gourav Kumar 2022-03-13 22:52:41 +05:30
parent 1758df0124
commit 2237692677

View File

@ -168,3 +168,12 @@ class TestVolatility:
assert round(sd, 6) == 0.023164
sd = ts.volatility(from_date="2017-10-01", to_date="2019-08-31", annualize_volatility=True)
assert round(sd, 6) == 0.050559
sd = ts.volatility(from_date="2017-02-01", frequency="M", return_period_unit="months")
assert round(sd, 6) == 0.050884
sd = ts.volatility(
frequency="M",
return_period_unit="months",
return_period_value=3,
annualize_volatility=False,
)
assert round(sd, 6) == 0.020547