Python Monte Carlo graphs

Wednesday, November 16th, 2011

I wanted to plot the paths of my Monte Carlo simulation of Black Scholes in my previous post. Using iPython started with the --pylab flag, it's pretty easy. [sourcecode language=Python] from math import exp from random import gauss St0=41.75 rate=.0535 vol=.34 trials=100 for trials in range(trials): prices=[St0] for day in range(time): ...

Black Scholes Monte Carlo in Python

Wednesday, November 16th, 2011

The Black Scholes formula is a partial differential equation that can be used to price the present value of an option under certain assumptions. As with everything, you can read all about it in Wikipedia. It turns that that figuring out the present value of an option is also a ...