Finding optimal option to maximise gains under given price hypothesis
Finding optimal option to maximise gains under given price hypothesis
Loading saved threads...
User981636 · External communityPost link
External question — Quantitative Finance Stack Exchange
Author: User981636
Original post: https://quant.stackexchange.com/questions/70803
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
Let's have Stock S at \$100 on January and my hypothesis is S will be trading at \$150 in July.
Is there any Python/R package that I can feed with option prices from my broker and it would return the optimal call option for my hypothesis? That is, the call option that would maximise return if my hypothesis becomes true (S gets to \$150 in July).
*New to options & programming here.
Quote
Report
Kermittfrog · External communityPost link
External answer — Quantitative Finance Stack Exchange
Author: Kermittfrog
Original post: https://quant.stackexchange.com/a/70807
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I do not know of any package that can solve your problem; but it seems to be a simple problem, in the end:
Given a 'future target price'
$S^*$
(say 150 in your case) and a set of call options with quotes
$C_1,\ldots, C_n$
with corresponding strikes
$X_1,\ldots,X_n$
, find
$i\in [1,n]$
such that
$(S^*-X_i-C_i)/C_i$
is maximized. Assuming constant implied volatility and a Black-Scholes-Merton world, you want to find
$X$
such that
$$
\begin{align}
\max_{X} \Pi(X)&\equiv \frac{S^*-X-C(X)}{C(X)} \\
&= \frac{S^*-X}{C(X)}-1 \\
\Rightarrow 0 &\stackrel{!}{=}\frac{\partial \Pi}{\partial X}=\frac{-C(X)+(S^*-X)e^{-r\tau}\mathrm{N}(d_2(X))}{C(X)^2}\\
\Rightarrow C(X)&=(S^*-X)e^{-r\tau}\mathrm{N}(d_2(X))\\
&\Rightarrow S\mathrm{N}(d_1(X))-Xe^{-r\tau}\mathrm{N}(d_2(X))=S^*e^{-r\tau}\mathrm{N}(d_2(X))-Xe^{-r\tau}\mathrm{N}(d_2(X))\\
&\Rightarrow S\mathrm{N}(d_1(X))=S^*e^{-r\tau}\mathrm{N}(d_2(X))
\end{align}
$$
where
$d_{1/2}=\frac{\ln S-\ln X +(r\pm\frac{1}{2}\sigma^2)\tau}{\sigma\sqrt{\tau}}$
. The last equation represents a univariate root finding problem.
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External answer — Quantitative Finance Stack Exchange Author: Kermittfrog Source score (net votes, not local likes): 2 Original post: https://quant.stackexchange.com/a/70807 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I do not know of any package that can solve your problem; but it seems to be a simple problem, in the end: Given a 'future target price' $S^*$ (say 150 in your case) and a set of call options with quotes $C_1,\ldots, C_n$ with corresponding strikes $X_1,\ldots,X_n$ , find $i\in [1,n]$ such that $(S^*-X_i-C_i)/C_i$ is maximized. Assuming constant implied volatility and a Black-Scholes-Merton world, you want to find $X$ such that $$ \begin{align} \max_{X} \Pi(X)&\equiv \frac{S^*-X-C(X)}{C(X)} \\ &= \frac{S^*-X}{C(X)}-1 \\ \Rightarrow 0 &\stackrel{!}{=}\frac{\partial \Pi}{\partial X}=\frac{-C(X)+(S^*-X)e^{-r\tau}\mathrm{N}(d_2(X))}{C(X)^2}\\ \Rightarrow C(X)&=(S^*-X)e^{-r\tau}\mathrm{N}(d_2(X))\\ &\Rightarrow S\mathrm{N}(d_1(X))-Xe^{-r\tau}\mathrm{N}(d_2(X))=S^*e^{-r\tau}\mathrm{N}(d_2(X))-Xe^{-r\tau}\mathrm{N}(d_2(X))\\ &\Rightarrow S\mathrm{N}(d_1(X))=S^*e^{-r\tau}\mathrm{N}(d_2(X)) \end{align} $$ where $d_{1/2}=\frac{\ln S-\ln X +(r\pm\frac{1}{2}\sigma^2)\tau}{\sigma\sqrt{\tau}}$ . The last equation represents a univariate root finding problem.
Checking account access…