Skip to content
Advertisement

Adding arrows to mpf finance plots

I am trying to add an arrow on a given date and price to mpf plot. To do this i have the following code:

JavaScript

But it is producing the following error:

JavaScript

Could you please advise how can i resolve this.

Advertisement

Answer

If your ultimate goal is to add an arrow to the title of the question, you can add it in the way shown in @Daniel Goldfarb’s How to add value of hlines in y axis using mplfinance python. I used this answer to create a code that meets the end goal. As you can see in the answer, the way to do this is to get the axis and then add an annotation for that axis, where 31 is the date/time index and a[0] is the closing price.

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement