SegaRKO

Black-Scholes Model for American Options

SegaRKO 已更新   
This model uses Black's Approximation to price American Options. Black's Approximation is an extension of the traditional Black-Scholes model that allows the price of American Options to be approximated within the Black-Scholes Framework. This is necessary because the traditional Black-Scholes model only works on options that are exercised at expiry, not before; like American Options can be.

Black's Approximation approximates the value of an American option by:

1st. Calculating the theoretical price of a european call or put based on the strike price (K), spot price (S), annual return (sigma), time until expiry (T), times until the next 2 ex-dividend dates (t1 & t2), and the dividend paid out at times t1 and t2 (D1 and D2).

2nd. The theoretical price of an option expiring on the second ex-dividend date (t2) is calculated. This replicates exercising the option early.

3rd. Finally, the highest price of the two theoretical prices calculated in steps 1 & 2 is chosen as the approximated price.

How to use this:

1st. Input your strike price.
2nd. Input the risk-free-rate of the currency the option is based in.
3rd. Input the dividend yield for the next ex-dividend date. For example AAPL's dividend yield is 0.82 and will be paid out on August 7,2020.
4th. Input the time until the next ex-dividend date. For example AAPL's next ex-dividend date is August 7,2020, which is 61 days away. So you'd input 61 (this includes weekends and holidays).
5th. Input the dividend yield for the ex-dividend date after the next one. For example AAPL's dividend yield after the next one is 0.82 and will be paid out on November 6, 2020.
6th. Input the time until the next furthest ex-dividend date. For example AAPL's next ex-dividend date after Aug 7th, is on November 6, 2020, which is 152 days away. So you'd input 152 (this includes weekends and holidays).
7th. Input your time until expiry. You can do so in terms of days, hours, and minutes.
8th. Input your chart time-frame in term of minutes. For example, if you're using the 1 min time-frame enter 1, 4hr time-frame enter 480, daily time-frame enter 1440.
9th. Lastly, pick what type of option you want data for: Long Call or Long Put.

*Disclaimer, because Black's Approximation is mostly geared towards stocks, this will only work for stocks. Also, the time variables: time until expiry and time until the ex-dividend dates; don't automatically update. So you will have to update them each day.
發布通知:
This new update utilizes an actual cumulative distribution function rather than the many if statements that the previous version used. This makes the code more succinct and accurate. Additionally, this update allows you to choose the currency that the option is denominated in from the drop down menu provided. Once chosen, the model will input the risk free rate of that currency for you. Lastly, in this update to make the model more accurate you need to input the implied volatility yourself.
發布通知:
Fixed error in cumulative and probability distribution functions. Also, fixed the calculation of pi.
發布通知:
Optimized pi calculation.
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?