Signals
Bollinger Bands
Frame price with a moving average and volatility bands.
What it is
Bollinger Bands wrap price with an SMA-based middle band and an upper/lower envelope set by a configurable number of standard deviations.
When to use it
- Visualizing expansion and contraction in volatility.
- Spotting potential mean-reversion setups when price stretches to an outer band.
- Combining with momentum indicators to avoid fading strong breakouts too early.
The maths
Middle = SMA(N), Upper = SMA(N) + (k × σ), Lower = SMA(N) - (k × σ) Here σ is the rolling standard deviation of close prices and k = 2 by default.
What it tells you
Price touching the upper band can signal overbought conditions; the lower band can signal oversold conditions. A band squeeze often precedes volatility expansion, while price walking along a band confirms a strong trend.
REST example
python
import os
import requests
response = requests.get(
'https://api.financedata.com/v1/signals/BollingerBands/AAPL',
params={
'start_date': '2025-01-01',
'end_date': '2025-04-30',
'period': 20,
'std_dev': 2.0,
},
headers={'X-API-Key': os.environ['FDA_KEY']},
timeout=30,
)
response.raise_for_status()
print(response.json())MCP example
Tool call body
{
"name": "get_bollinger_bands",
"arguments": {
"symbol": "AAPL",
"start_date": "2025-01-01",
"end_date": "2025-04-30",
"period": 20,
"std_dev": 2.0
}
}Agent prompt that triggers it
Pull Bollinger Bands for AAPL and tell me whether the latest close is near the upper, middle, or lower band.