🌐
PyPI
pypi.org › project › stockstats
stockstats · PyPI
February 16, 2026 - DataFrame with inline stock statistics support.
      » pip install stockstats
    
Published   Feb 16, 2026
Version   0.6.8
🌐
PRCA Sports News
prorodeo.com › stock
PRCA Sports News
The PRCA is the number one official source for rodeo news, events, schedules, past results and other rodeo-related information. Visit PRCA now!
Discussions

Has anybody used the stockstats module , I can't get Talib to work.
I’m currently using the module and don’t have issues getting data from it. What kind of error do you get? More on reddit.com
🌐 r/algotrading
20
1
January 9, 2020
python - How can i see MACD signal by using stockstats? - Stack Overflow
I'm trying to draw a Macd indicator. I am using stockstats to draw it. But I can only see the Macd value.(and can not add it to csv file if you help me to add it too I'll be glad) how can i see More on stackoverflow.com
🌐 stackoverflow.com
stock analysis tool
🌐 r/dataengineering
2
4
May 7, 2025
What websites do you use for fundamental analysis?
Stockanalysis.com Simply Wall St Investopedia Valuehunter.net More on reddit.com
🌐 r/ValueInvesting
41
63
June 13, 2024
🌐
GitHub
github.com › jealous › stockstats › blob › master › stockstats.py
stockstats/stockstats.py at master · jealous/stockstats
Supply a wrapper ``StockDataFrame`` based on the ``pandas.DataFrame`` with inline stock statistics/indicators support. - jealous/stockstats
Author   jealous
🌐
Medium
medium.com › @science4trading › introduction-to-stockstats-and-performance-of-some-key-indicators-d1af7274dde
Introduction to Stockstats and Performance of Some Key Indicators | by TradingScience | Medium
August 11, 2023 - Stockstats is a Python library designed to facilitate stock data manipulation. It streamlines the process of calculating common stock indicators, sparing analysts and traders the need to implement these algorithms from scratch.
🌐
Towards Data Science
towardsdatascience.com › home › latest › stockstats – a handy, stocks-oriented pandas dataframe wrapper
Stockstats - a handy, stocks-oriented pandas DataFrame wrapper | Towards Data Science
March 5, 2025 - It is a wrapper library on top of a pandas DataFrame and its main goal is to provide instantaneous access to a variety of measures and technical indicators related to stock prices.
🌐
Medium
medium.datadriveninvestor.com › simplify-your-stock-analysis-with-this-python-library-f86a7208b3d8
Simplify Your Stock Analysis with this Python Library | by Himanshu Sharma | DataDrivenInvestor
March 27, 2024 - Stockstats, is a Python library that serves as a wrapper for Pandas data frames, offering a wide range of basic stock information and advanced technical indicators. With Stockstats, you can effortlessly access an array of technical indicators ...
Find elsewhere
🌐
GitHub
github.com › jealous › stockstats › issues
jealous/stockstats
Supply a wrapper ``StockDataFrame`` based on the ``pandas.DataFrame`` with inline stock statistics/indicators support. - jealous/stockstats
Author   jealous
🌐
NYC Data Science Academy
nycdatascience.com › home › student works › r visualization › stockstats: a shiny web app for investors
StockStats: A Shiny Web App for Investors | Data Science Blog
May 29, 2021 - The idea behind StockStats is to build a web app that enables everybody with Internet access to build dashboards with statistical analyses and visualizations of stocks.
🌐
piwheels
piwheels.org › project › stockstats-polars
piwheels - stockstats-polars
November 9, 2025 - The piwheels project page for stockstats-polars: Namespace extension of Polars with stock statistics/indicator calculation helper
🌐
GitHub
github.com › jealous › stockstats › actions
Workflow runs · jealous/stockstats
Supply a wrapper ``StockDataFrame`` based on the ``pandas.DataFrame`` with inline stock statistics/indicators support. - Workflow runs · jealous/stockstats
Author   jealous
🌐
Baseball-Reference.com
baseball-reference.com › br home page › major league players › s listing
Robert Stock Stats, Height, Weight, Position, Rookie Status & More | Baseball-Reference.com
Check out the latest Stats, Height, Weight, Position, Rookie Status & More of Robert Stock. Get info about his position, age, height, weight, draft status, bats, throws, school and more on Baseball-reference.com
🌐
The Financial Express
financialexpress.com › home › market › stock market stats
Stock Market Live: BSE, NSE Share Price Live, Indian Stock Market Today News, NSE/ BSE Gainers and Losers, Sensex Share Price, Nifty Share Price Live | The Financial Express
2 days ago - Stock Market Live: Get live BSE/NSE sensex share price, top gainers and losers stocks, volume shockers, historical returns, stock exchange and trading, indian stock market today news and much more on Financial Express.
Top answer
1 of 1
4

