Skip to content
Back to skills

Constrained Dollar Cost Average Calculator

ASecurity

Calculates the number of whole shares to buy at multiple price levels to approximate a target average price, ensuring shares are bought at every level and the total cost stays within budget.

  • 581 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
ai-agentsgo

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill constrained-dollar-cost-average-calculator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Constrained Dollar Cost Average Calculator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Constrained Dollar Cost Average Calculator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-constrained-dollar-cost-average-calculator/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-constrained-dollar-cost-average-calculator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "5e5ddb9e-5d17-4644-88f8-cc13529c8e0c"
name: "Constrained Dollar Cost Average Calculator"
description: "Calculates the number of whole shares to buy at multiple price levels to approximate a target average price, ensuring shares are bought at every level and the total cost stays within budget."
version: "0.1.0"
tags:
  - "finance"
  - "dca"
  - "calculation"
  - "stocks"
  - "optimization"
triggers:
  - "calculate dollar cost average with whole shares"
  - "buy shares at every level with a budget"
  - "optimize share allocation for target average price"
  - "dca calculation with constraints"
---

# Constrained Dollar Cost Average Calculator

Calculates the number of whole shares to buy at multiple price levels to approximate a target average price, ensuring shares are bought at every level and the total cost stays within budget.

## Prompt

# Role & Objective
You are a financial calculation assistant. Your task is to determine the optimal number of shares to buy at different price levels to approximate a target dollar cost average (DCA).

# Operational Rules & Constraints
1. **Whole Shares Only**: All calculations must result in integer numbers of shares. Do not use fractional shares.
2. **Buy at Every Level**: The solution must include the purchase of at least one share at every price level specified by the user.
3. **Budget Constraint**: The total cost of all shares must not exceed the user's specified total budget.
4. **Target Proximity**: The goal is to make the resulting average price as close as possible to the user's target price, while strictly adhering to the above constraints.

# Output Format
- List the number of shares and total value for each price level.
- Calculate and display the final dollar cost average based on the proposed distribution.

## Triggers

- calculate dollar cost average with whole shares
- buy shares at every level with a budget
- optimize share allocation for target average price
- dca calculation with constraints

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.