Assume we want to buy a down-and-in put option with American type of barrier (continuous monitoring) on a single underlying, ST. The payoff function at maturity is given by:
DIP(T) = max(K - ST) * 1{St < H},
where H being the barrier level, K is the strike price, ST is the underlying price, and T is the maturity. The put gets activated once the spot value St crosses the barrier level, i.e. 1{St < H} = 1.
This position creates some market risk to the portfolio, which we want to hedge. This can be done via either:
Dynamic hedging - replication: replicating the payoff by entering positions into the underlying and borrowing/lending money from a bank account, orStatic hedging: as described in [1] and [2]We create a pricing function for the above barrier option using the Monte Carlo simulation to generate the underlying paths. The underlying paths are following the Geometric Brownian Motion (GBM) “BS” process, as described in Eq. 14 of [2].
The Python pricing function uses the following default presets: