loxx

Reset Strike Options-Type 1 [Loxx]

loxx Actualizado   
In a reset call (put) option, the strike is reset to the asset price at a predetermined future time, if the asset price is below (above) the initial strike price. This makes the strike path-dependent. The payoff for a call at maturity is equal to max((S-X)/X, 0) where is equal to the original strike X if not reset, and equal to the reset strike if reset. Similarly, for a put, the payoff is max((X-S)/X, 0) Gray and Whaley (1997) x have derived a closed-form solution for such an option. For a call, we have

c = e^(b-r)(T2-T1) * N(-a2) * N(z1) * e^(-rt1) - e^(-rT2) * N(-a2)*N(z2) - e^(-rT2) * M(a2, y2; p) + (S/X) * e^(b-r)T2 * M(a1, y1; p)

and for a put,

p = e^(-rT2) * N(a2) * N(-z2) - e^(b-r)(T2-T1) * N(a2) * N(-z1) * e^(-rT1) + e^(-rT2) * M(-a2, -y2; p) - (S/X) * e^(b-r)T2 * M(-a1, -y1; p)

where b is the cost-of-carry of the underlying asset, a is the volatil- ity of the relative price changes in the asset, and r is the risk-free interest rate. X is the strike price of the option, r the time to reset (in years), and T is its time to expiration. N(x) and M(a, b; p) are, respec- tively, the univariate and bivariate cumulative normal distribution functions. The remaining parameters are p = (T1/T2)^0.5 and

a1 = (log(S/X) + (b+v^2/2)T1) / vT1^0.5 ... a2 = a1 - vT1^0.5

z1 = (b+v^2/2)(T2-T1)/v(T2-T1)^0.5 ... z2 = z1 - v(T2-T1)^0.5

y1 = log(S/X) + (b+v^2)T2 / vT2^0.5 ... y2 = y1 - vT2^0.5


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
Asset price ( S )
Initial strike price ( X1 )
Extended strike price ( X2 )
Initial time to maturity ( t1 )
Extended time to maturity ( T2 )
Risk-free rate ( r )
Cost of carry ( b )
Volatility ( s )

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)

Numerical Greeks Ouput
Delta
Elasticity
Gamma
DGammaDvol
GammaP
Vega
DvegaDvol
VegaP
Theta (1 day)
Rho
Rho futures option
Phi/Rho2
Carry
DDeltaDvol
Speed

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:
Updated input labels.
Notas de prensa:
**BIG CORRECTION**
The first post was actually for "Writer extendible option", so the code has changed substantially, but the description remains the same.

New Inputs:
Asset price ( S )
Initial strike price ( X1 )
Extended strike price ( X2 )
Initial time to maturity ( t1 )
Extended time to maturity ( T2 )
Risk-free rate ( r )
Cost of carry ( b )
Volatility ( s )
Notas de prensa:
Newer Inputs, another correction.
Asset price ( S )
Strike price ( X )
Reset time ( tau )
Time to maturity ( T )
Risk-free rate ( r )
Cost of carry ( b )
Volatility ( s )
Notas de prensa:
Removed static time.

Public Telegram Group, t.me/algxtrading_public

VIP Membership Info: www.patreon.com/algxtrading/membership
Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?