matplotlib / matplotlib/mplfinance

Is there a way to plot OHLC figure in mplfinance with live data that isn't in a dataframe format

Open
#91 10 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
4.4k
Forks
678
PR merge metrics
No merged PRs in 30d

Description

Hi,

I am querying an API to get High, low, close, open prices and volume in order to make a chart that is faster/lighter than the one on trading view. I was wondering if I could input raw live data in mplfinance and get it to plot a candlestick chart? Perhaps there is a way to do something that resembles this:

`
open= api_response['open']
high = api_response['max_price']
low = api_response['min_price']
close= api_response['close']
volume = api_response['volume']
xdate = time.strftime("%X", time.gmtime())

daily(xdate,open,high,low,close,volume,width=0.6) # use data that isn't in the dataframe format like in matplotlib
`

I can't seem to get OHLC data in the proper format from the API of the exchange I am using. So I was thinking of getting the live data then plotting it as new information is sent thru the exchanges API within a loop then animating it. I've read issues #17 #25 but they don't seem to cover the format type. Thank you very much for your help and the work you have put in for this project.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing input format for mplfinance and the related discussions in issues #17 and #25. Compare those expectations with the API fields and live-update loop described here; the scope is complete only after the supported input and animation behavior are defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.