O'Reilly logo

Matplotlib for Python Developers by Allen Yu, Claire Chung, Aldrin Yim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Integrating more pricing indicators

The candlestick plot in the current form is a bit bland. Traders would usually overlay stock indicators such as average true range (ATR), Bollinger band, commodity channel index (CCI), exponential moving average (EMA), moving average convergence divergence (MACD), relative strength index (RSI), and other various stats for technical analysis.

Stockstats (https://github.com/jealous/stockstats) is a great package for calculating the preceding indicators/stats and much more. It wraps around pandas DataFrames and generate that stats on the fly when they are accessed.

In this section, we can convert a pandas DataFrame to a stockstats DataFrame via stockstats.StockDataFrame.retype(). A plethora of stock indicators ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required