matplotlib / mplfinance

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

Volume candlestick #465

Open satishchaudhary382 opened 2 years ago

satishchaudhary382 commented 2 years ago

Is your feature request related to a problem? Please describe. I am trying to plot the candlestick chart with width of candlestick as a 5th dimension.

Describe the solution you'd like I was wondering if there is any way possible to modify the width of candlestick as the size of volume.

A detailed view for reference image https://school.stockcharts.com/doku.php?id=chart_analysis:candlevolume

DanielGoldfarb commented 2 years ago

An interesting request. I can imagine how I might code this. The chart definitely looks cool, but I would need to be convinced of its utility in making trade decisions. It is clear that the x-axis is not linear with time. In fact, it is not purely time at all, but rather the x-axis is time multiplied by some factor that is proportional to volume.

Some candle patterns (for example a reversal pattern) carry "more weight" on higher volume. Such patterns can be made somewhat more obvious by making the candle width proportional to volume. None-the-less, one can still easily see the alignment of volume with a particular pattern by simply plotting the volume below the candles. There is no need to distort the time axis. And my concern is that distorting the time axis will also distort the slope of any trends. (That said, Renko and Point-and-Figure charts also distort the time axis, and many traders rely on them to support their trade decissions.)

I've skimmed through this article, but it did not convince me that distorting the time axis in this way will improve the quality of trade decisions any more than simply plotting volume in line with the candles. I am open to being convinced. Perhaps you know (or can point towards) how this is better than just plotting volume (other than the fact that it looks really cool!)