Python Forum
Finance: Black Scholes Model not working
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finance: Black Scholes Model not working
#5
(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. if volatility == 0, the if 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 have if 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?
Reply


Messages In This Thread
Finance: Black Scholes Model not working - by pwt - May-27-2020, 05:27 AM
RE: Finance: Black Scholes Model not working - by pwt - May-27-2020, 07:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  model.fit and model.predict errors hatflyer 6 1,457 Nov-10-2023, 01:39 AM
Last Post: hatflyer
  Python help for yahoo finance! Zshanar 7 3,437 Jul-31-2022, 05:27 PM
Last Post: paulyan
  remove all color but red, then replace it with black kucingkembar 14 7,300 Dec-29-2021, 07:50 PM
Last Post: deanhystad
  FileNotFoundError: [Errno 2] No such file or directory: 'model/doc2vec.model/Articles Anldra12 10 5,937 Jun-11-2021, 04:48 PM
Last Post: snippsat
  Checkbuttons always come up as black boxes regardless of the state kenwatts275 5 4,813 Jul-07-2020, 08:00 PM
Last Post: kenwatts275
  How to use nb-black python cde formatter ErnestTBass 3 6,907 Jun-04-2020, 03:51 PM
Last Post: ErnestTBass
  after using openpyxl to add colors to script, black shows up white online in excel Soundtechscott 1 3,726 Jun-08-2019, 10:33 PM
Last Post: Soundtechscott
  Because the emoji appears black and white at the exit ? nerd 3 5,662 Jan-28-2019, 11:34 PM
Last Post: nerd
  Real time pricing Yahoo finance nathanz 1 2,574 Aug-09-2018, 01:02 PM
Last Post: metulburr
  Python interface only black and white........ Wilson 3 6,225 Jul-15-2017, 01:20 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020