Class TouchOption
java.lang.Object
com.quantfinlib.pricing.TouchOption
One-touch and no-touch options (pay-at-expiry) under continuously
monitored geometric Brownian motion — with the barrier-hitting
probability itself exposed, since desks quote one-touches as
(roughly) discounted hit probabilities.
With log-drift m = r − q − σ²/2 and barrier log-distance
h = ln(H/S), the reflection principle gives the probability of
touching an upper barrier (h > 0) by expiry:
P = N((−h + mT)/σ√T) + e^{2mh/σ²} · N((−h − mT)/σ√T)
and symmetrically for a lower barrier. A one-touch paying at expiry is
payout·e^{−rT}·P; a no-touch is the complement. Conventions match
BlackScholes: carry is the continuous yield (foreign rate
for FX).
Pay-at-hit one-touches (rebate paid immediately on touch) differ by
discounting to the hitting time; the pay-at-expiry form here is the one
used in vanna-volga books and matches how BarrierOption treats
rebates (it doesn't — knockouts here carry no rebate).
-
Method Summary
Modifier and TypeMethodDescriptionstatic doublehitProbability(double spot, double barrier, double rate, double carry, double vol, double timeYears) Probability that spot touchesbarrierat least once beforetimeYears, under GBM with the given rate/carry/vol.static doublenoTouch(double spot, double barrier, double rate, double carry, double vol, double timeYears, double payout) Payspayoutat expiry if the barrier never traded.static doubleoneTouch(double spot, double barrier, double rate, double carry, double vol, double timeYears, double payout) Payspayoutat expiry if the barrier traded at any point.
-
Method Details
-
hitProbability
public static double hitProbability(double spot, double barrier, double rate, double carry, double vol, double timeYears) Probability that spot touchesbarrierat least once beforetimeYears, under GBM with the given rate/carry/vol. -
oneTouch
public static double oneTouch(double spot, double barrier, double rate, double carry, double vol, double timeYears, double payout) Payspayoutat expiry if the barrier traded at any point. -
noTouch
public static double noTouch(double spot, double barrier, double rate, double carry, double vol, double timeYears, double payout) Payspayoutat expiry if the barrier never traded.
-