--- id: stockstats version: "0.6.8" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # stockstats — DataFrame with inline stock statistics support. License: permissive · Maintenance: active · Downloads: 219.7K/mo ## What it is and what it does stockstats wraps pandas DataFrames to add inline technical analysis indicators commonly used in stock trading and financial analysis. It provides a large library of pre-built indicators—moving averages (SMA, EMA, SMMA, TEMA, LRMA, KAMA, VWMA, DMA), momentum oscillators (RSI, MACD, Stochastic, KDJ, ROC, CMO, KST, Coppock, AO, BOP, CTI, Inertia, PSL), trend indicators (Supertrend, Aroon, Ichimoku, DMI, TRIX, Wave Trend), volatility measures (Bollinger Bands, ATR, CCI, Williams %R, CHOP, KER, Z-Score, MAD, PGO), volume analysis (VR, MFI, PVO, VWMA), and oscillators (QQE, RVGI, ERI, FTR)—plus utility functions for delta, shifts, log returns, and cross-over detection. You initialize it by wrapping a pandas DataFrame containing standard OHLCV columns (close, high, low, volume, optionally date), then access indicators by column name patterns like `df['rsi']` or `df['close_20_sma']`. Indicators are calculated on first access and cached; you can delete a column to force re-evaluation. Multi-line indicators like MACD and Bollinger Bands generate multiple columns at once. The library supports Python 3.9+ and has no compiled dependencies. Use it for: - Build trading signal detection systems by accessing RSI, MACD, or Bollinger Bands to identify overbought/oversold conditions and trend reversals. - Analyze historical stock data with cross-over detection (e.g., golden cross of 10-period and 50-period SMAs) to backtest trading strategies. - Generate multi-indicator dashboards by wrapping pandas data and accessing dozens of indicators with simple column access patterns. - Calculate momentum and volatility metrics (Stochastic RSI, ATR, CCI) for risk assessment and position sizing in algorithmic trading. - Detect trend changes using Supertrend, Aroon, Ichimoku, or DMI indicators to automate entry and exit signals. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds technical analysis indicators and statistics to pandas DataFrames for stock market data, including moving averages, momentum, trend, volatility, and volume calculations. Yes. stockstats is actively maintained, has no security vulnerabilities, low install friction, and a permissive license. It provides a comprehensive, well-documented library of technical indicators for stock analysis. Install it if you need to add technical analysis to pandas-based financial workflows; skip it only if you require indicators not in its supported list or need real-time streaming optimizations. ## Install pip install stockstats uv add stockstats poetry add stockstats ## Installing stockstats Before you install: Low install friction with only numpy and pandas as dependencies. Active maintenance with a recent release on 2026-02-16 and last commit on 2026-06-19; the repository has 1486 stars. License in practice: BSD-3-Clause is permissive and poses no restriction on commercial or private use. Quickstart: pip install stockstats import pandas as pd from stockstats import wrap df = wrap(pd.read_csv('stock.csv')) rsi = df['rsi'] sma_20 = df['close_20_sma'] Requires Python 3.9+. Input DataFrame must contain OHLCV columns: close, high, low, volume (case-insensitive). Verify before relying: - Whether indicator calculations match industry-standard implementations or have known deviations from common trading platforms - Performance characteristics when working with large datasets or real-time streaming data - Accuracy of less common indicators like Ichimoku, Wave Trend, or Quantitative Qualitative Estimation relative to reference implementations ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 219.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags stock technical indicators, pandas stock analysis, RSI MACD Bollinger Bands, trading indicators calculation, stock statistics wrapper, financial data analysis, moving average indicators, technical-analysis, financial-data, trading-indicators [View on SkillFed](https://skillfed.io/packages/stockstats) · [View on PyPI](https://pypi.org/project/stockstats/)