Hi all, I am building a bot to send order to IB for trade with Python. In order to run multiple strategies, i am running multiple bots in which every bot will be assigned different OrderRef to place order to IB. But when i want to square the open position, how can i identify which open position belongs to which strategies? I tried reqPositions but the information is insufficient to differentiate. It seems that there is reqPositionsMulti, but i don't know how to use it. (What do reqId, modelCode mean? Appreciate if someone can share an example to illustrate) and I am not sure if this "reqPositionsMulti" can help. def positionMulti(self, reqId: int, account: str, modelCode: str,contract: Contract, pos: float, avgCost: float): super().positionMulti(reqId, account, modelCode, contract, pos, avgCost)
Place order with Order(.... modelCode = 'model_name', ....) Get positions back with positionMulti(...., modelCode = 'model name', ....) GAT