OPEN-SOURCE SCRIPT

American Approximation Bjerksund & Stensland 1993 [Loxx]

Actualizado
American Approximation Bjerksund & Stensland 1993 is an American Options pricing model. This indicator also includes numerical greeks. You can compare the output of the American Approximation to the Black-Scholes-Merton value on the output of the options panel.

The Bjerksund and Stensland (1993) approximation can be used to price American options on stocks, futures, and currencies. The method is analytical and extremely computer-efficient. Bjerksund and Stensland's approximation is based on an exercise strategy corresponding to a flat boundary / (trigger price). Numerical investigation indicates that the Bjerksund and Stensland model is somewhat more accurate for long-term options than the Barone-Adesi and Whaley model. (The Complete Guide to Option Pricing Formulas)

C = alpha * X^beta - alpha Ø(S, T, beta, I, I) + Ø(S, T, I, I, I) - Ø(S, T, I, X, I) - XØ(S, T, 0, I, I) + XØ(S, T, 0, X, I)

where

alpha = (1 - X) * I^-beta

beta = (1/2 - b/v^2) + ((b/v^2 - 1/2)^2 + 2*(r/v^2))^0.5


The function Ø(S, T, y, H, I) is given by

Ø(S, T, gamma, H, I) = e^lambda * S^gamma * (N(d) - (I/S)^k * N(d - (2 * log(I/S)) / v*T^0.5))

lambda = (-r + gamma * b + 1/2 * gamma(gamma - 1) * v^2) * T

d = (log(S/H) + (b + (gamma - 1/2) * v^2) * T) / (v * T^0.5)

k = 2*b/v^2 + (2 * gamma - 1)


and the trigger price I is defined as

I = B0 + (B(+infi) - B0) * (1 - e^h(T))

h(T) = -(b*T + 2*v*T^0.5) * (B0 / (B(+infi) - B0))

B(+infi) = (B / (B - 1)) * X

B0 = max(X, (r / (r - b)) * X)


If s > I, it is optimal to exercise the option immediately, and the value must be equal to the intrinsic value of S - X. On the other hand, if b > r, it will never be optimal to exercise the American call option before expiration, and the value can be found using the generalized BSM formula. The value of the American put is given by the Bjerksund and Stensland put-call transformation

P(S, X, T, r, b, v) = C(X, S, T, r -b, -b, v)

where C(*) is the value of the American call with risk-free rate r - b and drift -b. With the use of this transformation, it is not necessary to develop a separate formula for an American put option.

b=r options on non-dividend paying stock
b=r-q options on stock or index paying a dividend yield of q
b=0 options on futures
b=r-rf currency options (where rf is the rate in the second currency)

Inputs
S = Stock price.
K = Strike price of option.
T = Time to expiration in years.
r = Risk-free rate
c = Cost of Carry
V = Variance of the underlying asset price
cnd1(x) = Cumulative Normal Distribution
cbnd3(x) = Cumulative Bivariate Normal Distribution
nd(x) = Standard Normal Density Function
convertingToCCRate(r, cmp ) = Rate compounder

Numerical Greeks or Greeks by Finite Difference
Analytical Greeks are the standard approach to estimating Delta, Gamma etc... That is what we typically use when we can derive from closed form solutions. Normally, these are well-defined and available in text books. Previously, we relied on closed form solutions for the call or put formulae differentiated with respect to the Black Scholes parameters. When Greeks formulae are difficult to develop or tease out, we can alternatively employ numerical Greeks - sometimes referred to finite difference approximations. A key advantage of numerical Greeks relates to their estimation independent of deriving mathematical Greeks. This could be important when we examine American options where there may not technically exist an exact closed form solution that is straightforward to work with. (via VinegarHill FinanceLabs)

Things to know
  • Only works on the daily timeframe and for the current source price.
  • You can adjust the text size to fit the screen
Notas de prensa
Readded compounding
Notas de prensa
fixed error
americanapproximationbjerksundstenslandblackscholesblackscholesmertonblackscholesoptionpricinggreeksHistorical VolatilitynumericalgreeksoptionsVolatility

Script de código abierto

Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?


Public Telegram Group, t.me/algxtrading_public

VIP Membership Info: patreon.com/algxtrading/membership
También en:

Exención de responsabilidad