Time Weighted Average Calculation