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): ...