Is there a way to figure out a list of all trades that have contributed to an open position? Both orders and trades have an order_id attribute, so one can correlate trades to orders. My use case is that I want to run two strategies, say strategyA and strategyB. I can tag the orders as strategyA or strategyB. However, when an exit signal has come for a strategy , say for strategyA , I want to exit only those positions that have been created as a result of strategyA . For this, I need to look at my open positions and see how many of these positions have been created as a result of strategyA . I can always look at the num of bought and sold orders for each strategy and correlate that with the open positions but that gets tricky with new orders and trades being created while I am performing these calculations. The best way would be to explore a link between potions and orders. Is such a link present?. Thanks.