mplfinance
Python package of matplotlib utilities to plot candlestick, OHLC, Renko and Point and Figure charts with volume and moving averages from a pandas DataFrame.
Turn a price DataFrame into a clean candlestick chart with volume and moving averages in a single mpf.plot() call.
Who it is for
Python users who want to visualize prices, check backtest signals or add charts to reports and bot alerts.
Strengths
- One call, mpf.plot(), draws OHLC bars, candles, line, Renko or Point and Figure charts from a DataFrame with a DatetimeIndex.
- Volume panel with volume=True and moving averages with the mav keyword.
- Custom studies and extra panels through addplot, with guides for styling, saving plots and real-time animation.
- Installs with pip install --upgrade mplfinance; it needs matplotlib and pandas.
Good to know
- The license is a custom agreement rather than a standard OSI license, so read it before commercial use.
- The last code change on GitHub was in August 2024, so check the repository for current activity.
- The old mpl_finance API is deprecated; old imports must move to mplfinance.original_flavor, which the README says may be removed someday.
- It draws static charts with matplotlib; it is not a data source or a backtesting engine.
Custom bots are coming soon
We are preparing a service to build bots on tools like this one. Follow our Telegram channel to know when it opens.
Real-life uses
A daily candlestick chart of your watchlist sent to your phone
A script downloads daily prices for your watchlist, draws candlesticks with volume and a moving average, and sends the chart image so you can review setups quickly. Illustrative only, never a promise of returns.
Compare it with others
Guides that use it
Quick answers
How much does mplfinance cost?
Free (custom Matplotlib Development Team license agreement, see the LICENSE file). Prices change, so check the official website before you decide.
Is mplfinance open source?
Not under an OSI-approved license. License: Custom license agreement (Matplotlib Development Team).
Who is mplfinance for?
Python users who want to visualize prices, check backtest signals or add charts to reports and bot alerts.
What is mplfinance written in?
mplfinance is written in Python.
What should I know before using mplfinance?
The license is a custom agreement rather than a standard OSI license, so read it before commercial use. The last code change on GitHub was in August 2024, so check the repository for current activity. The old mpl_finance API is deprecated; old imports must move to mplfinance.original_flavor, which the README says may be removed someday. It draws static charts with matplotlib; it is not a data source or a backtesting engine.
Want a bot like this when custom bots open? Get notified · All comparisons · Guides
Sources
Every fact on this page comes from these sources, checked on 2026-12-01. If something has changed, the source wins.
- https://raw.githubusercontent.com/matplotlib/mplfinance/master/README.md: plot types, volume, moving averages, addplot, install, new API versus old mpl-finance
- https://api.github.com/repos/matplotlib/mplfinance: about 4,500 stars, last push 2024-08-08, not archived
- https://raw.githubusercontent.com/matplotlib/mplfinance/master/LICENSE: custom license agreement from the Matplotlib Development Team, not a standard named license
Alternatives in Market data
Binance public data
Free downloadable files with Binance's historical spot and futures market data (klines, trades, aggregated trades), published daily and monthly.
FRED API
REST API from the St. Louis Fed to retrieve economic data series (FRED) and their historical vintages (ALFRED) as JSON or XML.
pandas-datareader
Python library that pulls macroeconomic and factor-style data from public sources such as FRED, Fama/French, the World Bank, OECD and Eurostat straight into a pandas DataFrame.
ta (Technical Analysis Library in Python)
Python library built on Pandas and NumPy that adds 43 technical indicators (volume, volatility, trend and momentum) to a price table with a few lines of code.