MACD_EMA_SHORT is only a class method

  • you can't get it, unless you update the class
    • you need to return fast = df[ema_short]
  • MACD_EMA_SHORT is a parameter used for a calculation in _get_macd
    • MACD_EMA_SHORT = 12
    • ema_short = 'close_{}_ema'.format(cls.MACD_EMA_SHORT)
    • ema_short = 'close_12_ema'
class StockDataFrame(pd.DataFrame):
    OPERATORS = ['le', 'ge', 'lt', 'gt', 'eq', 'ne']

    # Start of options.
    KDJ_PARAM = (2.0 / 3.0, 1.0 / 3.0)
    KDJ_WINDOW = 9

    BOLL_PERIOD = 20
    BOLL_STD_TIMES = 2

    MACD_EMA_SHORT = 12
    MACD_EMA_LONG = 26
    MACD_EMA_SIGNAL = 9
    @classmethod
    def _get_macd(cls, df):
        """ Moving Average Convergence Divergence
        This function will initialize all following columns.
        MACD Line (macd): (12-day EMA - 26-day EMA)
        Signal Line (macds): 9-day EMA of MACD Line
        MACD Histogram (macdh): MACD Line - Signal Line
        :param df: data
        :return: None
        """
        ema_short = 'close_{}_ema'.format(cls.MACD_EMA_SHORT)
        ema_long = 'close_{}_ema'.format(cls.MACD_EMA_LONG)
        ema_signal = 'macd_{}_ema'.format(cls.MACD_EMA_SIGNAL)
        fast = df[ema_short]
        slow = df[ema_long]
        df['macd'] = fast - slow
        df['macds'] = df[ema_signal]
        df['macdh'] = (df['macd'] - df['macds'])
        log.critical("NOTE: Behavior of MACDH calculation has changed as of "
                     "July 2017 - it is now 1/2 of previous calculated values")
        cls._drop_columns(df, [ema_short, ema_long, ema_signal])

Update:

  • find stockstats.py, then in def _get_macd(cls, df), comment out cls._drop_columns(df, [ema_short, ema_long, ema_signal]) (e.g. put # in front of it)
  • Then you can do stock['close_12_ema']

Code to get the table:

periods = '3600'
resp = requests.get('https://api.cryptowat.ch/markets/poloniex/ethusdt/ohlc', params={'periods': periods})
data = resp.json()
df = pd.DataFrame(data['result'][periods], columns=['date', 'open', 'high', 'low', 'close', 'volume', 'amount'])
df['date'] = pd.to_datetime(df['date'], unit='s')

stock = sdf.retype(df)
print(stock['macds'])

print(stock)
  • The extra columns don't get added until you do stock['macds'].

OUtput:

                           open        high         low       close      volume        amount  close_12_ema  close_26_ema      macd  macd_9_ema     macds     macdh
date                                                                                                                                                               
2019-08-20 00:00:00  201.000000  203.379326  201.000000  202.138224  349.209128  70720.937575    202.138224    202.138224  0.000000    0.000000  0.000000  0.000000
2019-08-20 01:00:00  202.187160  202.650000  200.701061  200.778709  329.485014  66411.899720    201.401820    201.432322 -0.030502   -0.016946 -0.016946 -0.013556
2019-08-20 02:00:00  201.200000  201.558777  200.133667  200.338312   12.812929   2572.209909    200.986733    201.039255 -0.052522   -0.031526 -0.031526 -0.020996
2019-08-20 03:00:00  200.915590  201.177018  200.396571  200.440000   21.910910   4395.692727    200.814151    200.871730 -0.057579   -0.040352 -0.040352 -0.017227
2019-08-20 04:00:00  200.979999  200.979999  198.282603  198.644618  360.432424  71712.376256    200.224696    200.355253 -0.130557   -0.067186 -0.067186 -0.063371
🌐
Financequotes-api
financequotes-api.com › javadoc › yahoofinance › quotes › stock › StockStats.html
StockStats (YahooFinanceAPI 3.17.0 API)
public StockStats(String symbol) public BigDecimal getROE() public String getSymbol() public BigDecimal getMarketCap() public void setMarketCap(BigDecimal marketCap) public Long getSharesFloat() public void setSharesFloat(Long sharesFloat) public Long getSharesOutstanding() public void setSharesOutstanding(Long sharesOutstanding) public Long getSharesOwned() public void setSharesOwned(Long sharesOwned) public BigDecimal getEps() public void setEps(BigDecimal eps) public BigDecimal getPe() public void setPe(BigDecimal pe) public BigDecimal getPeg() public void setPeg(BigDecimal peg) public BigD
🌐
Maxieewong
maxieewong.com › Stockstats.html
Stockstats - Maxiee Blog
基于 pandas.DataFrame 封装出一个 StockDataFrame,包含了股票相关的统计、技术指标。 · 包含的技术指标如下: