def broker_get_positions(self): ## Get all the positions ## We return these as a dict of pd DataFrame ## dict entries are asset classes, columns are IB symbol, contract ID, contract expiry raw_positions = self.ib.positions() dict_of_positions = from_ib_positions_to_dict(raw_positions) return dict_of_positions
def broker_get_positions(self, account_id=arg_not_supplied): # Get all the positions # We return these as a dict of pd DataFrame # dict entries are asset classes, columns are IB symbol, contract ID, # contract expiry raw_positions = self.ib.positions() dict_of_positions = from_ib_positions_to_dict(raw_positions, account_id=account_id) return dict_of_positions