Inside a TMF you have only information about the current trade, but not about the other trades. For summing up all profits I'd use a simple for() loop, no TMF.