Generating new histories for Financial Time Series

I was involved in a short project during which I needed a set of tools for rapid interactive visualization of multivariate time series, and some routines for stochastic simulation. Hence, this thing is about simulating stock price time series, and an applet to do that.

Background on Simulated Historical Series

Historical data on financial time series is freely available along with nice tools for technical analysis and benchmarking. However, there is no free tool capable of simulating alternative histories of the asset prices in light of their temporal volatility structure. These Simulated Historical Series (herein SHS) can be used to estimate the sensitivity of the mathematical forecasting model on the historical calibration data, especially under abnormal market conditions. They also provide information on the likelihood of the observed stock price time series in the context of the forecasting model.

Mathematically, the simulated historical series are realizations of the stochastic process which is used to model the asset price fluctuations or returns. In practice, the SHSs are time series generated randomly but having a certain structure. Below is an example of a bundle of SHS-realizations overlied by the observed series, which all have exactly the same volatility structure but different price evolution:


The thick lines are moving averages of the (normalized) daily closing prices of the stock and the envelope about the moving average reflects the annualized local volatility for holding the stock for 30 days. Here is another one for the OMXH25-index:



The Applet

I needed a customizable SHS-simulation tool for a project, and hence built an application which uses the historical local volatility data to perform a stochastic simulation. The underlying mathematical model is the Heston stochastic volatility model, which is conditioned on the actual stock price volatility.

For those interested, there is a link below to an applet which is a somewhat restricted version of the actual simulator. See the hint messages on the top of the applet area when you move mouse over a button inside the applet. Start the applet.

The applet has some stock price data included. It can be used for visualization of the daily closing price data, local volatility, moving averages and the volume of daily trades. You may also generate SHS-realizations using the above mentioned Heston process, and even use the Marker -tool to draw your own support lines or criticality points:


Published by


Flâneuring through experiments in data, science and artsy digital things.