0bps

Tools / Price path simulator

Price path simulator

Simulate thousands of geometric Brownian motion paths and read off the odds of hitting a target or a stop.

S_t = S₀·exp((μ − σ²/2)t + σW_t)

P(ends above start)
P(touches target)
P(touches stop)
Target before stop
Median end price
Mean end price
5% worst return

Sample paths. 60 of the simulated paths, with the target and stop as dashed lines.

Where prices end up. The distribution of final prices across all paths. Note the long right tail: the mean sits above the median.

What this shows

Each path follows geometric Brownian motion with daily steps, S(t+Δt) = S(t) · exp((μ − σ²/2)Δt + σ√Δt · Z). Raise volatility while holding drift fixed and two things happen: the fan widens, and the median path sinks, because the typical path grows at μ − σ²/2. That is volatility drag, visible.

"Target before stop" is the share of paths that touched the target without having touched the stop first — the closest thing to a win rate for a bracket order under this model. Real markets have fat tails and jumps, so treat these as baseline odds, not forecasts.

The theory is in the lesson.

Turn this into a tool you own

A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.

in Claude Code, Cursor, Codex & 4 more
/agenkit build a Monte Carlo risk engine that fits GBM and bootstrapped-return models to live exchange data, simulates portfolio paths, and reports VaR, expected shortfall and hit probabilities for target and stop levels
  1. npx agenkit install engineering-kit in your project
  2. Paste the command into your agent and approve each phase
  3. Get tests, backtest, risk controls and a paper-trading switch

Other calculators

esc

Try , , or .

↑↓ move↵ open