MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today
Asked by Locks on 23 Mar 2013

how can I plot:

- intrinsic value of a call/put option in matlab?

- how can I plot the call/put value including the time value?

Additionally, I would like to plot delta, gamma, vega, etc. for several strikes and time to maturity, is that possible?

thanks for your help

*No products are associated with this question.*

Answer by the cyclist on 23 Mar 2013

Edited by the cyclist on 23 Mar 2013

Accepted answer

The Financial Toolbox has formulas for option prices [e.g. blsprice() for Black-Scholes model option pricing]. You can see the complete list of functions here:

http://www.mathworks.com/help/finance/functionlist.html

If you don't have that toolbox, then you might find something you can use in the File Exchange. Here's one:

http://www.mathworks.com/matlabcentral/fileexchange/33770-black-scholes-formula

(But I have no idea if it is any good.)

Show 11 older comments

Locks on 24 Mar 2013

plotting both has worked now, but there is another thing I am not able to do.

I would like to plot a double arrow between the intrinsic value line and the black scholes line, to show the time value of the option. is there an easy way to do this?

additionally I would like to write 'time value' between the intrinsic value line and the block scholes line, how can I write something at a specific place in a plot?

thank you very much for your help

the cyclist on 24 Mar 2013

You can add text to a specific place on the plot using text function.

help text

for details.

I forgot about this when you asked about arrows earlier. You can do this using the annotation() command.

For example,

annotation(gcf,'doublearrow',[0.2 0.3],[0.3 0.5])

It is a little annoying that annotations use *figure* coordinates rather than *axis* coordinates. Read this for details:

http://www.mathworks.com/help/matlab/creating_plots/positioning-annotations-in-data-space.html

## 2 Comments

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/68354#comment_138412

All of this is possible in MATLAB, but your question is far too general. We have no idea knowing what you already understand (and don't understand) about this problem.

For example, do you know anything at all about plotting in MATLAB? (Would you know how to plot the line y = 2*x?)

How much do you understand about options? Do you know and understand the formulas for the values?

I suggest you try to break down your question into small chunks that will be easier for people to digest and help you answer. You should show what coded you have written for yourself as well.

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/68354#comment_138415

I know how to plot a line in matlab and I suppose I know enough abbout options, but I thought there could be a function where I do not need to do it by myself. Is there no function for this?

I do not really know how to get the axis an how to describe them

Furthermore, to plot the intrinsic value, I need the max function to get max(S-K,0)

For the option value I need the black scholes formula, which fortunately I have

I there an easy and efficient way to handle that problem