A system generated X trades across different assets and at the end of the run() I want to turn some of them Phantom (say, because the exposure to a particular asset would be above acceptable).

What would be the way of doing this in a for(open_trades) loop?