> For the complete documentation index, see [llms.txt](https://excelhelp.windhamlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://excelhelp.windhamlabs.com/functions/exposure-to-loss/maxdd.md).

# MAXDD

## Description

Calculate the maximum drawdown for one or more time series of asset (or portfolio) returns. Maximum drawdown is the measure of peak to through and is typically used as an indicator of downside risk for historical data.

## Syntax

The following describes the function signature for use in Microsoft Excel's formula bar.

```excel-formula
=MAXDD(returns, dataPeriodicity, isAppendIndex)
```

### Input(s)

| Argument            | Description                                                                                                                                                                                                             |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **returns**         | Required. Vector or matrix of time series returns.                                                                                                                                                                      |
| **dataPeriodicity** | <p>Optional. Periodicity of the data, used for annualization. If you do not enter the argument, it defaults to 1. <br><em>e.g. Daily = 255, Monthly = 12,  Yearly = 1, Quarterly = 4.</em></p>                          |
| **isAppendIndex**   | Optional. Logical (TRUE or FALSE), when set to TRUE, the function will append the start and end index positions of the respective max drawdown periods. If not specified, the function defaults this argument to FALSE. |

### Output(s)

The function returns a vector of maximum drawdown estimates, $$mdd$$&#x20;

&#x20;$$\text{output}=\begin{bmatrix}mdd\_1 & mdd\_2 & \ldots & mdd\_N\end{bmatrix}$$&#x20;

When `isAppendIndex` is set to `TRUE`, the function appends the start index, $$p$$ , and end index, $$q$$ , of the corresponding maximum drawdown periods.

$$\text{output}=\begin{bmatrix}mdd\_1 & mdd\_2 & \ldots & mdd\_N \ p\_1 & p\_2 & \ldots & p\_N \ q\_1 & q\_2 & \ldots & q\_N  \end{bmatrix}$$&#x20;

## Example

![](/files/-MMunU659UZpi7CYcujK)

{% file src="/files/-MMunjwTgLENy8PgClAW" %}
Example Workbook: MAXDD
{% endfile %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://excelhelp.windhamlabs.com/functions/exposure-to-loss/maxdd.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
