# 我用 AI 做了一個恆指期貨十大持倉分析工具,全程沒寫一行 Code

> 你還在每個星期一早上 10 點手動按 F5 等港交所更新?2026 年了,你認真的嗎?


## 最終成果

**網址**:https://top10hsi.garfieldpark.vip


## 故事開始:兩個網站的數據,一個手動的痛


我有兩個網站要看。

第一個是**港交所官方頁面**,每週更新恒指期貨的頭 10 名大戶持倉百分比。原始數據,很乾,就是一堆 %。

第二個是**港股雷達網**,把港交所的 % 重新計算成實際合約張數,再拆成頭 5 名、頭 10 名、散戶,追蹤每週變化。非常有用,但更新時間不固定。

我的痛點:每次都要開兩個分頁,對照著看。港交所更新了,雷達網還沒更新,就自己手動算。算完還要翻上週的來比對增減。


煩。


## 我對 AI 說了一句話

> "i want to make a web that scrapping from source 1 web to recalculate the data source figures with reference of the calculation from scource 2 web."

就是這句。然後 AI 開始工作。


## AI 做了什麼(全程)

### 第一輪:理解需求

AI 自己打開兩個網站,讀取內容,分析港交所的 HTML 結構,理解港股雷達網的計算邏輯(全市場 OI = 頭10名合約 ÷ 頭10名佔比,然後逐個參與者推算實際張數)。

### 第二輪:建立 HTML

直接用 client-side JavaScript 抓港交所網頁 → 解析 HTML table → 計算 → 顯示。38 週歷史數據從港股雷達網一次性匯入。

### 第三輪:修 CORS 問題

港交所不允許跨域請求。試了 4 個 public proxy 全部失敗。最後用 Cloudflare Pages 的 `_worker.js` 自己寫一個 serverless proxy。

### 第四輪:迭代修正

- 日期格式不對 → 改 DD/MM/YYYY

- 排序用字串不是日期 → 改用 `new Date()` 排序

- localStorage 換瀏覽器就沒了 → 把 38 週歷史直接嵌進 HTML

- 部署後 proxy 不工作 → 從 `functions/` 換成 `_worker.js`

- 加深淺模式切換

- 加主頁連結

- 設定 cron 每週一至五自動抓取


全程我一條 code 都沒寫。我只負責說「這裡不對」「加這個」「改那樣」。


**功能**:

- 自動抓港交所最新數據

- 按港股雷達網公式重算(頭5名/頭10名/散戶/淨好倉/增減)

- 38 週歷史數據,最新在上

- 每個計算步驟可以展開查驗

- 深淺模式

- 純靜態 HTML,Cloudflare 全球 CDN


## 心得

2026 年,做一個網站的門檻已經不是「會不會寫 code」,而是「你能不能清楚描述你要什麼」。

我用的甚至不是什麼高級 prompt engineering。就是像跟一個工程師朋友講話一樣,說我要什麼、哪裡不對、改成怎樣。剩下的它自己搞定。

如果你還在等別人幫你寫工具,試試看自己跟 AI 說。


# I Built an HSI Futures Market Share Analysis Tool With AI — Without Writing a Single Line of Code


> Still refreshing the HKEX page manually every Monday at 10am? It's 2026. Seriously?


## The Problem: Two Websites, One Manual Headache

I had two websites to check every week.

**Site 1**: HKEX official page — raw percentages of top 10 brokers' long/short positions in HSI futures. Dry data, just percentages.

**Site 2**: HK Stock Radar — takes those HKEX percentages, recalculates them into actual contract numbers, splits into Top 5 / Top 10 / Retail, and tracks week-over-week changes. Incredibly useful, but updated on an irregular schedule.

My pain: two tabs open, cross-referencing constantly. HKEX updates but Radar hasn't yet — so I do the math myself. Then dig up last week's numbers to calculate the change.


Annoying.


## The Result

**URL**: https://top10hsi.garfieldpark.vip


## I Said One Sentence to the AI

> "i want to make a web that scrapping from source 1 web to recalculate the data source figures with reference of the calculation from scource 2 web."

That's it. Then the AI started working.


## What the AI Did (End-to-End)

### Round 1: Understanding

It opened both websites, analyzed the HKEX HTML table structure, and figured out the calculation logic from HK Stock Radar (total market OI = top 10 contracts ÷ top 10 share, then back-calculate individual participant positions).

### Round 2: Building the HTML

Pure client-side JavaScript: fetch HKEX page → parse the HTML table → run calculations → display. Imported 38 weeks of history from HK Stock Radar in one shot.

### Round 3: Fixing CORS

HKEX blocks cross-origin requests. Tested 4 public CORS proxies — all failed. Ended up writing a `_worker.js` for Cloudflare Pages to act as a self-hosted serverless proxy.

### Round 4: Iteration

- Date format wrong → switched to DD/MM/YYYY

- Sort order using string comparison → fixed with `new Date()` parsing

- localStorage lost when switching browsers → embedded 38-week history directly into the HTML

- Proxy not working after deploy → migrated from `functions/` to `_worker.js`

- Added light/dark mode toggle

- Added homepage link

- Set up cron job for Mon–Fri auto-fetch


I didn't write a single line of code. I just said "this is wrong," "add that," "change this."


**Features**:

- Auto-fetches the latest HKEX data

- Recalculates using HK Stock Radar's methodology (Top 5 / Top 10 / Retail / Net / Changes)

- 38 weeks of history, newest first

- Every calculation step expandable for verification

- Light/dark mode

- Pure static HTML, served via Cloudflare global CDN


## Takeaway

In 2026, the barrier to building a website isn't "can you code." It's "can you clearly describe what you want."

I didn't use any fancy prompt engineering. I just talked to the AI like I'd talk to an engineer friend: here's what I want, here's what's wrong, change it to this. It figured out the rest.

If you're still waiting for someone to build a tool for you — try just telling an AI what you need.


留言

這個網誌中的熱門文章