2

ThinkOrSwim, IBKR, and others reports the implied-volatility (IV) for a given expiration. If I know the current underlying price and IV for that expiration, can I compute a rough estimate of the call or put premium at a given OTM strike (say 0.15 to 0.4 delta) options? I think the black-scholes formula will give me that, but does anyone know of a Java library or script for computing it?

1

2 Answers 2

1

IV is not constant for a given expiration but you will have a smile. If you have all IVs for all available strikes, you can get an exact theoretical value because the iV itself was computed from that price.

Now in terms of delta, it will be unlikely that any given quoted strike will correspond exactly to the desired delta. However, since you have all IV values, you can compute the vol surface using techniques like SVI. Below is a Python example:

spot = 1.34
forward = 1.35
t = 30 / 365.0
vols = np.array([ 12, 10, 9.5, 9, 10.5, 8, 10.24, 9.6, 11.2, 9.4, 11.9, 9.7, 20, 23,  27]) / 100
strikes = np.array([1.21, 1.3, 1.4, 1.3, 1.3, 1.32, 1.38, 1.3,
                    1.4, 1.3, 1.45, 1.25, 1.5 , 1.6,  1.8])
total_implied_variance = t * vols ** 2

def svi(k, param):
    a = param[0];
    b = param[1];
    m = param[2];
    rho = param[3];
    sigma = param[4];

    totalvariance = a + b * (rho * (k - m) + np.sqrt((k - m)** 2 + sigma**2));
    return totalvariance



def targetfunction(x):
    value=0
    for i in range(11):
        model_total_implied_variance = svi(np.log(strikes[i] / forward), x);
        value =value+(total_implied_variance[i]  - model_total_implied_variance) ** 2;
    return value**0.5

bound = [(1e-5, max(total_implied_variance)),(1e-3, 0.99),(min(strikes), max(strikes)),(-0.99, 0.99),(1e-3, 0.99)]
result = optimize.minimize(targetfunction, bound, tol=1e-8, method="BFGS")
x=result.x

K = np.linspace(-0.4, 0.4, 60)

newVols = [np.sqrt(svi(logmoneyness, x)/t) for logmoneyness in K]
plt.plot(np.log(strikes / forward), vols, marker='o', linestyle='none', label='market')
plt.plot(K, newVols, label='SVI')
plt.title("vol curve")

plt.grid()
plt.legend()
plt.show()

enter image description here

SABR is another possibility but it is more frequently used in fixed income. The calibration would involve fitting beta, alpha, rho and nu so that it resembles the shape of IV in the market. You can see details and the below illustration here.

enter image description here

Now you have a vol surface that you can use for any strike. Delta will depend on the market convention. Table 3 shows the math needed to get Delta neutral strikes in FX markets. P.a. stands for premium adjusted which is also explained in the paper.

ATM DNS

It is a very good paper to read. To get strike for a premium adjusted Delta requires a root solver. If your delta is not premium adjusted you can use a closed form solution to solve for strike. Once you have your strike, you can fetch the IV from your vol surface

K = 1.4
np.sqrt(svi(np.log(K/spot), x)/t)

plug it into the Black Scholes formula and you are done.

from scipy.stats import norm

def BlackScholesCall(S,K,r,d,t, sigma):
    # get variables for formula
    d1 = ((np.log(S/K) + (r - d + 0.5 * sigma **2) * t) / (sigma * np.sqrt (t)))
    d2 = d1 - sigma * np.sqrt(t) 
    # get BSM call & put values
    c = S * norm.cdf(d1) - K * exp(-r*t)  * norm.cdf(d2)
    # get Greeks
    return "Call price {}".format(c)

enter image description here

For simple requests like this, you do not need libraries because you can write it yourself with a few lines of code. Where libraries become useful is if you use this with actual market data, feed it into your tool to derive a vol surface and compute all sorts of details with it on a large scale. A wonderful tool is quantlib which is available in java as well.

2

I'm not sure why you would want to do such a calculation because if the option trades, the premium is available from the market. Be that as it may, yes, you can use Black Scholes to generate a rough theoretical estimate of of any option's premium if you know the IV for that expiration. However it will be rough because it won't account for variations like wide B/A spreads or volatility smile/smirk, etc.

I use IBKR's delta and IV numbers and at times, they are not that reliable, particularly for options expiring in a day or two. I don't need precision but sometimes their numbers are just whacked out or not updating in a timely fashion.

Sorry, can't help you with a Java script.

1
  • Simply as a short-cut. To pull the IV for a given expiration is a single query with IB's API. To pull the bid and ask is two queries multiplied by how many strikes you want. I've done that, it's just slower. I'm interested in using this as a screener, most likely run after the market is closed to identify trade candidates and potential trades for the next day. Tweaking will be needed of course, but I'm looking to calculate quick break-evens for mostly long-stock + short option trades expiring approximately 13 to 50 days out. Nov 5, 2020 at 0:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .