Some Useful Option Pricing Code

15 03 2010

I have recently started to do alot more coding in my financial modeling (all in MATLAB). Since I was having a pretty tough time finding examples online, I have decided to post some of my work online.

Please note that most of this code is experimental, and should only be used as a guide for vectorization of code in MATLAB.

This code is basic stuff using binomial trees to help get familiar with European options pricing.

You can download the M-files here.

Contains:

deltaBinomial: returns matricies containing binomial trees in the upper-right. S-> stock price, V-> european option value, delta-> delta hedging ratio, t -> time vector.

interpBinomial: does linear interpolation of the delta hedge matrix. The input vector simuS is a vector of simulated prices (for example, using monte-carlo). Returns the delta hedging ratio for the simulated price vector.

dVarRCVaR: Calculates the VaR and CVaR given a loss vector L, and a confidence level b.

milstein: options pricing using milstein’s method.

Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: