TradingView
SegaRKO
30 מאי 2020 21:37

Black-Scholes Model and Greeks for European Options 

Hang Seng IndexTVC

תיאור

The Black-Scholes model is a mathematical model used for pricing options. From this model you can derive the theoretical fair value of a European option (an option where you have to wait until expiry to exercise). Additionally, you can derive various risk parameters called Greeks. This indicator includes three types of data: Theoretical Option Price (blue), the Greeks (green), and implied volatility (red); their values are presented in that order.

1) Theoretical Option Price:
This first value gives only the theoretical fair value of an option with a given strike based on the Black-Scholes framework. Remember this is a model and does not reflect actual option prices, just the theoretical price based on the Black-Scholes model and its parameters and assumptions.

2)Greeks (all of the Greeks included in this indicator are listed below):

a)Delta is the rate of change of the theoretical option price [see number 1] with respect to the change in the underlying's price. This can also be used to approximate the probability of your option expiring in the money. For example, if you have an option with a delta of 0.62, then it has about a 62% chance of expiring in-the-money. This number runs from 0 to 1 for Calls, and 0 to -1 for Puts.

b)Gamma is the rate of change of delta with respect to the change in the underlying's price.

c)Theta, aka "time decay", is the rate of change in the theoretical option price with respect to the change in time. Theta tells you how much an option will lose its value day by day.

d)Vega is the rate of change in the theoretical option price with respect to change in implied volatility.

e)Rho is the rate of change in the theoretical option price with respect to change in the risk-free rate. Rho is rarely used because it is the parameter that options are least effected by, it is more useful for longer term options, like LEAPs.

f)Vanna is the sensitivity of delta to changes in implied volatility. Vanna is useful for checking the effectiveness of delta-hedged and vega-hedged portfolios.

g)Charm, aka "delta decay", is the instantaneous rate of change of delta over time. Charm is useful for monitoring delta-hedged positions.

h)Vomma measures the sensitivity of vega to changes in implied volatility.

i)Veta measures the rate of change in vega with respect to time.

j)Vera measures the rate of change of rho with respect to implied volatility.

k)Speed measures the rate of change in gamma with respect to changes in the underlying's price. Speed can be used when evaluating delta-hedged and gamma hedged portfolios.

l)Zomma measures the rate of change in gamma with respect to changes in implied volatility. Zomma can be used to evaluate the effectiveness of a gamma-hedged portfolio.

m)Color, aka "gamma decay", measures the rate of change of gamma over time. This can also be used to evaluate the effectiveness of a gamma-hedged portfolio.

n)Ultima measures the rate of change in vomma with respect to implied volatility.

o)Probability of Touch, is not a Greek, but a metric that I included, which tells you the probability of price touching your strike price before expiry.

3) Implied Volatility:
This is the market's forecast of future volatility. Implied volatility is directionless, it cannot be used to forecast future direction. All it tells you is the forecast for future volatility.

How to use this indicator:
1st. Input the strike price of your option. If you input a strike that is more than 3 standard deviations away from the current price, the model will return a value of n/a.
2nd. Input the current risk-free rate.(Including this is optional, because the risk-free rate is so small, you can just leave this number at zero.)
3rd. Input the time until expiry. You can enter this in terms of days, hours, and minutes.
4th.Input the chart time frame you are using in terms of minutes. For example if you're using the 1min time frame input 1, 4 hr time frame input 480, daily time frame input 1440, etc.
5th. Pick what type of option you want data for, Long Call or Long Put.
6th. Finally, pick which Greek you want displayed from the drop-down list.

*Remember the Option price presented, and the Greeks presented, are theoretical in nature, and not based upon actual option prices. Also, remember the Black-Scholes model is just a model based upon various parameters, it is not an actual representation of reality, only a theoretical one.

הערות שחרור

Now, a Binary Options Pricing model is included. This will only work for Binary Long Call Options. All of the Greeks for Long Binary Calls are available, except for rho and vera.

*Note, unlike vanilla european options, the delta of a binary option cannot be used to approximate the probability of the option expiring in-the-money. For binary options, if you want to approximate the probability of the binary option expiring in-the-money, use the price. The price of a binary option can be used to approximate its probability of expiring in-the-money.

In order to use the Black-Scholes Binary Option Pricing Model:

1st. Input the strike price of your option. If you input a strike that is more than 3 standard deviations away from the current price, the model will return a value of n/a.
2nd. Input the current risk-free rate.(Including this is optional, because the risk-free rate is so small, you can just leave this number at zero.)
3rd. Input the time until expiry. You can enter this in terms of days, hours, and minutes.
4th.Input the chart time frame you are using in terms of minutes. For example if you're using the 1min time frame input 1, 4 hr time frame input 480, daily time frame input 1440, etc.
5th. Pick binary from the "Style" drop down menu.
6th. Pick Long Call. The binary pricing model is only available for Long Calls, right now.
7th . Finally, pick which Greek you want displayed from the drop-down list. If you pick rho or vera they'll return a value of zero for the binary call options.


*BTW, something I forgot to mention in the original notes, as time goes on you will have to update the expiry, this model does not do that automatically. So for example, if you originally have an option with 30 days to expiry, tomorrow you would have to manually update that to 29 days, then the next day manually update the expiry to 28, and so on.
תגובות
TimVincent
Hello! Would you like to make this open source? I'm trying to use your updated open source one, but I have difficulties to match the same results when I compare them. And if you don't, then can we have a chat about it?
SegaRKO
@TimVincent, The reason for the different results is that this one was my first attempt and I did not yet know how to program the Gaussian Probability Function, so in it's place I used approximated values. The values given by this model would not be as accurate as the open source one. Besides the correct Gaussian Probability Function in the open source version, the code in both versions are the same.
TimVincent
@SegaRKO, Thank you so much for your reply, much appreciated! I noticed that the Probability of Touch looks in a certain way when I have 23 days to expiry in the old one. In the new one, I achieve kind of similar results, but I have to change to 37 days. Anything you know what could be the reason for this? I really enjoy the old approximated values to be honest. Cheers, Tim
SegaRKO
@TimVincent, Delta can be estimated as the probability of an option expiring in the money, but this is a very rough estimation, and is the method used in this version. Also, this version doesn't use a Gaussian Probability Function, but rough approximated values for the Delta. Probability of Touch is roughly estimated as 2*Delta. This version is using a bunch of rough estimations, while the newer version with the Gaussian Function is the more accurate and correct way of doing this. The use of approximated values in this version is the reason for the discrepancies and the reason why I released the newer version.
TimVincent
@SegaRKO, Okay, thank you so much once more! But I still have to admit that your rough estimations works really well on your old one. I see that you took off "timeframe in minutes" in the newer version, and I notice that when I take off 1440 minutes from that in the old one, the whole thing collapses. Which means it seems to be very important for the whole indicator. Sadly I'm not a coder so I'm unsure how to add that back into your open source-version. Any assistance how to add that into your new version would be highly appreciated. Thanks, Tim
עוד