Conversation
- db.ts:SQLite 連線(better-sqlite3)、WAL 模式、自動 migration - stock-map.ts:台股名稱→代碼映射(2230 檔上市+上櫃) - stock-price.ts:TWSE 即時報價 + FinMind OHLC 歷史資料 - tracker.ts:recordPredictions(LLM 分析後記錄)+ updateTracking(每日判定) - index.ts:分析後自動記錄預測 + 15:00 追蹤更新排程 - Dockerfile:加 build-essential(native 編譯)+ data/ 目錄 - data/tw-stock-list.json:台股代碼映射表(政府開放資料) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
api.web.finmindtrade.com → api.finmindtrade.com(經實測驗證) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
設計變更: - 資料記錄與勝敗判定分離,系統只記錄 5 天 OHLC,勝敗查詢時決定 - 移除 realized/expired 狀態,改為 tracking → completed(5天)| superseded - 同股票新預測進來 → 舊的 superseded + next_prediction_id 串聯 - price_snapshots 新增 day_number(有資料的交易日序號) - change_pct_extreme 拆為 change_pct_high + change_pct_low(兩個方向都記錄) - predictions 移除 realized_at/days_to_realize/peak_change_pct,新增 completed_at/next_prediction_id Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- db.ts: 建立 DB 前先 mkdirSync,migrate 成功後才設定全域變數 - stock-price.ts: TWSE/FinMind fetch 加入 AbortSignal.timeout 防止無限等待 - tracker.ts: updateTracking 加入三層 try/catch(DB 開啟、OHLC 查詢、交易寫入) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
getBasePrice 新增 postTimestamp 參數,根據貼文發佈日期查詢 對應交易日收盤價,而非爬取當下的即時價格。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
新增模組
db.tsstock-map.tsstock-price.tstracker.tsdata/tw-stock-list.json追蹤邏輯
Status 狀態機
tracking → completed(5 天結束)| superseded(被新預測覆蓋)| unmappable(無法映射股票代碼)
錯誤處理
Commits
Test plan