Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

[BUG] TypeError: unsupported operand type(s) for -: 'float' and 'str' #158

Open
ghost opened this issue Jun 21, 2020 · 0 comments
Open

[BUG] TypeError: unsupported operand type(s) for -: 'float' and 'str' #158

ghost opened this issue Jun 21, 2020 · 0 comments
Labels

Comments

@ghost
Copy link

ghost commented Jun 21, 2020

bars['rsi'] = bars.rsi(window=10) throws the following exception:

File "rsistrat.py", line 27, in
strategy.run()
File "/usr/local/lib/python3.6/site-packages/qtpylib/algo.py", line 393, in run
self.blotter.drip(history, drip_handler)
File "/usr/local/lib/python3.6/site-packages/qtpylib/blotter.py", line 1102, in drip
handler(data.iloc[i:i + 1])
File "/usr/local/lib/python3.6/site-packages/qtpylib/asynctools.py", line 100, in async_method
return callee(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/qtpylib/algo.py", line 865, in _bar_handler
self._base_bar_handler(bar)
File "/usr/local/lib/python3.6/site-packages/qtpylib/algo.py", line 857, in _base_bar_handler
self.on_bar(bar_instrument)
File "rsi_strategy.py", line 14, in on_bar
bars['rsi'] = bars.rsi(window=10)
File "/usr/local/lib/python3.6/site-packages/qtpylib/indicators.py", line 380, in rsi
deltas = np.diff(series)
File "<array_function internals>", line 6, in diff
File "/usr/local/lib64/python3.6/site-packages/numpy/lib/function_base.py", line 1269, in diff
a = op(a[slice1], a[slice2])
TypeError: unsupported operand type(s) for -: 'float' and 'str'

@ghost ghost added the bug label Jun 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

0 participants