Тёмный

Binomial Option Pricing Model || Theory & Implementation in Python 

Подписаться
Просмотров 29 тыс.
% 649

Today I will introduce the Theory of the Binomial Asset Pricing Model and show how you can implement the binomial tree model to price a European call option in Python. The theory section of this video is long (sorry) and aims at giving you the absolute basics for understanding why and how to derive the discounted expectation of future payoffs under risk-neutral probabilities given the Binomial Model.
For those who just want to code, please skip ahead to the Python Implementation section. I will take you through two implementations of a simple binomial tree model in Python, one that will use ‘for loops’ to step through each node at each time step (a function I have defined as binomial tree slow), and the other (binomial tree fast) will vectorize these steps using numpy arrays, improving overall computation time as N time steps increase. Although not necessary for the example today, using numpy arrays and vectorizing our calculations will improve computations as we delve deeper into financial mathematics and implementation heading forward.
In this tutorial series we will be breaking down the theory described and published in Steven Shreve’s book’s Stochastic Calculus for Finance I & II. As a guide for implementing these concepts in Python, we will refer to the numerical methods and practices outlined in Les Clewlow & Chris Strickland’s book Implementing Derivatives Models.
00:00 Intro
00:50 Theory || What is Arbitrage? - Type I & II
04:20 Theory || No Arbitrage Pricing - The Law of One Price
05:47 Theory || One-period Binomial Model
11:00 Theory || Deriving the discounted expectation of future payoffs under risk-neutral probabilities
20:10 Theory || No Arbitrage Conditions
24:10 Theory || Multi-period Binomial Model
29:50 Python Implementation || Binomial Tree Slow
41:12 Python Implementation || Binomial Tree Fast
46:55 Python Implementation || Comparing the Slow vs Fast Implementation
★ ★ Code Available on GitHub ★ ★
GitHub: github.com/TheQuantPy
Specific Tutorial Link: github.com/TheQuantPy/youtube-tutorials/blob/8e64e19629cee840928b51baf4660e5c777e87e7/2021/003%20Jul-Sep/2021-07-06%20Binomial%20Option%20Pricing%20Model%20_%20Theory%20_%20Implementation%20in%20Python.ipynb
★ ★ QuantPy GitHub ★ ★
Collection of resources used on QuantPy RU-vid channel. github.com/thequantpy
★ ★ Discord Community ★ ★
Join a small niche community of like-minded quants on discord. discord.com/invite/aY2Af4CxHP
★ ★ Support our Patreon Community ★ ★
Get access to Jupyter Notebooks that can run in the browser without downloading python.
www.patreon.com/quantpy
★ ★ ThetaData API ★ ★
ThetaData's API provides both realtime and historical options data for end-of-day, and intraday trades and quotes. Use coupon 'QPY1' to receive 20% off on your first month.
www.thetadata.net/
★ ★ Online Quant Tutorials ★ ★
WEBSITE: quantpy.com.au
★ ★ Contact Us ★ ★
EMAIL: pythonforquants@gmail.com
Disclaimer: All ideas, opinions, recommendations and/or forecasts, expressed or implied in this content, are for informational and educational purposes only and should not be construed as financial product advice or an inducement or instruction to invest, trade, and/or speculate in the markets. Any action or refraining from action; investments, trades, and/or speculations made in light of the ideas, opinions, and/or forecasts, expressed or implied in this content, are committed at your own risk an consequence, financial or otherwise. As an affiliate of ThetaData, QuantPy Pty Ltd is compensated for any purchases made through the link provided in this description.

Опубликовано:

 

