trendln icon indicating copy to clipboard operation
trendln copied to clipboard

How to continue some support or resistance lines?

Open coditori opened this issue 5 years ago • 3 comments

Based on the image, sometimes we need to continue a line which is really close to the last point. As an example here we just missed it on chart.

WhatsApp Image 2020-10-29 at 19 32 43

As you can see I just removed the average lines from the outcome :) and I know there is a list of numbers which we draw them as a line to be support or resistance. The only solution is that to continue plot lines by line slope? or there is a better solution?

coditori avatar Oct 30 '20 15:10 coditori

Could try pd.interpolate() or np.polyfit (with deg=1)

trevorwelch avatar Dec 14 '20 02:12 trevorwelch

Hi @trevorwelch, The problem is not related to df, my dataframe is fine, and trendln returns a matplotlib fig, So can I interpolate a fig?

coditori avatar Dec 16 '20 01:12 coditori

I don't know if this is still usefull, but you will have to change the source code to do this:

I want all lines to continue, what I did is, in the function add_trend placed in plot_support_resistance edit maxx = ln[0][-1]+1 to maxx = len_h. This will let you continue all lines.

If you want to continue only for example the last 4 lines you will have to do more then this... you will have to work with the original maxx value (as is) compare all the lines take the last 4 lines that has the highest maxx and plot these ones with maxx = len_h

good luck

RobinDeeCee avatar Oct 22 '23 10:10 RobinDeeCee