Dollar-Cost Averaging with a Lump-Sum Benchmark
Summary
This chart indicator estimates the outcome of investing a fixed amount at a chosen daily, weekly, or monthly interval over a user-selected date range. For each eligible period, it divides the contribution by the selected timeframe’s price, accumulates asset quantity and spending, and displays estimated portfolio value and profit or loss. It also calculates a comparison in which the full planned investment is put to work at the beginning of the range, letting users compare periodic purchases with a lump-sum entry.
The script accepts the contribution size, dates, and investment interval, and can use either the chart timeframe or a selected higher timeframe. It displays calculated holdings and returns in chart labels and hidden plots; the supplied document gives no example results or evidence that either approach performs better. Results depend on the chosen asset, dates, chart resolution, and timeframe handling. The code uses lookahead-enabled higher-timeframe data and approximates weekly and monthly purchase dates on lower-resolution charts, so its calculations may not faithfully represent executable historical decisions. It also omits transaction costs and other practical investment constraints.
Key ideas
- The indicator models recurring fixed-cash purchases at daily, weekly, or monthly intervals.
- Each contribution is converted into asset quantity using the price for the selected period.
- A lump-sum calculation provides a comparison with the recurring purchase schedule.
- Date range, contribution, chart resolution, and timeframe selection affect the displayed estimates.
- Lookahead-enabled data, approximate period boundaries, and omitted costs limit the realism of the comparison.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.