I'm currently struggling with the derivation of a formula to price the following exotic option with Black-Scholes.
The option has the maximum payoff of $(S_T-z)$ and $(y - S_T)$, where $S_T$ is the price of the underlying at maturity $T$, $X$ the strike price, and $z$ and $y$ are constants. E.g. $z = 20$ and $y = 40$.
My first approach was to build a formula where I combine the payoff of $max\{(S_T-z);0\}$ and $max\{(y-S_T);0\}$.
$ d_1 =\frac{\ln(\frac{X}{S_0})+(r_f-0.5*\sigma^2)*T}{\sigma*\sqrt{T}} $ and $d_2 = d_1 - \sigma*\sqrt{T}$
$Price = (S_0*\phi{(d_1)}-a*e^{-r_fT}*\phi{(d_2)})+(b*e^{-r_fT}*\phi{(-d_2)}-S_0*\phi{(-d_1)}) $
EDIT: Thanks to the notes I came up with a second approach on how to price this option:
Payoff structure $max(S_T-z;y-S_T) = y - 2*max(S_T-(y+z)/2,0)$, where the price is represented by
$y-S_0*e^{-r_fT} + 2*(S_0*\phi(d_1)-0.5*(y+z)*e^{-r_fT}*\phi(d_2))$
Is this correct and do I have to adjust $d_1$ as well?
So that it would be $d_1 = \frac{\ln(\frac{0.5*(z+y)}{S_0})+(r_f-0.5*\sigma^2)*T}{\sigma*\sqrt{T}}$