Black-Scholes in Python: Option Pricing Made Easy

Sdílet
Vložit
  • čas přidán 31. 05. 2024
  • Unlock the power of the Black-Scholes model with this easy-to-follow Python tutorial. Starting with importing essential libraries, we'll walk you through defining variables, calculating d1, d2, and deriving both call and put option prices. By 9:41, we deep dive into the intuition behind the Black-Scholes pricing formula. Perfect for finance enthusiasts looking to sharpen their Python skills and understand option pricing!
    💻 Free Code Here: ryanoconnellfinance.com/step-...
    🎓 Tutor With Me: 1-On-1 Video Call Sessions Available
    ► Join me for personalized finance tutoring tailored to your goals: ryanoconnellfinance.com/finance-tutoring/
    👨‍💼 My Freelance Financial Modeling Services:
    ► Custom financial modeling solutions tailored for your needs: ryanoconnellfinance.com/freelance-finance-services/
    📚 CFA Exam Prep Discount - AnalystPrep:
    ► Get 20% off CFA Level 1, 2, and 3 complete courses with promo code "RYAN20". Explore here: analystprep.com/shop/all-3-levels-of-the-cfa-exam-complete-course-by-analystprep/?ref=mgmymmr
    📘 FRM Exam Prep Discount - AnalystPrep:
    ► Get 20% off FRM Part 1 and Part 2 complete courses with promo code "RYAN20". Explore here: analystprep.com/shop/frm-part-1-and-part-2-com
    Chapters:
    0:00 - Import the Neccessary Libraries
    1:07 - Define the Variables
    3:11 - Calculate d1
    4:36 - Calculate d2
    4:50 - Calculate Call Option Price
    7:29 - Calculate Put Option Price
    9:41 - Making Sense of the Black Scholes Pricing Model
    Disclosure: This is not financial advice and should not be taken as such. The information contained in this video is an opinion. Some of the information could be wrong. This channel is owned and operated by Portfolio Constructs LLC. Some of the links above are affiliate links, meaning, at no additional cost to you, I will earn a commission if you click through and make a purchase.

Komentáře • 32

  • @RyanOConnellCFA
    @RyanOConnellCFA  Před 8 měsíci +2

    💻 Free Code Here: ryanoconnellfinance.com/step-by-step-guide-implementing-the-black-scholes-model-in-python/
    🎓 Tutor With Me: 1-On-1 Video Call Sessions Available
    ► Join me for personalized finance tutoring tailored to your goals: ryanoconnellfinance.com/finance-tutoring/

  • @wisemintapp
    @wisemintapp Před 8 měsíci +4

    Back in the 90s, I had a fellow classmate get a job at a top ten trading firm on the back of his excel sheet that priced options and had some innovative inputs.... skew etc....

    • @RyanOConnellCFA
      @RyanOConnellCFA  Před 8 měsíci

      Wow! That makes it sound like the standards were quite a bit lower back then. Although, if the inputs were truly innovative then it makes perfect sense

  • @ThinhNguyen-qe3jr
    @ThinhNguyen-qe3jr Před 5 měsíci +2

    Thank you so much for your video. It would be great if you launch any video about volatility calculation. Thanks again

    • @RyanOConnellCFA
      @RyanOConnellCFA  Před 5 měsíci

      Its my pleasure! I can look into creating a video on option volatility in the future

  • @deAraujoAndre
    @deAraujoAndre Před 8 měsíci +3

    Amazing!! Thank you very much 🙏

  • @tuongonglon9287
    @tuongonglon9287 Před 7 měsíci +2

    Thanks Ryan! I really enjoyed this video! I was looking for videos on CFA course content application in Python and I stumbled across yours! Looking forward to more videos from you!

    • @RyanOConnellCFA
      @RyanOConnellCFA  Před 7 měsíci

      Awesome, glad you stumbled across my channel! Out of curiosity, what phrase did you search that brought you here?

    • @tuongonglon9287
      @tuongonglon9287 Před 7 měsíci

      @@RyanOConnellCFA I searched "cfa python". But before that, I was watching popular CZcams videos dealing with Python fundamentals and I was unable to stay on track because the content was not relatable (I will be writing the CFA Level 2 exam soon). I searched "cfa python" on the search bar and I came across your channel! I'm so glad I did.
      I'm now your subscriber! 😄

  • @rohitvbatta3248
    @rohitvbatta3248 Před 3 měsíci +2

    are you able to use this formula to figure out what the call and put premium can be in the following 1 or 2 weeks as apposed to half a year ?

    • @RyanOConnellCFA
      @RyanOConnellCFA  Před 3 měsíci +1

      Absolutely! You would just change the time component of the variable

  • @blessedowo1958
    @blessedowo1958 Před 8 měsíci +1

    Thanks a lot bro :)

  • @zeljkolazic2542
    @zeljkolazic2542 Před 5 měsíci +3

    Does it work on only european style options or american options?

    • @RyanOConnellCFA
      @RyanOConnellCFA  Před 5 měsíci +1

      Hey there. Unfortunately, the Black-Scholes model assumes that options can only be exercised at expiration, which aligns with the characteristics of European options, but does not work for American options. The Binomial Option Pricing Model works for American Options which I have a video on here: czcams.com/video/AukJ1gDeErw/video.html

  • @victoricus1
    @victoricus1 Před 8 měsíci +2

    Ryan, hi! Thank you for defining Nd2, it makes it much easier to understand the whole concept! But could you please define Nd1 in realtion to the underlying price? Why would S be subject to any volatility, if it's a set price right at the start of the contract? Also, going back to your previous video, is binomial model more precise/more widely used in real life? BS model has a lot of crude assumptions. Or it depends on cost/benefit of using each particular approach (BSOP vs binomial)?

    • @RyanOConnellCFA
      @RyanOConnellCFA  Před 8 měsíci

      Hello! The expression N(d1) * S is related to the probability of outcomes that could occur for the underlying stock price based on the volatility of the stock. N(d1) is the hardest part of the Black Scholes model to define. If you Google what N(d1) is, you will see endless debates of people arguing over how to interpret it in forums lol. S (the underlying's stock price) is absolutely subject to volatility because there is a wide array of possible outcomes that that price could eventually become by the time the call expires. You need to think of it as the stock price when the option expires.

    • @RyanOConnellCFA
      @RyanOConnellCFA  Před 8 měsíci

      As for the question related to the Black Scholes model vs the binomial option pricing model, both models are widely used, but the context matters:
      For European options or situations requiring quick calculations, the Black-Scholes model might be preferred.
      For American options or when needing to account for dividends, changing interest rates, or other complexities, the binomial model might be more suitable.

    • @victoricus1
      @victoricus1 Před 8 měsíci +1

      @@RyanOConnellCFA well thank you, you were very quick to respond) appreciate your help, mister)

    • @victoricus1
      @victoricus1 Před 8 měsíci +1

      @@RyanOConnellCFA i guess, BSOP is like a wobbly sausage, it just jiggles, and you dont really know how it's gonna end up....

    • @RyanOConnellCFA
      @RyanOConnellCFA  Před 8 měsíci

      @@victoricus1 Hahah that is a great way to put it! 😂

  • @miguelteran-raful2718
    @miguelteran-raful2718 Před 3 měsíci +1

    Question am not smart. How can i use this if any when it comes to OPTIONS SELLING?

    • @RyanOConnellCFA
      @RyanOConnellCFA  Před 2 měsíci

      Hi @miguelteran-raful2718, great question! While the Black-Scholes model is more commonly used for pricing options rather than directly for options selling strategies, understanding how it works can still be valuable. It can help you better estimate option prices and grasp the key factors driving those prices, like time to expiration, underlying price, and implied volatility. This knowledge can inform your decisions around which options to sell, when, and at what price. But don't worry if some of the math is tricky - focus on the core concepts and how you can apply them practically in your options selling.

  • @cybrainx72
    @cybrainx72 Před 3 měsíci +1

    volatility is not standard deviation of stock prices .. it is the annualized standard deviation for stock price returns

    • @RyanOConnellCFA
      @RyanOConnellCFA  Před 3 měsíci

      Correct, my mistake if led anyone to believe otherwise

    • @cybrainx72
      @cybrainx72 Před 3 měsíci

      @@RyanOConnellCFA Mostly people are not looking for to learn about Volatility here.. its just my nitpick when you said "Vol standard deviation of ... stock prices"

    • @RyanOConnellCFA
      @RyanOConnellCFA  Před 3 měsíci

      @@cybrainx72 Sure thing, I meant to say standard deviation of returns. Good catch

    • @cybrainx72
      @cybrainx72 Před 3 měsíci

      @@RyanOConnellCFA Sorry to nitpick again.. again i think you got it wrong or incomplete. The keyword you are missing is "annualized".. for example if you get standard deviation of daily return.. you would need to multiply by sqrt(252) to get annualized volatility. Annualized volatility is the one used in Black Scholes

  • @vladimirschevschenko6226
    @vladimirschevschenko6226 Před 8 měsíci +2

    Which laptop do you use?

    • @RyanOConnellCFA
      @RyanOConnellCFA  Před 8 měsíci +2

      Hey! I actually use a desktop (not a laptop) that I built myself with custom components. This is best for me because as my needs change I can just swap out certain parts rather than buying a whole new computer