Skip to content

Commit df030bc

Browse files
authoredAug 20, 2021
Merge pull request backtrader2#73 from backtrader2/positions_ib
Fixes issue backtrader2#61: self.positions throws attribute error with IB Broker
2 parents 2877a25 + 9429c8a commit df030bc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎backtrader/brokers/ibbroker.py

+1
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ def __init__(self, **kwargs):
276276
self.ordstatus = collections.defaultdict(dict)
277277
self.notifs = queue.Queue() # holds orders which are notified
278278
self.tonotify = collections.deque() # hold oids to be notified
279+
self.positions = self.ib.positions
279280

280281
def start(self):
281282
super(IBBroker, self).start()

0 commit comments

Comments
 (0)
Please sign in to comment.