Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification on volatility value/calculation #9

Open
mrcartier opened this issue Dec 24, 2018 · 0 comments
Open

Clarification on volatility value/calculation #9

mrcartier opened this issue Dec 24, 2018 · 0 comments

Comments

@mrcartier
Copy link

Great library. I have a question about how you would get the volatility value (20) in the below example

c = mibian.BS([1.4565, 1.45, 1, 30], volatility=20)

I'm currently using dataframe close prices like so

logreturn = np.log(df/df.shift(1))
volatility = np.sqrt(252*logreturn.var())

I've seen in your code the line below but just multiplying what I currently use by 100 still isn't very clean

self.volatility = float(volatility) / 100

Can you clarify how you would get 20 for volatility?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant