oransel / node-talib

A technical analysis library for node.js
GNU Lesser General Public License v3.0
904 stars 149 forks source link

linearreg_angle doesn't work with time periods superior to 1000 #95

Closed Byvirven closed 1 year ago

Byvirven commented 3 years ago

Hi,

I'm trying to use the linearreg_angle function with time periods superior to 1000 and, unfortunately, the result is stuck with the value undefined when I use any period superior to 1000.

Is it an undocumented limitation or a bug ?

It's boring because I use several time periods to confirm or invalidate my super trends with 1 minutes candles.

Thanks.

Byvirven commented 3 years ago

After going through C source code, it seems that the limit should be 100000 and not 1000. So, I think it's a bug. Will continue to explore the code.

https://github.com/oransel/node-talib/blob/8a605ff6f75e6342d107cbf4a187cc8090ea32ab/src/lib/src/ta_func/ta_LINEARREG_ANGLE.c#L274

Byvirven commented 3 years ago

Same problem with all linear regression functions, Bollinger bands and MACD.