Believable price data for trading UIs
Charting components need data that moves like a real market. This fake stock price generator builds a fictional ticker and a daily open-high-low-close series using a geometric random walk, so candlesticks rise and fall in realistic percentage steps instead of obvious straight lines.
How it works
The generator starts from your chosen price and walks it forward one trading day at a time. Each new close is the previous close scaled by a daily return drawn from your drift and volatility:
shock = random in [-1, 1]
dailyReturn = drift + volatility * shock
close[t] = close[t-1] * (1 + dailyReturn)
Open is set near the previous close, while high and low are spread around the open and close so each candle has a believable body and wicks. Volume is randomized within a plausible range. Export the full OHLC series as CSV or JSON.
Tips and examples
- Keep volatility low (around 1 to 2 percent) for a calm large-cap feel, or raise it for a volatile small-cap look.
- Add a small positive drift to show an uptrend or a negative drift for a decline.
- Use the JSON export to feed candlestick libraries directly; use CSV for spreadsheets.