Stock Price Pattern Generator (Random Walk with Drift) - Patterns Look Like Real Price Charts

Much has been written about the price patterns of securities - are they defined by predictable processes or are they formed at random? Read about the subject at Random Walks in Stock Market Prices and Stock Market Prices Do Not Follow Random Walks.

This article does not discuss this debate, but it offers a model to help think about it.

The Stock Price Pattern Generator computes a series of prices using a random component. The resulting price charts look amazingly like real price charts. The generated charts include familiar patterns such as double tops and bottoms, head and shoulder tops and bottoms, pennants, triangles, bubbles, crashes and more.

Stock Price Pattern Generator
Mean of Random Component:
Standard Deviation of Random Component:
Trend:
First Stock Price: ($):
Number Prices (maximum is 10000):
Random Number Seed:
No $ in First Stock Price field.

 

The Stock Price Pattern Generator uses the following recursive formula that is a random walk with drift:

Price = Trend + Previous Price + Random Component

Where:

Price is the new price.

Trend is a positive or negative number or zero. In formal mathematical models Trend is called drift.

Previous Price is the previous price.

Random Component is a normally distributed variable with a specified mean and standard deviation. The Random Component causes the variation in computed prices. For each price the model generates a random component using the Box-Muller transform.

First Price is the first price in the series. Enter any positive number.

Number Prices is the number of prices to be generated.

Random Number Seed determines the first random component. A given seed will generate a unique but identical sequence of random components. To generate another unique sequence of random components, enter a different seed. Enter a positive integer number.

Computational Notes

The first price of the model is First Stock Price. Each successive price is generated using the above formula.

The model is sensitive to changes in the five input variables, so experiment with different values to see different patterns. An easy way to create a new pattern is to change Random Number Seed.

The model is particularly sensitive to the value of Trend. To generate upside price patterns enter positive values for Trend. To generate downside price patterns enter negative values for Trend between -0.2 and 0.2.

To recreate a price pattern enter the original input variables.

The first and last price numbers on the horizontal axis of the display chart are denoted as 0 and number prices minus 1.

Related Calculators

Price Direction Indicator (PDI) Calculator and Chart Maker

Stock Trading Monte Carlo Generator - Simulate Stock Trades

Stock Price Upside Returns Calculator: Upside Produces Large and Small Gains

Stock Return Calculator

Stock Trendline Calculator and Chart Maker