loxx

Fade-in Options [Loxx]

A fade-in call has the same payoff as a standard call except the size of the payoff is weighted by how many fixings the asset price were inside a predefined range (L, U). If the asset price is inside the range for every fixing, the payoff will be identical to a plain vanilla option. More precisely, for a call option, the payoff will be max(S(T) - X, 0) X 1/n Sum(n(i)), where n is the total number of fixings and n(i) = 1 if at fixing i the asset price is inside the range, and n(i) = 0 otherwise. Similarly, for a put, the payoff is max(X - S(T), 0) X 1/n Sum(n(i)).

Brockhaus, Ferraris, Gallus, Long, Martin, and Overhaus (1999) describe a closed-form formula for fade-in options. For a call the value is given by

max(X - S(T), 0) X 1/n Sum(n(i))

describe a closed-form formula for fade-in options. For a call the value is given by

c = 1/n * Sum(S^((b-r)*T) * (M(-d5, d1; -p) - M(-d3, d1; -p)) - Xe^(-rT) * (M(-d6, d2; -p) - M(-d4, d2; -p))

where n is the number of fixings, p = (t1^0.5/T^0.5), t1 = iT/n

d1 = (log(S/X) + (b + v^2/2)*T) / (v * T^0.5) ... d2 = d1 - v*T^0.5

d3 = (log(S/L) + (b + v^2/2)*t1) / (v * t1^0.5) ... d4 = d3 - v*t1^0.5

d5 = (log(S/U) + (b + v^2/2)*t1) / (v * t1^0.5) ... d6 = d5 - v*t1^0.5


The value of a put is similarly

p = 1/n * Sum(Xe^(-rT) * (M(-d6, -d2; -p) - M(-d4, -d2; -p))) - S^((b-r)*T) * (M(-d5, -d1; -p) - M(-d3, -d1; -p)

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 )
Strike price ( K )
Lower barrier ( L )
Upper barrier ( U )
Time to maturity ( T )
Risk-free rate ( r )
Cost of carry ( b )
Volatility ( s )
Fixings ( n )
cnd1(x) = Cumulative Normal Distribution
nd(x) = Standard Normal Density Function
cbnd3() = Cumulative Bivariate Distribution
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

Public Telegram Group, t.me/algxtrading_public

VIP Membership Info: www.patreon.com/algxtrading/membership
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?