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 to continue some support or resistance lines? #17

Open
coditori opened this issue Oct 30, 2020 · 3 comments
Open

How to continue some support or resistance lines? #17

coditori opened this issue Oct 30, 2020 · 3 comments

Comments

@coditori
Copy link

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?

@trevorwelch
Copy link

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

@coditori
Copy link
Author

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?

@RobinDeeCee
Copy link

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

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

No branches or pull requests

3 participants