Signals
Donchian Channels
Track the rolling high-low channel used in classic breakout systems.
What it is
Donchian Channels track the rolling highest high, lowest low, and midpoint across a fixed lookback. They are a classic way to frame breakout and trend-following systems.
When to use it
- Building channel-breakout entries and trailing exits.
- Quantifying whether price is pressing fresh highs or fresh lows.
- Comparing current price to the recent range midpoint during trend pullbacks.
The maths
Upper = max(high[t], high[t-1], ..., high[t-N+1]), Lower = min(low[t], ..., low[t-N+1]), Middle = (Upper + Lower) / 2
What it tells you
This is a classic breakout indicator: price closing above the upper Donchian channel is a long signal, while a close below the lower band is a short signal. Turtle Trading famously used 20- and 55-day Donchian channels.
REST example
import os
import requests
response = requests.get(
'https://api.financedata.com/v1/signals/DONCHIAN/GLD',
params={'start_date': '2025-01-01', 'end_date': '2025-04-30', 'period': 20},
headers={'X-API-Key': os.environ['FDA_KEY']},
timeout=30,
)
response.raise_for_status()
print(response.json())MCP example
Tool call body
{
"name": "run_signals",
"arguments": {
"symbols": ["GLD"],
"signal_names": ["DONCHIAN"],
"start_date": "2025-01-01",
"end_date": "2025-04-30",
"signal_parameters": {
"DONCHIAN": { "period": 20 }
}
}
}Donchian output includes upper, mid, and lower, so agents can compare the latest close to the full breakout envelope in one response.
Agent prompt that triggers it
Compute 20-day Donchian Channels for GLD and summarize whether price is threatening a breakout or fading back into the range.