Open dchhetri opened 4 years ago
Hello, thanks for the report and feedback! Can you tell me the version of Python and numpy you are using? The METHOD_HOUGHPOINTS error looks easy to sort out probably just need an int() cast or change 2.0 to 2. The first one also looks like a relatively easy fix as long as its backwards compatible. My suspicion is this could be broken in the latest python versions that I have not used yet.
As for weighted volume, I don't see why it is not supported, simply pass the already weighted volume to the library and it should return the support and resistance lines for it. If you mean the plotting of it, then yes its a good request and the plotting area need some rewriting anyway based on other requests too and the way it should not chain to the main library function but instead let you specify what from that you want to display. Displaying volume should be straight forward for inclusion in next version.
For streams of data, probably a small helper function is likely needed. Since there is a window size, all you have to do is pass the new data plus a window size preceding the new data, and then just merge the trend lines with the ones you already have. But I can add a function which takes the old trend line data, the final window of that trendline data, as well as new data and simply returns the trend line set again. Although not stream lined for this use, it should not be hard to do, but yes merging the trend line code is already in there and not really accessible for this purpose. I will consider this for the next version for sure.
I had the same issue as @dchhetri and changing the 2.0 to 2 in line
{ rhos = np.linspace(-diag_len, diag_len, diag_len * 2.0) }
Worked!
Thank you @GregoryMorse !! I have really enjoyed this package. I believe it is an issue with numpy versions because I switched to my Mac from my PC anaconda environment and the same code started producing the error on my Mac.
I want to first thank you for this contribution. This library is great.
I am using
Python 3.7.5
Using
extmethod=METHOD_NAIVECONSEC
throws the following errorUsing
method=trendln.METHOD_HOUGHPOINTS
throws the following errorFurthermore, I'm wondering if you're open to taking feature request like more efficient calculation given stream of data?