Python: Plot candlesticks with automatic Y zoom

后端 未结 3 568
温柔的废话
温柔的废话 2020-12-17 04:35

I am looking for a Python plotting library that allows me to plot candlesticks (preferably the OHLC bars variant) with X zoom via mousewheel scrolling (or similar) and an au

3条回答
  •  执笔经年
    2020-12-17 04:51

    I struggled with getting the plotly candlestick chart to work the way I wanted to work so I developed a code example to share.

    This does not depend on any additional javascript or other libraries except Dash, Plotly, and a date library called pytz. Example code provides automatic updates to the yaxis range when and x range slider is updated. Y axis is set to show only price range of bars that are in the chart with a two tick padding.

    This worked well for me and I can potentially add any number of trace overlays that I want on top of the chart. Plus, I can run it locally without having to use plotly services. See gitub repo here:

    https://github.com/gersteing/DashCandlestickCharting/blob/master/README.md

    For whom ever wants to try it out. Runs locally using Flask. Enjoy!

提交回复
热议问题