matplotlib / mplfinance

Financial Markets Data Visualization using Matplotlib
https://pypi.org/project/mplfinance/
Other
3.48k stars 613 forks source link

how to get OHLC return values and trend from renko plot #645

Closed sreevardhanreddi closed 9 months ago

sreevardhanreddi commented 9 months ago

I have gone through the docs here and I get the Renko bricks and Renko volume data, is there a way I can get the OHLC values for renko chart and the direction of trend (uptrend/downtrend) ?

thank you

DanielGoldfarb commented 9 months ago

is there a way I can get the OHLC values for renko chart and the direction of trend (uptrend/downtrend)

Don't know what you are getting at with OHLC values ... renko uses close prices only, and the results are brick values, all of which have the same brick size. Brick values and brick size are both returned.

Regarding up/down trend, moving averages are also returned and you can easily determine trends from these.

Perhaps you want to know the OHLC of the actual brick values for a given date? This may be possible when there are multiple brick values for the same date. You may be able to use resampling (https://github.com/matplotlib/mplfinance/wiki/Resampling-Time-Series-Data-with-Pandas#1-single-time-series-value-to-ohlc-data) to get what you want. Not sure I understand why anyone would want to see renko brick ohlc values. Keep in mind: (1) when there is a single brick on a date, then O==H==L==C, and (2) when there are no bricks on a given date, then O=H=L=C=nan.