Rather than a while(asset(loop( ....))), try for(open_trades) or for(current_trades). There are examples of each in the manual, but post here if you get stuck!

Last edited by boatman; 07/18/16 07:30.