# Stock Price Pattern Generator - Patterns Look Like Real Price Charts

The Stock Price Pattern Generator uses the following recursive formula:

* Price = Trend + Previous Price + Random Component*

Where:

* Price* is the new price.

*Trend* is a positive or negative number or zero. A non-zero value causes prices to follow a positive or negative long-term trend. 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.

*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 zero. Each successive price is generated using the above formula.

The model is sensitive to changes in the four 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*.

To recreate a price pattern enter the original input variables.

A price pattern chart has no label on the vertical axis because these values are not important. The outcomes are not associated with a particular stock. It's the pattern that is of interest.

Related Calculators

Price Direction Indicator (PDI) Calculator and Chart Maker

Stock Correlation Calculator

Stock Return Calculator

S&P 500 Return Calculator - Robert Shiller Long-term Stock Data