Overlap Studies¶
Overlap studies are indicators that are plotted directly on the price chart, "overlaying" the price action. These include moving averages, bands, and envelopes that help identify trends and support/resistance levels.
Available Overlap Indicators¶
Moving Averages¶
- Simple Moving Average (SMA) - Arithmetic average of prices
- Exponential Moving Average (EMA) - Weighted average favoring recent prices
- Weighted Moving Average (WMA) - Linearly weighted average
- Double Exponential Moving Average (DEMA) - Reduced lag EMA
- Triple Exponential Moving Average (TEMA) - Further reduced lag
- Triangular Moving Average (TRIMA) - Smoothed double average
- Kaufman Adaptive Moving Average (KAMA) - Adjusts to volatility
- T3 Moving Average (T3) - Smooth moving average
Bands and Envelopes¶
- Bollinger Bands (BBANDS) - Volatility-based bands
- Adaptive Bollinger Bands (ACCBANDS) - Dynamic bands
Other Overlays¶
- Moving Average (MA) - Configurable MA type
- VWAP - Volume-weighted average price (reference)
Common Usage¶
require 'sqa/tai'
close = [45.0, 46.0, 45.5, 47.0, 46.5, 48.0, 47.5, 49.0, 48.5, 50.0]
# Simple Moving Average
sma = SQA::TAI.sma(close, period: 20)
# Exponential Moving Average
ema = SQA::TAI.ema(close, period: 20)
# Bollinger Bands
upper, middle, lower = SQA::TAI.bbands(close, period: 20)