Drawdown Node

Running Drawdown from Peak

StatisticalRisk

Overview

The Drawdown Node computes the running drawdown from peak for each bar. It tracks the maximum value seen so far and expresses the current value as a fractional decline from that peak.

A value of 0 means the series is at or above all previous highs. A value of −0.20 means the series is 20% below its running peak — a 20% drawdown.

Formula

runningPeak[i] = max(values[0…i])
drawdown[i] = −(runningPeak[i] − values[i]) / runningPeak[i]
Output values are ≤ 0. 0 = at peak; −1 = 100% drawdown (value reached zero). Requires positive non-zero input values.

Inputs & Outputs

SlotDirectionTypeDescription
inputInput{ values, timestamps }Any positive numeric series (equity curve, price, NAV)
valuesOutput(number | null)[]Drawdown fraction per bar (≤ 0); no warm-up required
timestampsOutputnumber[]Unix timestamps aligned to input

Use Cases

Equity Curve Monitoring

Visualise the running drawdown of a strategy's equity curve to identify periods of capital erosion.

Stop-Loss Trigger

Stop trading when drawdown exceeds a threshold (e.g. −0.10 = 10%) to preserve capital.

Risk Metric Input

Feed into Calmar or other risk-adjusted return nodes that require a drawdown series.

Tips & Best Practices

No Parameters Needed

Drawdown uses the entire history from the first bar — no period parameter required. Every bar from bar 1 has an output.

Positive Values Only

The input must contain only positive values (e.g. prices, equity NAV). Log returns or spreads may produce zero/negative inputs that break the formula.

Running vs Rolling

Drawdown uses the all-time peak. For a windowed maximum drawdown, use the Rolling Max Drawdown Pass node instead.

Related Indicators