Brownian Motion Path and Maximum Drawdown

Manipulate[Module[{bPath,maxPath,ddPath,maxDD},SeedRandom[seed];
bPath=Accumulate[RandomReal[NormalDistribution[(mu)/250,(sig)/Sqrt[250]],days]];maxPath=Drop[FoldList[Max,0,bPath],1];
ddPath=maxPath - bPath;
maxDD=Drop[FoldList[Max,0,ddPath],1];
ListLinePlot[{bPath,maxDD},AxesLabel->{"Days","Return (cumulative %)"},Filling->Axis,ImageSize->{450,300},ImagePadding->{{45,45},{25,25}},PlotRange->All]],
{{mu,10,"mean (annual %)"},-20,40,.1,Appearance->"Labeled"},
{{sig,2.5,"standard deviation (annual %)"},1,25,.5,Appearance->"Labeled"},
{{days,250,"days"},25,1000,1, Appearance->"Labeled"},
{{seed,77777,"new random case"},10000,999999,1},
TrackedSymbols:>{mu,sig,days,seed}]

CAPTION

We illustrate the evolution of a geometric Brownian motion simulating a daily stock return series. The jagged blue line is the cumulative return of the daily return series. The red line is the maximum drawdown to date of the series. Adjusting the mean and standard deviation sliders demonstrates how the cumulative return and maximum drawdown change with respect to these parameters for a given underlying set of random shocks. Adjusting the "new random case" slider allows you to see different random cases to get a sense of how variable a return series can be for a single set of parameters. Note that in general the greater the ratio of mean to standard deviation, the smoother the return evolution is and the smaller the maximum drawdown is.

DETAILS

A geometric Brownian motion is the de facto standard model for stock price evolution. It is locally represented by the simple stochastic differential equation

(dS/S)=μdt+σdz

where S is the stock price, μ is the "drift" parameter and σ is the standard deviation. The equation says that over independent time increments of size Δt, the stock price's fractional change is normally distributed with mean μΔt and standard deviation σ(Sqrt[Δt]). The ratio of μ and σ is sometimes called the information ratio of the price evolution and it is tied to the maximum drawdown of the series.

This Demonstration allows the user to choose annualized values of μ and σ (in percentage) and then shows the cumulative returns of the random series and its maximum drawdown series. The maximum drawdown at any point in time is the largest peak to trough change in the series. The plot shows that the maximum drawdown is tightly linked to the information ratio of the series.

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Brownian Motion Path and Maximum Drawdown" from the Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/BrownianMotionPathAndMaximumDrawdown/

Contributed by: Neil Chriss

A full-function Wolfram Mathematica system (Version 6 or higher) is required to edit this notebook.
GET WOLFRAM MATHEMATICA »

© Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »