Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _babysit(self):
"""Monitor open positions. Check if any have closed.
"""
for otid in self.open_trade_ids:
if broker.is_closed(otid):
self.open_trade_ids.remove(otid) # mark status