# Max Drawdown Calculator MCP for AI Agents AI Agent Connect

> Max Drawdown Calculator lets your AI client analyze historical price data to spot investment risks. It identifies the biggest percentage drops, tracks how long it takes for assets to bounce back, and measures the psychological stress of price swings. Use it to get a clear picture of historical volatility and current market positions.

## Overview
- **Category:** finance
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_V7TMwyQ19Ovx5ibgmvTg0hATZ3YbBTXoBcQXnRFx/ai-agent-connect
- **Tags:** drawdown, volatility, finance, risk, investment, metrics

## Description

Analyzing portfolio risk means dealing with the reality of price swings. You need to know not just how much you made, but how much you lost at your worst point and how long you sat in the red. This Connector handles the heavy lifting of calculating those risk metrics so you can make better decisions without getting bogged down in manual math. Instead of manually digging through spreadsheets to find a peak or a trough, you can just ask your agent to run the numbers for you. It looks at your historical price data and pulls out the specific data points that matter for risk assessment. You can see your worst-case decline, figure out your average recovery time, and even get a sense of the accumulated psychological stress your portfolio has endured over time. Because it's hosted on the Vinkius catalog, you can plug it into your existing workflow and get these insights instantly. It turns raw price history into a clear risk profile, helping you see if your current position is actually healthy or just lucky. Whether you are reviewing a long-term investment or a volatile short-term trade, you get a clear picture of the historical volatility and your current standing against previous highs.

## Tools

### calculate_max_drawdown
This tool identifies the single worst percentage decline and its duration. It helps you see the true depth of a market crash.

### calculate_ulcer_index
This tool provides a single metric representing the accumulated psychological stress of a price series. It helps you quantify the pain of your investment history.

### get_current_drawdown_status
This tool compares the most recent market state against historical highs. It tells you exactly how far you are from your peak.

### calculate_recovery_metrics
This tool analyzes how long it takes for assets to bounce back after losing value. Use it to understand your portfolio's resilience.

## Prompt Examples

**Prompt:** 
```
What was the worst drop for this price list: [{'timestamp': '2023-01-01', 'value': 100}, {'timestamp': '2023-01-02', 'value': 80}, {'timestamp': '2023-01-03', 'value': 90}]?
```

**Response:** 
```
**Analysis Results:**

*   **Maximum Drawdown:** 20.0%
*   **Start Price:** 100
*   **Trough Price:** 80
*   **Duration:** 1 day

The asset experienced a sharp 20% decline immediately following the start of the series.
```

**Prompt:** 
```
Calculate the Ulcer Index for these prices: [{'timestamp': '2023-01-01', 'value': 100}, {'timestamp': '2023-01-02', 'value': 90}, {'timestamp': '2023-01-03', 'value': 85}]
```

**Response:** 
```
Based on the price history provided, here is the stress analysis:

| Metric | Value |
| :--- | :--- |
| **Ulcer Index** | **7.54** |

This score represents the accumulated psychological stress of the price swings in this period.
```

**Prompt:** 
```
Is the price of 105 near the peak for this history: [{'timestamp': '2023-01-01', 'value': 110}, {'timestamp': '2023-01-02', 'value': 105}]?
```

**Response:** 
```
No, the current price is not at an all-time high. 

*   **Current Price:** 105
*   **Historical Peak:** 110
*   **Current Drawdown:** 4.55%

You are currently down 4.55% from the highest point in this series.
```

## Capabilities

### Identify largest percentage drops
Find the single biggest decline in a price series and how long it lasted.

### Calculate recovery time
See how many periods it takes for an asset to return to its previous peak.

### Check current drawdown status
Compare your current price against the all-time high to see your current loss percentage.

### Measure psychological stress
Get a single score representing the accumulated stress of your price history.

### Analyze historical volatility
Turn raw price lists into a clear risk profile for any investment.

## Use Cases

### Evaluating a crypto dip
A trader wants to know if a 20% dip is normal for a specific coin. They ask the agent to run calculate_max_drawdown on the last 3 years of data.

### Client risk reporting
A fund manager needs to report on stress for a client. They use calculate_ulcer_index to compare two different assets.

### Checking current standing
An investor wants to see if they are currently in a drawdown. They ask the agent to check get_current_drawdown_status against the historical high.

### Recovery time analysis
A researcher wants to see how fast a stock recovers. They use calculate_recovery_metrics to find the average bounce-back time.

## Benefits

- Stop guessing your risk levels by using calculate_max_drawdown to see the true worst-case scenario for any asset.
- Understand your recovery speed with calculate_recovery_metrics to plan better exit and entry points for your trades.
- Get an instant pulse on your current position using get_current_drawdown_status instead of checking peaks manually.
- Quantify the pain of your portfolio with calculate_ulcer_index to see how volatile your strategy actually is.
- Turn raw price lists into actionable risk reports without moving data into a separate spreadsheet or tool.
- Identify structural failures in your portfolio by analyzing historical bounce-back durations.

## How It Works

The bottom line is you get instant, accurate risk metrics from raw price data without doing the math yourself.

1. Provide your agent with a list of historical prices or a price series.
2. Specify which risk metric you want to see, like the maximum drawdown or the Ulcer Index.
3. Get a clear breakdown of the losses, recovery times, or stress levels.

## Frequently Asked Questions

**What is the Max Drawdown Calculator for?**
It helps you analyze the risk of an investment by identifying the largest price drops and how long those drops lasted in your historical data.

**How does Max Drawdown Calculator help with risk?**
It provides concrete metrics like the Ulcer Index and recovery times, allowing you to see the actual volatility and stress of a portfolio rather than just the final return.

**Can I use Max Drawdown Calculator for crypto?**
Yes, it is perfect for high-volatility assets like cryptocurrencies where understanding the depth of a crash and the speed of a recovery is vital for strategy.

**What is the Ulcer Index in Max Drawdown Calculator?**
The Ulcer Index is a single score that measures the 'pain' of your investment. It looks at the depth and duration of all drawdowns to show how much stress the asset caused.

**Does Max Drawdown Calculator provide live prices?**
No, this Connector processes the price data you provide. You can feed it a list of historical prices to get a full risk analysis of that specific period.

**How do I get recovery metrics?**
You can ask your agent to calculate recovery metrics for a price series. It will tell you exactly how long it took for the asset to bounce back to its previous peak.

**What is the purpose of the `calculate_max_drawdown` tool?**
It identifies the single largest percentage drop from a peak to a trough within your provided price series.

**How can I measure investment stress?**
You can use the `calculate_ulcer_index` tool, which quantifies the depth and duration of drawdowns to represent accumulated psychological stress.

**Can I check if my asset is currently at an all-time high?**
Yes, the `get_current_drawdown_status` tool compares the most recent price in your series to the historical peak.