Time Weighted Average calculation