Thursday, June 9, 2011

yogi_Calculate Trade Aggregate For A Set Of Transactions

Yogi Anand, D.Eng, P.E.                                Google Spreadsheet                        www.energyefficientbuild.com   
BGILL said ...
How do I calculate my trade aggregate?
How do I properly calculate my trade aggregates when you have more buys(BTO) than sells(STC)?
Example:
Desc. Action Qty P
Position 1 BTO 2 0.98
Position 1 BTO 4 0.67
Position 1 STC -6 0.53
Position 2 BTO 2 0.97
Position 2 BTO 2 0.90
Position 2 STC -4 1.25
Aggregate for Pos. 1 = - 0.243
Aggregate for Pos. 2 = 0.315
Combined Aggregate = 0.07
I can't seem to make this work in a spreadsheet of multiple positions where you have an irregular number of buys and sells.
--------------------------------------