Simulate monthly investing in a portfolio
simulate_portfolioMonte Carlo simulation of investing monthly (plus an optional starting sum) in one asset or a mix rebalanced monthly. Returns the range of outcomes by year (10th to 90th percentile), the deepest fall along the way, the mix's own past return and volatility, and a compoundsim.app url that shows the same scenario.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| years | No | Years of investing. | |
| history | No | The span of past monthly returns the model is fitted to: the last 5, 10 or 20 years, or all the data. An asset with less data than the span asked for uses all of its own. | all |
| initial | No | Starting sum invested at once. | |
| monthly | Yes | Amount invested at the end of every month. | |
| currency | No | Currency of every amount, in and out. In a currency other than USD the paths carry its exchange-rate swings against the dollar (trend removed). Defaults to the language's currency. | |
| language | No | Language of the page the returned url opens; match the user's language. | en |
| portfolio | Yes | A preset name or weights in percent by asset (any total; they are scaled to 100). Assets: sp500 = S&P 500, ndx100 = Nasdaq 100, sox = SOX (Semiconductors), schd = US dividend stocks (SCHD), acwi = MSCI ACWI, efa = Developed ex-US stocks, eem = Emerging market stocks, vnq = US REITs, gld = Gold, shy = US 1–3 year Treasuries, agg = US aggregate bonds, tlt = US long-term Treasuries, btc = Bitcoin. Presets: sixtyForty = sp500 60% + agg 40%; allCountry = acwi 100%; allWeather = sp500 30% + tlt 40% + shy 15% + gld 15%. | |
| history_to | No | Last calendar year of a custom span. | |
| history_from | No | First calendar year of a custom span (with history_to); replaces history. | |
| inflation_percent | No | Annual inflation. When given, every amount out is in today's money at this rate; omitted, amounts are nominal. |