mplfinance icon indicating copy to clipboard operation
mplfinance copied to clipboard

SL and TP line

Open anncoin opened this issue 4 years ago • 3 comments

Good morning, I'm something new using the mplfinance library .... is there a way to draw a line on the graph to identify the SL and TP calculated in% by the closing of the last bar?

anncoin avatar May 04 '21 20:05 anncoin

You will want to use the hlines kwarg, explained here: https://github.com/matplotlib/mplfinance/blob/master/examples/using_lines.ipynb

However you will have to calculate the values yourself and pass them into mpf.plot() using the hlines kwarg.

Hope that helps.

DanielGoldfarb avatar May 05 '21 01:05 DanielGoldfarb

thank you very much, i will try

anncoin avatar May 05 '21 18:05 anncoin

ice_aapl_us i did it already. SL is the red line, and TP1/2 are the blue ones. Was this similar to your idea?

fxhuhn avatar Dec 18 '21 11:12 fxhuhn