# Dollar-Cost Averaging Strategy Simulator AI Agent Connect

> Simulate a deterministic DCA strategy with valuation-based adjustments.

## Overview
- **Category:** finance
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_o2yhrrIGJCWI4TAAEFhtyMAUXZHknQmvZX3yvFJM/ai-agent-connect
- **Tags:** dca, valuation, pe-ratio, investment-strategy, portfolio-analysis

## Description

This MCP server provides tools to execute and analyze a sophisticated Dollar-Cost Averaging (DCA) strategy. Unlike standard DCA, this implementation uses valuation percentiles to adjust investment amounts: buying more when assets are cheap and less when they are expensive. Use `simulate_dca_strategy` to run full simulations over historical price and valuation series, or `get_valuation_percentile` to determine the current market standing. It also includes `calculate_performance_metrics` to evaluate total returns and average costs.

## Tools

### simulate_dca_strategy
Executes a full simulation of the valuation-adjusted DCA strategy

### calculate_performance_metrics
Computes the core financial outcomes for a completed investment period

### get_valuation_percentile
Calculates the historical standing of a specific valuation point

## Prompt Examples

**Prompt:** 
```
Run a monthly DCA simulation with a $1000 base investment using these prices: [100, 110, 105, 120] and P/E ratios: [15, 16, 14, 18].
```

**Response:** 
```
The simulation is complete. Total invested: $4,000.00. Current value: $4,350.00. Average cost per unit: $102.44. Total return: 8.75%. Lump-sum return: 12.50%.
```

**Prompt:** 
```
What is the historical percentile for a P/E ratio of 20 given the history [15, 18, 22, 25, 30]?
```

**Response:** 
```
The valuation percentile is 40.0.
```

**Prompt:** 
```
Calculate performance for $5000 invested, 100 units held, final price $60, initial price $50, and $5000 total planned.
```

**Response:** 
```
Total invested: $5,000.00. Current value: $6,000.00. Average cost: $50.00. Total return: 20.0%. Lump-sum return: 20.0%.
```

## Frequently Asked Questions

**How does the valuation adjustment work?**
The strategy uses the `get_valuation_percentile` logic to scale investments. If the valuation is in the bottom 25th percentile, it invests 1.5x the base amount. Between 25th and 75th, it invests 1.0x. Above 75th, it invests 0.5x, and above 90th, it stops investing (0x).

**Can I compare my DCA results to a lump-sum investment?**
Yes, the `simulate_dca_strategy` tool provides a `lumpSumReturnPercent` metric, which compares the DCA performance against investing the total planned amount at the initial price point.

**What inputs are required for a simulation?**
To use `simulate_dca_strategy`, you need a price series, a corresponding valuation series (like P/E ratios), the base investment amount, and the investment frequency (e.g., 'weekly' or 'monthly').
