trendln icon indicating copy to clipboard operation
trendln copied to clipboard

Support/Resistance lag

Open abdullahtk opened this issue 4 years ago • 4 comments

Hello @GregoryMorse , Thank you for the great work.

After several months of playing and using the library, I found that when calculating support and resistance, most of the times it doesn't calculate the last day/minute points. Let say that I'm using daily data and calculating support and resistance on the high/low. Let's also say that last day is having long tail. When calculating S/R, it doesn't show that as a support. However, when we have a new data for the next day, the library shows the long tail as a support point as seen below:

Screen Shot 2020-12-04 at 1 28 19 PM This is when calculating the S/R until the second to last data points. As you can see there is no support line here.


Screen Shot 2020-12-04 at 1 28 57 PM This is when calculating S/R with the last data points and now there is a support line for the previous day (long tail)

Can you explain why is this happening? also, is there a way to fix this?

Thank you again for this great library.

abdullahtk avatar Dec 04 '20 10:12 abdullahtk

I saw your email and I am responding. After thinking about it, yes you are right this is a problem. Because to be a "maxima" or "minima" it is assumed that the peaks and troughs are occurring in the middle. However, I realize this is a very legitimate practical problem and should be fixed. Its not the trend line functions, but the get_extrema like functions causing the issue. An option should be added for this. Likely its only needs at the tail of the data, not the beginning of it but why not give both options. This is a great point and thanks for the request, it will be added.

GregoryMorse avatar Dec 17 '20 04:12 GregoryMorse

Thank you for your reply. I can't wait for that addition

abdullahtk avatar Dec 18 '20 16:12 abdullahtk

any updates regarding this? This looks like a rather promising project!

berlinguyinca avatar Feb 17 '21 03:02 berlinguyinca

Perhaps you could do some forecasting to pad the end with the expected price movements after which get_extrema should be able to locate a min/max point

JeffStodd avatar Jun 05 '21 06:06 JeffStodd