-1

i am making a bot using TA-Lib and iqoptionapi by following This Tutorial.

I follow everything he did but when i run the python code it gives me this error:

Traceback (most recent call last):
  File "c:\Users\%USERNAME%\Desktop\for Test Python\Test Python Bot.py", line 15, in <module>
    data_rsi = RSI(close, timeperiod=14)[-1]
  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\talib\__init__.py", line 64, in wrapper
    result = func(*_args, **_kwds)
TypeError: Argument 'real' has incorrect type (expected numpy.ndarray, got list)

i don't know what am i doing wrong, Please tell me how can i get rid of this problem i am not a good developer Please Help me.

Thanks For Your Time.

TA-Lib version: 0.4.24

iqoptionapi version: 6.8.9.1

1 Answers1

0

The problem is:

Argument 'real' has incorrect type (expected numpy.ndarray, got list)

Wrap your arguments with numpy.array as in this example:

import numpy as np
import talib as tb

close = np.array([100.0, 101.0, 102.0, 103.0, 104.0, 105.0, 106.0, 107.0, 108.0, 109.0])

tb.RSI(close, 2)
truf
  • 2,843
  • 26
  • 39