May-27-2020, 07:58 AM
(May-27-2020, 07:35 AM)buran Wrote: shouldn't you using historical volatility, not implied volatility?
Both volatilities can be use, depending on what the user is trying to achieve. In my case, I want to know what's the implied volatility (I guess you can say what market thinks volatility will be going forward) and corresponding Greeks (delta, theta, gamma etc) based on where the market is trading the options at. One can also chose to feed in the historical volatility to get the option price if they think historical volatility is a fair predictor of the value of the option, etc.
Quote:looking further at the source code. ifvolatility == 0
, theif volatility:
will be False and the rest of the block will not be executed and the greeks will be None. However if you look at internal methods like_delta()
,_delta2()
etc., some of them haveif self.volatility == 0 or self.daysToExpiration == 0
. So there is problem - there is special handling of case when volatility == 0, yet, it never get executed.
OK, if I understand it correctly, I should add error handling to capture for incorrect input. Is that right?