{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"dca-average-cost"},"result":{"entity_type":"calculator","id":"dca-average-cost","calculator_id":"dca-average-cost","canonical_url":"https://tttkmbb.com/investing/dca-average-cost","name":"Dollar-Cost Averaging Calculator","title":"Dollar-Cost Averaging Calculator – Average Cost per Unit from Fixed Periodic Purchases","category":"investing","category_name":"Investing & Real Estate","tool_name":"calculate_dca_average_cost","featured_mcp_tool":false,"description":"Simulates investing a fixed amount at each of a list of prices, and reports the units bought, the average cost per unit (harmonic mean of prices), the simple average price, the current value at the last price and the gain or loss.","use_when":"You invest the same amount every period and want your true average cost, or want to see how a fixed-amount plan compares with the average price.","do_not_use_when":"You buy a fixed number of units each time (the average cost is then the simple average price) or want a projection with a growth rate (use compound-interest). Informational only; not financial advice.","inputs":[{"name":"amount_per_period","label":"Amount invested per period","type":"number","required":true,"max":1000000000000,"exclusive_min":0,"description":"Fixed currency amount invested at each price.","example":100},{"name":"prices","label":"Purchase prices","type":"number_list","required":true,"description":"Unit price at each purchase, in time order (2–60 values, all greater than 0).","example":[10,8,12.5]}],"outputs":[{"name":"periods","label":"Number of purchases","type":"integer","decimals":0,"description":"Length of the price list."},{"name":"total_invested","label":"Total invested","type":"number","decimals":2,"description":"amount_per_period × periods."},{"name":"units_bought","label":"Units bought","type":"number","decimals":4,"description":"Σ amount_per_period / price_i."},{"name":"average_cost_per_unit","label":"Average cost per unit","type":"number","decimals":4,"description":"total_invested / units_bought (harmonic mean of the prices)."},{"name":"simple_average_price","label":"Simple average price","type":"number","decimals":4,"description":"Arithmetic mean of the prices (average cost when buying a fixed number of units)."},{"name":"difference_percent","label":"Average cost vs simple average","type":"number","unit":"%","decimals":2,"description":"(average_cost_per_unit − simple_average_price) / simple_average_price × 100; never positive."},{"name":"current_value","label":"Value at the last price","type":"number","decimals":2,"description":"units_bought × last price."},{"name":"gain_loss_percent","label":"Gain or loss","type":"number","unit":"%","decimals":2,"description":"(current_value − total_invested) / total_invested × 100."},{"name":"schedule","label":"Purchase schedule","type":"list","decimals":4,"description":"One row per purchase: period, price, units."}],"input_schema":{"type":"object","properties":{"amount_per_period":{"description":"Fixed currency amount invested at each price.","type":"number","maximum":1000000000000,"exclusiveMinimum":0,"examples":[100]},"prices":{"description":"Unit price at each purchase, in time order (2–60 values, all greater than 0).","type":"array","items":{"type":"number"},"minItems":2,"examples":[[10,8,12.5]]}},"additionalProperties":false,"required":["amount_per_period","prices"]},"output_schema":{"type":"object","properties":{"periods":{"description":"Length of the price list.","type":"integer"},"total_invested":{"description":"amount_per_period × periods.","type":"number"},"units_bought":{"description":"Σ amount_per_period / price_i.","type":"number"},"average_cost_per_unit":{"description":"total_invested / units_bought (harmonic mean of the prices).","type":"number"},"simple_average_price":{"description":"Arithmetic mean of the prices (average cost when buying a fixed number of units).","type":"number"},"difference_percent":{"description":"(average_cost_per_unit − simple_average_price) / simple_average_price × 100; never positive. Unit: %.","type":"number","x-unit":"%"},"current_value":{"description":"units_bought × last price.","type":"number"},"gain_loss_percent":{"description":"(current_value − total_invested) / total_invested × 100. Unit: %.","type":"number","x-unit":"%"},"schedule":{"description":"One row per purchase: period, price, units.","type":"array"}}},"formula":"units = Σ_i amount_per_period / prices[i]; average_cost_per_unit = (n × amount_per_period) / units; simple_average_price = Σ prices[i] / n; current_value = units × prices[n]","method":"Because a fixed amount buys more units when prices are low, the average cost is the harmonic mean of the prices, which is always at or below the arithmetic mean. Fees, taxes and dividends are ignored. Informational mathematics only; not financial advice.","sources":[{"name":"Wikipedia – Dollar cost averaging","url":"https://en.wikipedia.org/wiki/Dollar_cost_averaging","type":"reference","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"100 per period at 10, 8, 12.5","inputs":{"amount_per_period":100,"prices":[10,8,12.5]},"expected":{"periods":3,"total_invested":300,"units_bought":30.5,"average_cost_per_unit":9.8361,"simple_average_price":10.1667,"difference_percent":-3.25,"current_value":381.25,"gain_loss_percent":27.08},"url":"https://tttkmbb.com/api/v1/calculate/dca-average-cost?amount_per_period=100&prices=10%2C8%2C12.5"},{"name":"500 per month at 50, 45, 40, 48, 55","inputs":{"amount_per_period":500,"prices":[50,45,40,48,55]},"expected":{"total_invested":2500,"units_bought":53.1187,"average_cost_per_unit":47.0644,"simple_average_price":47.6,"difference_percent":-1.13,"current_value":2921.53,"gain_loss_percent":16.86},"url":"https://tttkmbb.com/api/v1/calculate/dca-average-cost?amount_per_period=500&prices=50%2C45%2C40%2C48%2C55"}],"faq":[{"q":"Why is the average cost below the average price?","a":"Each fixed amount buys more units at low prices than at high ones, so low prices get more weight; mathematically the average cost is the harmonic mean, which is ≤ the arithmetic mean unless all prices are equal."},{"q":"Does dollar-cost averaging beat investing a lump sum?","a":"Not on average in rising markets, where investing earlier tends to win; it reduces the regret and timing risk of a single purchase, which is a behavioural rather than a return advantage."}],"tags":["dollar cost averaging","dca","average cost per share","harmonic mean","periodic investing"],"related":[{"calculator_id":"compound-interest","reason":"Project a plan with a constant return instead of listed prices."},{"calculator_id":"stock-profit","reason":"Profit from selling the accumulated units."},{"calculator_id":"cagr","reason":"Annualized return between two values."}],"links":{"html":"https://tttkmbb.com/investing/dca-average-cost","markdown":"https://tttkmbb.com/investing/dca-average-cost.md","json":"https://tttkmbb.com/investing/dca-average-cost.json","api":"https://tttkmbb.com/api/v1/calculate/dca-average-cost","schema":"https://tttkmbb.com/api/v1/calculators/dca-average-cost","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T03:44:39Z"}