Run a DCA plan
run_dcaSimulate one dollar-cost-averaging plan against real historical closes. Returns totals, end-of-year checkpoints and a share_url that opens the same run in the app.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | "dca" repeats on the schedule; "lump-sum" buys once at the start. Default "dca". | |
| as_of | No | Pin the answer to this data vintage so the share link keeps returning the same number. | |
| asset | Yes | Asset key from list_assets, e.g. "btc_daily", "Ethereum", "S&P 500". | |
| amount | Yes | USD per contribution, or the single amount for lump-sum. | |
| include | No | ||
| end_date | No | Window end. Defaults to the last loaded close, never a relative "today". | |
| settings | No | Chart overlays carried into share_url, and the figures they add to each summary. Flags marked "Pro only" need a signed-in Pro account or a Pro API key; refused otherwise, and the refusal says what unlocks them. | |
| frequency | No | Contribution cadence. Default "monthly". Quarterly is the coarsest offered: wider gaps behave like a few lump sums (see the knowledge base, "The gap between buys"). | |
| start_date | Yes | First scheduled contribution. | |
| wait_periods | No | Save this many scheduled contributions as cash before the first purchase. | |
| last_buy_date | No | Stop buying here and hold to end_date. |