furechan / mplchart

Classic Stock Charts in Python
MIT License
22 stars 6 forks source link

Creating chart arrays #3

Closed Ajith-82 closed 10 months ago

Ajith-82 commented 1 year ago

Hi,

Thank you for the excellent plotting module. While I’ve successfully used it to plot technical indicators for individual stocks, I’m struggling to figure out how to create multiple stock charts in a single plot. Currently, my workaround involves saving individual charts as images and then stitching them together into a single image. Is there a more efficient solution you could recommend?

Thanks, Ajith

furechan commented 1 year ago

Hi Ajith,

Right now there is no easy way to combine data from multiple stocks. I will try to see if there is a way to call the plot function multiple times and have it to combine their data. If I find a way I'll post back here ...

Thanks

Ajith-82 commented 1 year ago

Hi,

Thank you for the update.

furechan commented 11 months ago

Hi Ajith,

I looked into this a little further. The latest release adds a way to plot multiple assets in the same chart. This is a tentative solution.

chart = Chart(title="Versus", max_bars=max_bars, style=style)
chart.plot(data1, [ Candlesticks(), Volume(), RSI(), MACD() ] )
chart.plot(data2, [ Price() ] , target='main')

You can add replace=True in the second plot to have the prices rebased to the first series.

Example in examples/multiple-plots.ipynb

Ajith-82 commented 10 months ago

Hi,

Thank you very much. I really appreciate your help.

furechan commented 10 months ago

Glad it was helpful.