BACK TO CLAUDE SKILLS
◈
calculate_bollinger_bands
IndicatorsBBIndicator
INSTALLATION
$python -c "exec(open('calculate_bollinger_bands.py').read())"
#or paste directly into your Claude Code terminal
[ ABOUT ]
Computes upper band, middle band (SMA), and lower band for the most recent bar using a rolling window of configurable period (default 20) and standard deviation multiplier (default 2). Uses Python's built-in `statistics.stdev` to avoid external dependencies, returning a three-tuple `(upper, middle, lower)` rounded to 4 decimal places.
Bollinger Bands are a volatility measure as much as a momentum indicator — band width expands during high-volatility periods and contracts during low-volatility consolidations. A squeeze (narrow bands) often precedes a significant directional move. Combining band width tracking with `find_breakout_levels` can identify squeeze-and-breakout setups programmatically.
[ USAGE EXAMPLE ]
[ FULL CODE ]
[ METADATA ]
CategoryIndicators
ComplexityBeginner
LanguagePython 3.10+
TagsBB, Indicator
[ ASK CLAUDE ]
Ask AI about this skill before installing it.