When the bot tries to open a position, a crash occurs with the following traceback:
File "/home/user/FXBot/main.py", line 139, in <module>
trader = MomentumLive(cfg, instrument, granularity, window, units, stop_loss=stop_loss,
File "/home/user/FXBot/livetrading/MomentumLive.py", line 34, in __init__
super().__init__(
File "/home/user/FXBot/livetrading/LiveTrader.py", line 77, in __init__
self.stream_data(self._instrument)
File "/home/user/.local/lib/python3.9/site-packages/tpqoa/tpqoa.py", line 357, in stream_data
self.on_success(msg.time,
File "/home/user/FXBot/livetrading/LiveTrader.py", line 199, in on_success
self.trade()
File "/home/user/FXBot/livetrading/LiveTrader.py", line 206, in trade
if self._data["position"].iloc[-1] == 1:
File "/home/user/.local/lib/python3.9/site-packages/pandas/core/indexing.py", line 895, in __getitem__
return self._getitem_axis(maybe_callable, axis=axis)
File "/home/user/.local/lib/python3.9/site-packages/pandas/core/indexing.py", line 1501, in _getitem_axis
self._validate_integer(key, axis)
File "/home/user/.local/lib/python3.9/site-packages/pandas/core/indexing.py", line 1444, in _validate_integer
raise IndexError("single positional indexer is out-of-bounds")
IndexError: single positional indexer is out-of-bounds
When the bot tries to open a position, a crash occurs with the following traceback: