|
From: Matthew K. <mat...@gm...> - 2021-11-28 01:51:59
|
Every input into the Black-Scholes model is determined by the user in accordance with their own preferences and modeling. Even calculating the underlying price or time to expiration isn’t something that every quant finance user agrees on. If you want to fully replicate someone else’s inputs, you will need to gather 5 simultaneous examples of their option price, strike and IV combinations, then a solve for all of the unknown input variables to find out what they used for the underlying, time, risk free rate, borrow rate and dividends. I don’t advise this unless it’s extremely important to replicate Yahoo or OPRA. This is also assuming that Yahoo is indeed using Black-Scholes, and not a Tree or some other model as their base. (I don’t know what they use) As for good ways to determine a dividend yield: this is a complex question, and one that you can make good money for if you solve. Many companies pay six figures a year for a data feed to get decent dividend forecasts. A simple and easily scalable method is simply to take the past year’s worth of dividends, and calculate a yield using the assumption that the next year will be the same. But that is not especially accurate relative to what you can buy from data feed providers. Best, Matthew On Sat, Nov 27, 2021 at 11:12 AM Peng Yu <pen...@gm...> wrote: > Thanks. How to determine dividend_rate in practice? For example, the > dividends for the following stock have been changing. > > https://www.nasdaq.com/market-activity/stocks/sjm/dividend-history > > I see implied vol is computed for each option contract below. What > spot_price, risk_free_rate should be used to reproduce the implied vol > shown on Yahoo Finance? Could you show an example for the following > contract? Thanks. > > https://finance.yahoo.com/quote/SJM/options?p=SJM&date=1642723200 > > Contract Name Last Trade Date Strike Last Price Bid Ask > Change % > Change Volume Open Interest Implied Volatility > SJM220121C00130000 2021-11-24 9:59AM > EST 130.00 5.97 5.00 5.30 0.00 - 1 551 > 23.60% > > On 11/27/21, Jonathan Sweemer <sw...@gm...> wrote: > > Hi Peng, > > > > The usual way to back out implied vols from option prices is to use a > > solver. Since you are using python, scipy.optimize.brentq[1] would be a > > good choice. > > > > I've created a gist[2] on github that shows how to extend the example > code > > from the link you provided to calculate implied vols as well. > > > > When I run it on my computer I get the following result, which matches > the > > hardcoded number from the blog. > > > > $ python3 iv.py > > european npv: 6.749271812460607 > > american npv: 6.837765216321175 > > european iv: 0.20000000000000023 > > american iv: 0.19999999999999965 > > > > Note that you should be careful about how you deal with implied vols for > > American options, or any other style of option that is not European. This > > is because most people will assume you are talking about Black-Scholes > > implied vols, which requires the option to be European. Plus, in practice > > you will not want to price American options with flat rates, dividends, > or > > vols, as it is a path-dependent instrument. Nevertheless for the stylized > > example from the blog the approach I've mentioned here should give you > what > > you want. > > > > [1] > > > https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.brentq.html > > [2] https://gist.github.com/sweemer/7a0270655dc70d224d080b04fe11423e > > > > On Sat, Nov 27, 2021 at 2:05 PM Peng Yu <pen...@gm...> wrote: > > > >> Hi, > >> > >> I see the following example to compute prices for American Options. > >> > >> > >> > http://gouthamanbalaraman.com/blog/american-option-pricing-quantlib-python.html > >> > >> But it is not clear how to do the reverse. How to compute IV from > >> bid/ask prices of American options? > >> > >> Could anybody show me a complete example of how to do so with quantlib? > >> Thanks. > >> > >> -- > >> Regards, > >> Peng > >> > >> > >> _______________________________________________ > >> QuantLib-users mailing list > >> Qua...@li... > >> https://lists.sourceforge.net/lists/listinfo/quantlib-users > >> > > > > > -- > Regards, > Peng > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > -- Matthew P. Kolbe (312) 218-6595 mat...@gm... |