mplfinance icon indicating copy to clipboard operation
mplfinance copied to clipboard

How does mplfinance support pick_event?

Open lyl1836 opened this issue 3 years ago • 8 comments

Because just learned MPL, MPF, finally understand what you want!

I want to find out other relevant data when the user clicks a bar after MPF draws the K-line graph. The key is to pick_event.

I checked your help and all the cases, and the chart is generated by "plot". But picker is not supported in "plot"!

My question now is:

How to support “picker” in mplfinance?
Can you provide an example?

lyl1836 avatar Mar 20 '21 10:03 lyl1836

I want to use pick_event, but plot doesn't support picker. Is there a way?

lyl1836 avatar Mar 21 '21 01:03 lyl1836

I don't know much about "picking", but it seems to me that mplfinance may need changes in order to support picking.

I will try to make time, later this week, to to read through the picking tutorial and see if I can think of any way you can do it without the need to change mplfinance, or if I can think of an easy way to support picking in mpf.plot().

DanielGoldfarb avatar Mar 21 '21 03:03 DanielGoldfarb

@DanielGoldfarb : Thank you very much!

I have tested in detail that mplfinance supports common mouse events, such as figure_ enter_ event、figure_ leave_ event、axes_ enter_ event、axes_ leave_ event、button_ press_ Event. These events do not require plot to pass parameters.

But pick_ Event needs to pass in picker in plot, so it is not supported!

Looking forward to your good news!

lyl1836 avatar Mar 21 '21 05:03 lyl1836

@DanielGoldfarb : Mplfinance has a flexible way to support pick_ Event?

lyl1836 avatar Mar 24 '21 00:03 lyl1836

@lyl1836 Mplfinance will need to be enhanced to support pick_event.

DanielGoldfarb avatar Mar 24 '21 01:03 DanielGoldfarb

How to enhance it? Do you need to improve the function of mplfinance?

lyl1836 avatar Mar 24 '21 07:03 lyl1836

It seems to me that mpf.plot() and mpf.make_addplot() will need to accept picker= as a kwarg, and then pass that picker on to the calls that they make to create the Artist objects on the plot.

If you are familiar with the fork and clone workflow you are welcome to try making this enhancement yourself.

I like the idea of supporting object picking in mpflinance, but I do not expect to have time to work on it for at least 3 months.

DanielGoldfarb avatar Mar 25 '21 16:03 DanielGoldfarb

Thank you for your guidance! I'm not familiar with the workflow of fork and clone. Try it while learning!

Happy work!

lyl1836 avatar Mar 25 '21 17:03 lyl1836