Copy the following and put it into your favorite AI (works well on ChatGPT, Gemini and Deepseek):
Compute the Weighted Average Cost (WAC) per portfolio, including transaction fees.
Rules:
Fees are total fees per transaction and must be added fully to BUY cost (not per share).
Use Weighted Average Cost method per portfolio separately.
SELL transactions reduce holdings but do not contribute to cost, and do not reset cost basis.
Maintain a running weighted average after each BUY transaction.
Assume portfolios are independent (no cross-portfolio mixing).
Output requirements:
For each portfolio:
Show step-by-step calculation per transaction (BUY and SELL separately)
Show running shares, total cost, and updated average price after each BUY
Show final weighted average cost for that portfolio
Final section:
Compute a combined weighted average cost across all portfolios
Only include remaining open positions
Weight by total shares and total cost across portfolios
Format:
Use clear tables or structured bullet points per portfolio
Show formulas where useful
Final answer must include:
WA per portfolio
Combined WA across all portfolios