TA-Lib / ta-lib-python

Python wrapper for TA-Lib (http://ta-lib.org/).
http://ta-lib.github.io/ta-lib-python
Other
9.27k stars 1.72k forks source link

Expected float got int BBANDS and other indicators #588

Closed quantfreedom closed 1 year ago

quantfreedom commented 1 year ago

here is a video of me explaining what is happening ... but the overall idea is that in the documentation there are times where it is stated that the default value is a 2 which is an int .. and when you look up the info using the info function it also comes up as a 2 which is an int ...

image

but things like the bbands have upperband, middleband, lowerband = BBANDS(close, timeperiod=5, nbdevup=2, nbdevdn=2, matype=0) which clearly shows nbdevdn and up as ints ...

so if we write a program that is grabbing those default values and trying to pass them to the indicator function we get an error ....

also it is impossible for users to know what needs to be a float and what needs to be an int because in the documentation and info for the ind there is no mention of what needs to be an int or float ....

if possible could you update at least the info function to reflect what needs to be an int and what needs to be a float because without this information it could be a nightmare trying to write code that uses the default values in the info section

... instead of the info showing a 2 for both up and dn could you please make it show 2.0

also i just realized this only happens when you run functions through the abstract function method ... i really really need this to work on the abstract function because i am sending a DF image

https://www.loom.com/share/68dcc57b5ef941deaf861d9aa94fb307

quantfreedom commented 1 year ago

Hey ... wanted to check back in with this

mrjbq7 commented 1 year ago

Fixed in current master branch, unreleased 0.4.27

mrjbq7 commented 1 year ago

Thanks for the reminder, forgot to look into this.