fx double one touch option
financepy.products.fx.fx_double_one_touch_option
Class
FXDoubleOneTouchOption
FXDoubleOneTouchOption(
expiry_dt: Date,
option_type: DoubleBarrierTypes,
lower_barrier_fx_rate: float,
upper_barrier_fx_rate: float,
payment_size: float = 1.0,
) -> None
Inherits from: FXOption
A FinFXOneTouchOption is an option in which the buyer receives a
rebate if the FX rate touches either a lower barrier or an upper barrier
at any time before the option expiry date and zero otherwise.
Methods
value
value(
self,
value_dt: Date,
spot_fx_rate: float | numpy.ndarray,
domestic_curve: DiscountCurve,
foreign_curve: DiscountCurve,
model: Model,
)
FX One-Touch Option valuation using the Black-Scholes model
assuming a continuous (American) barrier from value date to expiry.
Handles both cash-or-nothing and asset-or-nothing options.
value_mc_slow
value_mc_slow(
self,
value_dt: Date,
stock_price: float,
domestic_curve: DiscountCurve,
foreign_curve: DiscountCurve,
model: Model,
num_paths: int = 10000,
num_steps_per_year: int = 252,
seed: int = 4242,
)
Double one touch Option valuation using the Black-Scholes model and Monte
Carlo simulation. Accuracy is not great when compared to the analytical
result as we only observe the barrier a finite number of times. The
convergence is slow.
value_mc_bb_slow
value_mc_bb_slow(
self,
value_dt: Date,
stock_price: float,
domestic_curve: DiscountCurve,
foreign_curve: DiscountCurve,
model: Model,
num_steps_per_year: int = 52,
num_paths: int = 100000,
seed = 42,
)
No description available.
value_mc
value_mc(
self,
value_dt: Date,
spot_fx_rate: float,
domestic_curve: DiscountCurve,
foreign_curve: DiscountCurve,
model: Model,
num_steps_per_year: int = 52,
num_paths: int = 1000000,
seed: int = 42,
) -> float
PV via Brownian-bridge Monte Carlo with Numba parallelism.
- KNOCK_IN (double one-touch): pays K if a barrier is touched before expiry.
- KNOCK_OUT (double no-touch): pays K if neither barrier is touched before expiry.
Generated automatically from the FinancePy source code.
Do not edit this file manually.