6 июл 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 29   
@nielsenhari
@nielsenhari 3 года назад
Thank you so much I get it now. You explained everything in 30min very clear, and there is our teacher taking weeks and I got nothing. Good job!!!
@frederikwoite3916
@frederikwoite3916 2 года назад
You are beyond skilled in both teaching and QF!
@mphikelelimbongiseni6277
@mphikelelimbongiseni6277 2 месяца назад
Useful amongst many, Thank you👏
@homodeus-k9f
@homodeus-k9f Год назад
Hey I think it's great work here and now that I've started my financial engineering masters I can finally understand this. Just one thing tho - in the risk-neutral probabilities coding part, I think it should be u = np.exp(sigma * np.sqrt(T / N)), d = 1 / u, qu = (R - d) / (u - d)... I think there was a mixup somewhere
@gatsbyliu1084
@gatsbyliu1084 Год назад
I am on my way study financial engineering master too :), so good to see another person in manadarin name
@georgekollias3442
@georgekollias3442 8 месяцев назад
great video, simplicity at its best :)
@daves1413
@daves1413 Год назад
In 15:36 you say "bank account (Su-Sd)". I think it should be "stock units" not "bank account units" for your beta, no?
@topticktom
@topticktom 8 месяцев назад
Didn"t understand any of it, but I did enjoy the 49 minutes anyways
@chykeinvesting9429
@chykeinvesting9429 2 года назад
hey this was so great, I actually am using this to help me secure a quant position at a trading desk... I am just confused on one part, can i schedule a one on one?
@benardkiplimo3508
@benardkiplimo3508 10 месяцев назад
Did you get the job?
@chykeinvesting9429
@chykeinvesting9429 10 месяцев назад
@@benardkiplimo3508 nah, I wasn’t advanced enlugh
@benardkiplimo3508
@benardkiplimo3508 10 месяцев назад
Well done! Thank you for the video
@aniruddhvasishta8334
@aniruddhvasishta8334 Год назад
At 32:49 -- won't you get a recombining tree even if ud is not 1 since if the stock price goes up then down the price will be udS_0 whereas if it goes down then up you'll get duS_0 which are the same thing? In these cases it's just not true that S_2 = S_0 but I don't see why that's an issue.
@teroliikala
@teroliikala 2 года назад
Brilliant channel. Keep it up!
@KazekageKidd
@KazekageKidd 3 года назад
Fantastic lesson mate., really like this approach.
@samuraijgt
@samuraijgt 3 месяца назад
Why does the bank account not decrease in value when going to the down state
@PJokerLP
@PJokerLP Год назад
Hey, thanks for your video. But shouldn't type 2 arbitrage (3:36) be defined as P(V_T>=V_0) = 1, since your definition allows for losing money by having V_0 > 0. Greetings and stay healthy Marcel
@joshuakendrick3528
@joshuakendrick3528 4 месяца назад
How does the coding change for American options?
@Picklpickls
@Picklpickls 2 года назад
It is an amazing video!
@jayjayf9699
@jayjayf9699 3 месяца назад
If you have a 4 step time tree the number of nodes does not equal N+1
@gutefrage9425
@gutefrage9425 2 года назад
I understand it but what is it good for? How to apply it?
@wqw9475
@wqw9475 2 года назад
Hi very nice video but I think you have forgotten to take the max between the expectation and the payoff for each node.
@jonathonemerick2084
@jonathonemerick2084 2 года назад
That’s the pricing formula for American style options not European style
@wqw9475
@wqw9475 2 года назад
@@jonathonemerick2084 For European you never need to take the max. I mean exactly for the US kind the author forgot to take the max for each node.
@QuantPy
@QuantPy 2 года назад
This video was for European pricing only. No max required for each node? Please check another video for American style option pricing ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-K2Iy8bCmXjk.html
@wqw9475
@wqw9475 2 года назад
@@jonathonemerick2084 ok I got it because that's for European pricing. I thought it's for American kind. Thanks for your response.
@wqw9475
@wqw9475 2 года назад
@@QuantPy Yes I get it now since I was working on American side so I thought this example too. Thanks for the response.
@annog6673
@annog6673 2 года назад
You flipped the meaning of alpha and beta right on the middle and got a little bit confused there, didn't you? Or is there a meaning behind using beta for the weighting of stock and calling it bank account weighting?
@QuantPy
@QuantPy 2 года назад
The alpha and beta terms are just constants. In the video I've assigned Beta as the number of Shares and Alpha as the number of bank account units. Feel free to use your own constants and go through the math 👍