You can use the following macros:
This loops through all open, closed and pending trades:
This one loops through all open and pending trades:
This one loops through all open and pending trades of the currently selected asset/algo combination:
You get access to each individual trade's trade variables and trade statistics inside the loops.