How to Explain Your Stock’s Average Price Using AI

H

When users ask, “How was the average price of a stock in my portfolio computed?” I usually point them to a reference post. But sometimes they want more – a step‑by‑step explanation that proves the calculation is correct.

Doing this manually is time‑consuming unless there are very few transactions. I’ve done it many times in the past. Thankfully, with AI, it’s now quick and easy.

Here’s the approach:

  1. Generate the transactions in JSON format – a compact structure AI understands easily.
  2. Write a clear prompt for the AI to follow.
  3. Let the AI (ChatGPT, Gemini, Deepseek, etc.) do the work.

How to get the transactions and prompt?

  • Go to transaction page on desktop and filter by the stock you want (see image below).
  • Click “Get AI to review average price calculation”.
  • Copy the JSON output and the provided prompt into your favorite AI.

We’ve tested this on ChatGPT, Gemini, and Deepseek – all give clear, step‑by‑step explanations (see AI output below).

What other calculations or features should StocksCafe collaborate with AI on? Let us know!

Check out this other post where we walk through how to analyse your portfolio using AI.

Alright—let’s go portfolio by portfolio and compute the **Weighted Average Cost (WAC)** properly, including fees and respecting your rules.

---

# 🧮 1. Portfolio: **SC SGD**

### Transactions

#### ✅ BUY 100 @ 2.20 (Fee: 0.54)

* Cost = (100 × 2.20) + 0.54 = **220 + 0.54 = 220.54**
* Shares = 100
* Avg = 220.54 / 100 = **2.2054**

---

#### ✅ BUY 2000 @ 2.93 (Fee: 15.04)

* Cost = (2000 × 2.93) + 15.04 = **5860 + 15.04 = 5875.04**

**Running totals:**

* Shares = 100 + 2000 = **2100**
* Cost = 220.54 + 5875.04 = **6095.58**
* Avg = 6095.58 / 2100 = **2.9027**

---

#### ✅ BUY 1900 @ 3.07 (Fee: 13.74)

* Cost = (1900 × 3.07) + 13.74 = **5833 + 13.74 = 5846.74**

**Running totals:**

* Shares = 2100 + 1900 = **4000**
* Cost = 6095.58 + 5846.74 = **11942.32**
* Avg = 11942.32 / 4000 = **2.9856**

---

#### ✅ BUY 3200 @ 3.04 (Fee: 22.90)

* Cost = (3200 × 3.04) + 22.90 = **9728 + 22.90 = 9750.90**

**Running totals:**

* Shares = 4000 + 3200 = **7200**
* Cost = 11942.32 + 9750.90 = **21693.22**
* Avg = 21693.22 / 7200 = **3.0135**

---

#### ✅ BUY 2000 @ 2.90 (Fee: 13.66)

* Cost = (2000 × 2.90) + 13.66 = **5800 + 13.66 = 5813.66**

**Running totals:**

* Shares = 7200 + 2000 = **9200**
* Cost = 21693.22 + 5813.66 = **27506.88**
* Avg = 27506.88 / 9200 = **2.9899**

---

### 📌 Final (SC SGD)

* Shares: **9200**
* Total Cost: **27506.88**
* **WAC: 2.9899**

---

# 🧮 2. Portfolio: **Rin SC SGD**

#### ✅ BUY 200 @ 2.34 (Fee: 1.09)

* Cost = 468 + 1.09 = **469.09**
* Shares = 200
* Avg = **2.3455**

---

#### ❌ SELL 200 @ 2.46

* Shares → **0**
* Cost → **0**
* (Position closed)

---

#### ✅ BUY 7600 @ 2.59 (Fee: 47.25)

* Cost = 19684 + 47.25 = **19731.25**
* Shares = 7600
* Avg = **2.5962**

---

#### ❌ SELL 7600 @ 2.89

* Shares → **0**
* Cost → **0**

---

### 📌 Final (Rin SC SGD)

* Shares: **0**
* No open position → **Excluded from final WA**

---

# 🧮 3. Portfolio: **Saxo**

#### ✅ BUY 1500 @ 3.46 (Fee: 12.39)

* Cost = 5190 + 12.39 = **5202.39**
* Shares = 1500
* Avg = **3.4683**

---

#### ✅ BUY 1500 @ 3.40 (Fee: 12.74)

* Cost = 5100 + 12.74 = **5112.74**

**Running totals:**

* Shares = 3000
* Cost = 5202.39 + 5112.74 = **10315.13**
* Avg = 10315.13 / 3000 = **3.4384**

---

#### ❌ SELL 3000 @ 2.81

* Shares → **0**
* Cost → **0**

---

### 📌 Final (Saxo)

* Shares: **0**
* Excluded

---

# 🧮 4. Portfolio: **Tiger**

#### ✅ BUY 1400 @ 2.95 (Fee: 5.31)

* Cost = 4130 + 5.31 = **4135.31**
* Shares = 1400
* Avg = **2.9538**

---

#### ❌ SELL 1400 @ 2.94

* Shares → **0**
* Cost → **0**

---

### 📌 Final (Tiger)

* Shares: **0**
* Excluded

---

# 🧮 5. Portfolio: **Rin SRS**

#### ✅ BUY 2000 @ 2.68 (Fee: 12.09)

* Cost = 5360 + 12.09 = **5372.09**
* Shares = 2000
* Avg = **2.6860**

---

### 📌 Final (Rin SRS)

* Shares: **2000**
* Total Cost: **5372.09**
* **WAC: 2.6860**

---

# 🧮 FINAL COMBINED WAC (Open Positions Only)

### Included portfolios:

* SC SGD → 9200 shares, cost 27506.88
* Rin SRS → 2000 shares, cost 5372.09

---

### Totals:

* Shares = 9200 + 2000 = **11200**
* Cost = 27506.88 + 5372.09 = **32878.97**

---

### ✅ Combined WAC

[
\text{WAC} = \frac{32878.97}{11200} = \mathbf{2.9356}
]

---

# ✅ FINAL ANSWER

### Per Portfolio

* **SC SGD:** 2.9899
* **Rin SC SGD:** No position
* **Saxo:** No position
* **Tiger:** No position
* **Rin SRS:** 2.6860

---

### 🧾 Combined (Open Positions Only)

* **Total Shares:** 11,200
* **Total Cost:** 32,878.97
* **✅ Combined WAC: 2.9356**

Evan Koh

Links

Website:
StocksCafe

Knowledge Base:
StocksCafe Academy

YouTube Tutorials:
StocksCafe Youtube Channel