Explore financial markets through three simulation modes: single-stock geometric Brownian motion price paths, a five-asset correlated portfolio, and the Minsky boom-bust cycle. Test six different trading strategies and observe how randomness, volatility, and time horizon affect wealth accumulation.
Stock prices evolve according to GBM � the foundation of the Black�Scholes options pricing model. The stochastic differential equation and its exact solution:
Where � is the drift (annual expected return), s is annual volatility, and dW is a Wiener process increment.
Because returns are normally distributed, prices are log-normally distributed. This means prices can never go negative and the distribution is right-skewed � matching observed equity price distributions.
The portfolio mode uses Cholesky decomposition to generate correlated Brownian motions for five asset classes. Given correlation matrix S, the decomposition L satisfying LL ? = S transforms independent standard normals into correlated price shocks.
Hyman Minsky's financial instability hypothesis: prosperity breeds risk-taking, which breeds fragility. The crash mode simulates five phases with time-varying � and s parameters.
| Strategy | Logic | Typical frequency | Key risk | Long-run evidence |
|---|---|---|---|---|
| Buy & Hold | Invest at t=0, never sell | Once | Full market exposure | Beats 80%+ active funds over 20 y |
| Day Trading | Buy on +0.5% daily momentum, sell on -0.5% | Daily | Random noise triggers, costs | ~70% of day traders lose money |
| Value Investing | Buy when price < 90% of 50-day MA | Weekly | Value traps, patience required | Historically +2�4% alpha annually |
| Index Funds | Monthly rebalance to 70/30 stock/bond | Monthly | Broad market downturns | Average 10%/yr nominal S&P 500 |
| Momentum | 20-day vs 60-day MA crossover | Weekly | Whipsawing in choppy markets | Works in trending markets |
| Algorithmic | GBM + Minsky crash parameters | Continuous | Model risk, tail events | Varies widely by implementation |
| Metric | Formula | Interpretation |
|---|---|---|
| Total Return | (V_T - V_0) / V_0 � 100% | Overall profit/loss as percentage of initial capital |
| Max Drawdown | max[(peak - trough) / peak] | Largest peak-to-trough decline. Measures worst-case loss |
| Sharpe Ratio | (R_p - R_f) / s_p | Risk-adjusted return. >1 is good, >2 is excellent |
| Volatility s | std(daily log returns) � v252 | Annualised standard deviation. S&P 500 � 16%/yr |
| Value at Risk (VaR) | -s � 1.645 � vT � V | 95% confidence max loss over horizon T (normal dist.) |
| Asset Class | Expected Return � | Volatility s | Sharpe (approx) | Correl to Tech |
|---|---|---|---|---|
| Tech Equity | 18% | 32% | 0.44 | 1.00 |
| Financial Equity | 10% | 20% | 0.40 | 0.45 |
| Energy Equity | 8% | 28% | 0.25 | 0.30 |
| Healthcare Equity | 12% | 18% | 0.56 | 0.20 |
| Government Bonds | 4% | 6% | 0.33 | -0.15 |
| Subject | Level | Topic |
|---|---|---|
| Mathematics | A-Level / AP | Stochastic processes, normal distribution, exponential functions |
| Statistics | Undergraduate | Log-normal distribution, Cholesky decomposition, Monte Carlo methods |
| Finance | Undergraduate | Black-Scholes model, portfolio theory, Markowitz efficient frontier |
| Economics | A-Level / AP | Financial markets, investment, risk vs return, EMH |
| Computer Science | A-Level / AP | Random number generation, simulation algorithms, data visualisation |
GBM is a continuous-time stochastic process where log returns are normally distributed and independent. It is the standard model for equity prices in the Black�Scholes framework, capturing the observed lognormal distribution of stock prices and the unpredictability of short-term returns.
According to the Efficient Market Hypothesis, all available information is already priced in. Only new, random information moves prices, making future price changes unpredictable from past data � the weak form of market efficiency. This simulator shows both the randomness and how strategy time horizons interact with it.
Hyman Minsky's financial instability hypothesis observes that long periods of stability breed complacency and leverage, inevitably leading to a "Minsky moment" � a sudden collapse. The simulator runs Boom ? Euphoria ? Panic ? Crash ? Recovery, each with historically calibrated � and s values.
Over long horizons (20�30 years), Buy & Hold and Index Funds consistently outperform active strategies due to compounding and lower transaction costs. Day Trading and Momentum strategies may show large variance but rarely beat passive strategies after risk adjustment � a result deeply confirmed in empirical finance literature.