A pandas DataFrame wrapper for calculating over 70 stock market indicators and statistics with inline column access.
Stockstats is a Python library that provides a pandas DataFrame wrapper for calculating technical indicators used in stock market analysis. It enables developers and quantitative analysts to compute metrics like moving averages, RSI, MACD, and Bollinger Bands directly through DataFrame column access, simplifying the integration of technical analysis into data pipelines.
Quantitative analysts, algorithmic traders, and data scientists working with financial time series data who need to compute technical indicators within a pandas-based workflow.
Developers choose Stockstats for its seamless pandas integration, extensive library of pre-built indicators, and intuitive column-based API that eliminates the need for manual indicator calculation or external charting software.
Supply a wrapper StockDataFrame based on the pandas.DataFrame with inline stock statistics/indicators support.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Includes over 70 pre-built technical indicators covering moving averages, momentum, trend, volatility, and volume, as detailed in the summary table, eliminating the need for manual implementation.
Wraps pandas DataFrames, allowing indicator calculation through intuitive column access patterns like `df['rsi']` or `df['close_20_sma']`, which fits naturally into existing data workflows.
Supports customizable windows and parameters via column naming patterns (e.g., `close_10_ema`) and global settings like `set_dft_window`, enabling fine-tuned analysis without code changes.
Provides utilities for cross-over detection (e.g., `xu`/`xd`) and comparisons (e.g., `ge`/`le`), simplifying the implementation of trading signals directly within the DataFrame.
Relies on pandas, which can be memory-intensive and slow for large datasets or frequent recalculations, as indicators are computed on-demand and stored as new columns.
Using methods like `init_all()` can generate excessive columns, leading to DataFrame bloat and potential confusion, with the README warning to use it 'with caution.'
Adding custom indicators requires modifying the library source code, as there's no plugin system or straightforward API for user-defined calculations beyond the built-in set.
Requires specific column names (close, high, low, volume) in the input DataFrame, necessitating preprocessing for data sources that deviate from this OHLCV structure.