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

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

@ghost

Description

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions