I'm not sure if I understood you correctly, but in variables.h there are these 2 variables:

#define ProfitClosed (WinLong-LossLong+WinShort-LossShort)
#define ProfitOpen (WinValLong-LossValLong+WinValShort-LossValShort)

So we could do this:

// sum up closed profits of all assets and the current algo
var ProfitSum = 0;
for(used_assets) {
asset(Asset); // select the current component
ProfitSum += ProfitClosed;
}