Statistical Indicators¶
Statistical indicators apply mathematical and statistical functions to price data to identify trends, measure correlation, and forecast future price movements. These indicators use regression analysis, standard deviation, and other statistical methods.
Available Statistical Indicators¶
Beta (BETA)¶
Measures correlation between a security and the overall market.
Correlation (CORREL)¶
Pearson's Correlation Coefficient between two price series.
Linear Regression (LINEARREG)¶
Fits a linear regression line through price data.
Linear Regression Angle (LINEARREG_ANGLE)¶
Angle of the linear regression line in degrees.
Linear Regression Intercept (LINEARREG_INTERCEPT)¶
Y-intercept of the linear regression line.
Linear Regression Slope (LINEARREG_SLOPE)¶
Slope of the linear regression line.
Standard Deviation (STDDEV)¶
Measures price volatility using statistical standard deviation.
Time Series Forecast (TSF)¶
Projects future prices based on linear regression.
Variance (VAR)¶
Measures price dispersion (variance).
Common Usage¶
require 'sqa/tai'
close = [45.0, 46.0, 45.5, 47.0, 46.5, 48.0, 47.5]
# Linear regression
linearreg = SQA::TAI.linearreg(close, period: 14)
# Standard deviation
stddev = SQA::TAI.stddev(close, period: 14)
# Correlation between two series
correl = SQA::TAI.correl(series1, series2, period: 30)