ta icon indicating copy to clipboard operation
ta copied to clipboard

KAMA indicator suddenly stops working

Open spitzbubchen opened this issue 2 years ago • 2 comments

The kama indicator works halfway through my data set then suddenly stops giving only NaNs afterwords.

I am using it as:

ta_kama = KAMAIndicator(close=df['close'])
df['kama'] = ta_kama.kama()

The dataframe ['datetime', 'close', 'kama'] where it suddenly stops looks like:

2021-05-03 13:35:00-04:00  3.002  2.992753
2021-05-03 13:40:00-04:00  2.999  2.993588
2021-05-03 13:45:00-04:00  2.998  2.994178
2021-05-03 13:50:00-04:00  3.002  2.995360
2021-05-03 13:55:00-04:00  3.003  2.996577
2021-05-03 14:00:00-04:00  3.009  2.998742
2021-05-03 14:05:00-04:00  3.006  2.999661
2021-05-03 14:10:00-04:00  3.004  3.000128
2021-05-03 14:15:00-04:00  3.002  3.000247
2021-05-03 14:20:00-04:00  3.016  3.001841
2021-05-03 14:25:00-04:00  3.014  3.002630
2021-05-03 14:30:00-04:00  3.013  3.003555
2021-05-03 14:35:00-04:00  3.014  3.004707
2021-05-03 14:40:00-04:00  3.015  3.005644
2021-05-03 14:45:00-04:00  3.015  3.006433
2021-05-03 14:50:00-04:00  3.014  3.006667
2021-05-03 14:55:00-04:00  3.015  3.007326
2021-05-03 15:00:00-04:00  3.011  3.007505
2021-05-03 15:05:00-04:00  3.012  3.007899
2021-05-03 15:10:00-04:00  3.012  3.008188
2021-05-03 15:15:00-04:00  3.009  3.008259
2021-05-03 15:20:00-04:00  3.010  3.008331
2021-05-03 15:25:00-04:00  3.010  3.008449
2021-05-03 15:30:00-04:00  3.012  3.008596
2021-05-03 15:35:00-04:00  3.012  3.008737
2021-05-03 15:40:00-04:00  3.011  3.008830
2021-05-03 15:45:00-04:00  3.011  3.008983
2021-05-03 15:50:00-04:00  3.012  3.009035
2021-05-03 15:55:00-04:00  3.012  3.009047
2021-05-03 16:00:00-04:00  3.009  3.009045
2021-05-03 16:05:00-04:00  3.010  3.009061
2021-05-03 16:10:00-04:00  3.010  3.009065
2021-05-03 16:15:00-04:00  3.007  3.008957
2021-05-03 16:20:00-04:00  3.007  3.008646
2021-05-03 16:25:00-04:00  3.008  3.008585
2021-05-03 16:30:00-04:00  3.007  3.008438
2021-05-03 16:35:00-04:00  3.006  3.008159
2021-05-03 16:40:00-04:00  3.006  3.007767
2021-05-03 16:45:00-04:00  3.009  3.007818
2021-05-03 16:50:00-04:00  3.008  3.007821
2021-05-03 16:55:00-04:00  3.005  3.007574
2021-05-03 18:00:00-04:00  3.007  3.007554
2021-05-03 18:05:00-04:00  3.010  3.007638
2021-05-03 18:10:00-04:00  3.009  3.007664
2021-05-03 18:15:00-04:00  3.007  3.007658
2021-05-03 18:20:00-04:00  3.008  3.007661
2021-05-03 18:25:00-04:00  3.008  3.007668
2021-05-03 18:30:00-04:00  3.008  3.007674
2021-05-03 18:35:00-04:00  3.008  3.007678
2021-05-03 18:40:00-04:00  3.008  3.007679
2021-05-03 18:45:00-04:00  3.008  3.007702
2021-05-03 18:50:00-04:00  3.008  3.007709
2021-05-03 18:55:00-04:00  3.007  3.007580
2021-05-03 19:00:00-04:00  3.007  3.007503
2021-05-03 19:05:00-04:00  3.007  3.007501
2021-05-03 19:10:00-04:00  3.007  3.007278
2021-05-03 19:15:00-04:00  3.007  3.007155
2021-05-03 19:20:00-04:00  3.007  3.007086
2021-05-03 19:25:00-04:00  3.007  3.007048
2021-05-03 19:30:00-04:00  3.007  3.007026
2021-05-03 19:35:00-04:00  3.007  3.007015
2021-05-03 19:40:00-04:00  3.008  3.007019
2021-05-03 19:45:00-04:00  3.008  3.007455
2021-05-03 19:50:00-04:00  3.008  3.007697
2021-05-03 19:55:00-04:00  3.008  3.007832
2021-05-03 20:00:00-04:00  3.008  3.007907
2021-05-03 20:05:00-04:00  3.008  3.007948
2021-05-03 20:10:00-04:00  3.007  3.007944
2021-05-03 20:15:00-04:00  3.006  3.007807
2021-05-03 20:20:00-04:00  3.006  3.007680
2021-05-03 20:25:00-04:00  3.006  3.007562
2021-05-03 20:30:00-04:00  3.006  3.006868
2021-05-03 20:35:00-04:00  3.006  3.006482
2021-05-03 20:40:00-04:00  3.006  3.006268
2021-05-03 20:45:00-04:00  3.006  3.006149
2021-05-03 20:50:00-04:00  3.007  3.006209
2021-05-03 20:55:00-04:00  3.007  3.006264
2021-05-03 21:00:00-04:00  3.008  3.006386
2021-05-03 21:05:00-04:00  3.007  3.006430
2021-05-03 21:10:00-04:00  3.008  3.006640
2021-05-03 21:15:00-04:00  3.008  3.006821
2021-05-03 21:20:00-04:00  3.007  3.006827
2021-05-03 21:25:00-04:00  3.006  3.006824
2021-05-03 21:30:00-04:00  3.007  3.006828
2021-05-03 21:35:00-04:00  3.007  3.006832
2021-05-03 21:40:00-04:00  3.007  3.006833
2021-05-03 21:45:00-04:00  3.007  3.006833
2021-05-03 21:50:00-04:00  3.007  3.006839
2021-05-03 21:55:00-04:00  3.007  3.006840
2021-05-03 22:00:00-04:00  3.007  3.006851
2021-05-03 22:05:00-04:00  3.007  3.006861
2021-05-03 22:10:00-04:00  3.007  3.006862
2021-05-03 22:15:00-04:00  3.007  3.006923
2021-05-03 22:20:00-04:00  3.007       NaN
2021-05-03 22:25:00-04:00  3.007       NaN
2021-05-03 22:30:00-04:00  3.008       NaN
2021-05-03 22:35:00-04:00  3.008       NaN
2021-05-03 22:40:00-04:00  3.008       NaN
2021-05-03 22:45:00-04:00  3.007       NaN
2021-05-03 22:50:00-04:00  3.007       NaN
2021-05-03 22:55:00-04:00  3.006       NaN
2021-05-03 23:00:00-04:00  3.006       NaN
2021-05-03 23:05:00-04:00  3.006       NaN
2021-05-03 23:10:00-04:00  3.006       NaN

spitzbubchen avatar Jul 11 '21 17:07 spitzbubchen

I was wondering if I was using the library in a wrong way, but it looks like I encountered the same bug.

dbkblk avatar Oct 16 '21 14:10 dbkblk

I have the same problem too.

a-Rahmati avatar Mar 12 '22 08:03 a-Rahmati

Please see my PR following this issue https://github.com/bukosabino/ta/pull/303

yarimiz avatar Aug 18 '22 10:08 yarimiz

Bug fixed.

Available on the last version of the library (v0.10.2)

Thanks @yarimiz

bukosabino avatar Aug 23 '22 16:08 bukosabino