I need help with plotting next two graphs. I don't know how to combine all these formulas to make a graph. I need a graph for different values of S (which is stock price) in range (500,1500). Formulas for call and put option is

$\pi_C = exp(-r(T-t_0))(FN(d_1)-KN(d_2))$
$\pi_p = exp(-r(T-t_0))(KN(-d_2)-FN(-d_1))$ 

which graphs I need

where F is $F = S*exp(r(T-t_0))$

$d_1 = \frac{\ln\left({\frac{F}{K}}\right) + \frac{1}{2}\sigma^2(T-t_0)}{\sigma\sqrt{T-t_0}}$
$d_2 = \frac{\ln\left({\frac{F}{K}}\right) - \frac{1}{2}\sigma^2(T-t_0)}{\sigma\sqrt{T-t_0}}$

and fixed values are K = 1000, T = 1, t_0 = 0, r = 0.02, \sigma = 0.2 , and N stands for cumulative standard normal (Gauss) distribution.

\documentclass[a4 paper, 12pt]{article}

    declare function={
        pi_c= exp(-r(T-t0))*(F*N(d1)-K*N(d2));
        pi_p= exp(-r(T-t0))*(K*N(-d2)-F*N(-d1));

    \addplot+ ;


edit: I add code for plotting. N will be cumulative distribution function of standard normal and I dont know how to make it.. formula for N(x) is $\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{x} exp{\frac{-t^2}{2}}dt$, and I need graphs of pi_c and pi_p

  • See pgfplots package. In documentation are plenty of examples, how to draw diagrams,. Also search in this site for pgfplots and draw functions. – Zarko Sep 28 '20 at 15:17
  • What is your desired image? – user213378 Sep 28 '20 at 15:32
  • image of two graphs in one, one for call and one for put option, x label is stock price S, and y label is valeu of call and put option – kileuskas Sep 28 '20 at 15:35
  • @kileuskas Can you show the visible desired image? – user213378 Sep 28 '20 at 16:38
  • That's a lot in your preamble. Pro tip: extra long preambles should go to an extra file. – Someone Sep 28 '20 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.