Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does mplfinance support pick_event? #361

Open
lyl1836 opened this issue Mar 20, 2021 · 8 comments
Open

How does mplfinance support pick_event? #361

lyl1836 opened this issue Mar 20, 2021 · 8 comments
Labels
question Further information is requested

Comments

@lyl1836
Copy link

lyl1836 commented Mar 20, 2021

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 lyl1836 added the question Further information is requested label Mar 20, 2021
@lyl1836
Copy link
Author

lyl1836 commented Mar 21, 2021

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

@DanielGoldfarb
Copy link
Collaborator

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().

@lyl1836
Copy link
Author

lyl1836 commented Mar 21, 2021

@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
Copy link
Author

lyl1836 commented Mar 24, 2021

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

@DanielGoldfarb
Copy link
Collaborator

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

@lyl1836
Copy link
Author

lyl1836 commented Mar 24, 2021

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

@DanielGoldfarb
Copy link
Collaborator

DanielGoldfarb commented Mar 25, 2021

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.

@lyl1836
Copy link
Author

lyl1836 commented Mar 25, 2021

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

Happy work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants