finplot Documentation

repository·master·Indexed 22 days ago

https://github.com/highfestiva/finplot

A high-performance Python library for financial backtesting visualization. Built on pyqtgraph, it supports plotting large datasets including candlesticks, volume profiles, and technical indicators with synchronized time axes. Designed for desktop use with support for real-time updates and orderbook visualization.

Tokens
409
Snippets
2
Records
3
Agent score
28%

What's inside finplot

  1. Overview of finplot features and limitations

    master

    Features

    • High Performance: Capable of displaying hundreds of thousands of data points; outperforms mpl_finance, plotly, and Bokeh.
    • Financial Focus: Optimized for stocks and cryptocurrencies across any time resolution.
    • Synchronized Views: Multiple charts can share the same time axis, allowing synchronized zooming.
    • Advanced Visuals: Supports overlays, fills between lines, value bands, symbols, labels, legends, volume profiles, and heatmaps.
    • Real-time Support: Can handle real-time updates and orderbook visualization.
    • State Persistence: Automatically reloads the last viewed position upon subsequent runs.

    Limitations

    • Not a Web App: finplot is not intended for building web-based exchanges.
    • No Jupyter Support: It does not work within Jupyter Labs.
    • Desktop-based: It is a desktop plotting library based on pyqtgraph designed primarily for backtesting.
  2. Quickstart: Plotting candlestick charts

    master

    To create a basic candlestick chart, use finplot.candlestick_ochl() with a DataFrame containing Open, Close, High, and Low columns, then call finplot.show() to render the plot. This example uses yfinance to fetch data.

    import finplot as fplt
    import yfinance
    
    df = yfinance.download('AAPL')
    fplt.candlestick_ochl(df[['Open', 'Close', 'High', 'Low']])
    fplt.show()