Skip to content

Comment on Generating graphs that look like stock charts

Comments

"It turns out it's pretty easy to generate graphs that look like stock prices graphs. Just generate a bunch of random values from 0-1, then take the integral of that (each integrated value is the sum of all the previous original value)".

Functions to generate normally distributed variates exist in many languages. Why not use them instead of using uniform variates? For even greater realism, generate Student-t variates with say 5 degrees of freedom to account for fat tails in the return distribution.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.