@ab_trader
I am testing this on a live bot.
I ran into the following issue:
[TradeHistory([('status', AutoOrderedDict([('status', 1), ('dt', 736955.651388889), ('barlen', 0), ('size', 46), ('price', 6338.0), ('value', 291548.0), ('pnl', 0.0), ('pnlcomm', 0.0), ('tz', None)])), ('event', AutoOrderedDict([('order', <backtrader.order.BuyOrder object at 0x112DBA70>), ('size', 46), ('price', 6338), ('commission', 0.0)]))]), TradeHistory([('status', AutoOrderedDict([('status', 2), ('dt', 736955.7006944445), ('barlen', 71), ('size', 0), ('price', 6338.0), ('value', 0.0), ('pnl', 506.0), ('pnlcomm', 506.0), ('tz', None)])), ('event', AutoOrderedDict([('order', <backtrader.order.SellOrder object at 0x132FBB30>), ('size', -46), ('price', 6349), ('commission', 0.0)]))])] ref:1
data:<backmex.feed.BitMEXData object at 0x1129C5F0>
tradeid:0
size:0
price:6338.0
value:0.0
commission:0.0
pnl:506.0
pnlcomm:506.0
justopened:False
isopen:False
isclosed:True
baropen:101
dtopen:736955.651388889
barclose:172
dtclose:736955.7006944445
barlen:71
historyon:True
history:[TradeHistory([('status', AutoOrderedDict([('status', 1), ('dt', 736955.651388889), ('barlen', 0), ('size', 46), ('price', 6338.0), ('value', 291548.0), ('pnl', 0.0), ('pnlcomm', 0.0), ('tz', None)])), ('event', AutoOrderedDict([('order', <backtrader.order.BuyOrder object at 0x112DBA70>), ('size', 46), ('price', 6338), ('commission', 0.0)]))]), TradeHistory([('status', AutoOrderedDict([('status', 2), ('dt', 736955.7006944445), ('barlen', 71), ('size', 0), ('price', 6338.0), ('value', 0.0), ('pnl', 506.0), ('pnlcomm', 506.0), ('tz', None)])), ('event', AutoOrderedDict([('order', <backtrader.order.SellOrder object at 0x132FBB30>), ('size', -46), ('price', 6349), ('commission', 0.0)]))])]
status:2
self._runnext(runstrats)
File "D:\envs\twenv\lib\site-packages\backtrader\cerebro.py", line 1623, in _runnext
self._brokernotify()
File "D:\envs\twenv\lib\site-packages\backtrader\cerebro.py", line 1370, in _brokernotify
owner._addnotification(order, quicknotify=self.p.quicknotify)
File "D:\envs\twenv\lib\site-packages\backtrader\strategy.py", line 553, in _addnotification
self._notify(qorders=qorders, qtrades=qtrades)
File "D:\envs\twenv\lib\site-packages\backtrader\strategy.py", line 577, in _notify
analyzer._notify_trade(trade)
File "D:\envs\twenv\lib\site-packages\backtrader\analyzer.py", line 170, in _notify_trade
self.notify_trade(trade)
File "D:\envs\twenv\tradework\lib\backtrader\helpers.py", line 168, in notify_trade
highest_in_trade = max(trade.data.high.get(ago=0, size=barlen+1))
File "D:\envs\twenv\lib\site-packages\backtrader\linebuffer.py", line 182, in get
return list(islice(self.array, start, end))
ValueError: Indices for islice() must be None or an integer: 0 <= x <= sys.maxsize.
The first two objects are the printout of 'trade' and 'trade.history', if it helps in finding the issue.
EDIT: I am using this with exactbars=True option in cerebro and maybe this is causing the error. I will try the same with this option off and let it be known here.