https://github.com/tbdavid2019/stockbot
https://github.com/tbdavid2019/stockbot
chatbot stock-market
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tbdavid2019/stockbot
- Owner: tbdavid2019
- License: other
- Created: 2025-04-09T01:37:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-10T07:59:07.000Z (about 1 year ago)
- Last Synced: 2025-05-08T17:54:53.874Z (about 1 year ago)
- Topics: chatbot, stock-market
- Language: TypeScript
- Homepage: https://bot.david888.com
- Size: 560 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
股票機器人 (StockBot) 由 Groq 提供支援:閃電般快速的 AI 聊天機器人,能即時回應互動式股票圖表、財務數據、新聞、篩選器等功能
本專案fork自 https://github.com/bklieger-groq/stockbot-on-groq
修正後的分支
[股票機器人演示](https://github.com/user-attachments/assets/a50fa266-5ae9-4869-a37f-599d7db790d9)
> 股票機器人演示提供相關、即時和互動式的股票圖表和界面,現已支援台灣股票市場!
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Ftbdavid2019%2Fstockbot&env=GROQ_API_KEY&envDescription=Get%20a%20Groq%20API%20Key&envLink=https%3A%2F%2Fconsole.groq.com%2Fkeys&project-name=stockbot-clone&repository-name=stockbot-clone&demo-title=StockBot&demo-description=Build%20a%20lightning-fast%20AI%20chatbot%20powered%20by%20Groq%20and%20Vercel%20AI%20SDK%20that%20responds%20with%20live%20stock%20charts%2C%20financials%2C%20news%2C%20and%20screeners.&demo-url=https%3A%2F%2Fgroq-stockbot.vercel.app%2F&demo-image=https%3A%2F%2Fi.imgur.com%2FjJfm8mm.png)
## 概述
股票機器人是一個由 AI 驅動的聊天機器人,它利用 Groq 上的高速推理服務、Vercel 的 AI SDK 和 TradingView 的即時小工具,通過對話方式提供即時、互動式圖表和界面,專門根據您的請求定制。Groq 的高速處理能力使工具調用和響應幾乎瞬間完成,允許通過兩個 API 調用序列與專門的提示返回響應。現在已支援台灣股票市場查詢!
> [!IMPORTANT]
> 注意:股票機器人可能提供不準確的信息,並不提供投資建議。它僅供娛樂和教學使用。
## 功能特點
- 🤖 **即時 AI 聊天機器人**:與高速回應的 AI 互動,通過自然語言對話請求股票新聞、信息和圖表
- 📊 **互動式股票圖表**:接收幾乎即時的、上下文感知的響應,包含承載實時數據的互動式 TradingView 圖表
- 🔄 **自適應界面**:動態渲染 TradingView UI 組件,為您的特定查詢定制金融界面
- ⚡ **Groq 驅動的性能**:利用 Groq 的尖端推理技術,實現近乎即時的響應和無縫用戶體驗
- 🌐 **多資產市場覆蓋**:訪問股票、外匯、債券和加密貨幣的全面數據和分析
- 🇹🇼 **台灣股票市場支持**:現已支援台灣股票市場查詢,包括台積電等台灣上市公司
- 🤖 **AI 投資分析** (新功能):整合 AI Hedge Fund API,提供傳奇投資大師(巴菲特、葛拉漢、乾克曼等)的專業投資建議
## AI 投資分析功能
StockBot 整合了 AI Hedge Fund API,可以模擬多位傳奇投資大師的投資風格,為您提供專業的股票分析建議。
### 使用方式
在聊天中直接詢問:
- "TSLA 值得買嗎?"
- "分析一下 NVDA"
- "Should I buy AAPL?"
### 分析師團隊
| 類別 | 分析師 |
|------|--------|
| 📊 價值投資大師 | Ben Graham、Warren Buffett、Charlie Munger、Bill Ackman、Peter Lynch、Phil Fisher、Michael Burry |
| 🚀 成長與創新 | Cathie Wood |
| 📈 技術與情緒分析 | Technical Analyst、Sentiment Analyst、Nancy Pelosi、WSB |
| 📐 基本面與估值 | Fundamentals Analyst、Valuation Analyst |
### 目前狀態
> ⚠️ **注意**:由於 Vercel Serverless Functions 對非標準 port (6000) 的連線有限制,目前 API 整合功能在 Vercel 部署環境中暫時無法使用。
>
> 🤗 **替代方案**:請移駕至 [AI Hedge Fund on Hugging Face](https://huggingface.co/spaces/tbdavid2019/ai-hedge-fund) 使用完整的 AI 投資分析功能。
### 未來計畫
待 API 服務調整為標準 port (80/443) 或設定 HTTPS 域名後,將可在 Vercel 環境中正常使用。屆時只需修改環境變數:
```bash
# .env.local
AI_HEDGE_FUND_HOST=your-api-domain.com
AI_HEDGE_FUND_PORT=443
```
### 相關檔案
- `app/api/stock-analysis/route.ts` - API 代理路由
- `components/tradingview/stock-analysis.tsx` - 分析結果顯示組件
- `lib/chat/actions.tsx` - 聊天工具定義 (analyzeStockWithAI)
## Interfaces
| Description | Widget |
|-------------|--------|
| **AI Investment Analysis** (NEW)
Get professional investment advice from legendary investors like Warren Buffett, Ben Graham, and more. Currently redirects to Hugging Face Space. |  |
| **Heatmap of Daily Market Performance**
Visualize market trends at a glance with an interactive heatmap. Supported markets: US (S&P 500), Germany, Australia, Brazil, Canada, Israel. |  |
| **Breakdown of Financial Data for Stocks**
Get detailed financial metrics and key performance indicators for any stock. |  |
| **Price History of Stock**
Track the historical price movement of stocks with customizable date ranges. |  |
| **Candlestick Stock Charts for Specific Assets**
Analyze price patterns and trends with detailed candlestick charts. |  |
| **Top Stories for Specific Stock**
Stay informed with the latest news and headlines affecting specific companies. |  |
| **Market Overview**
Shows an overview of today's stock, futures, bond, and forex market performance including change values, Open, High, Low, and Close values. |  |
| **Stock Screener to Find New Stocks and ETFs**
Discover new companies with a stock screening tool. |  |
| **Trending Stocks**
Shows the top five gaining, losing, and most active stocks for the day. |  |
| **ETF Heatmap**
Shows a heatmap of today's ETF market performance across sectors and asset classes. |  |
## Quickstart
> [!IMPORTANT]
> To use StockBot, you can use a hosted version at [tbdavid-stockbot.vercel.app](https://tbdavid-stockbot.vercel.app/).
> Alternatively, you can run StockBot locally using the quickstart instructions.
You will need a Groq API Key to run the application. You can obtain one [here on the Groq console](https://console.groq.com/keys).
To get started locally, you can run the following:
```bash
cp .env.example .env.local
```
Add your Groq API key to .env.local, then run:
```bash
pnpm install
pnpm dev
```
Your app should now be running on [localhost:3000](http://localhost:3000/).
## Credits
This app was originally developed by [Benjamin Klieger](https://x.com/benjaminklieger) at [Groq](https://groq.com) and uses the AI Chatbot template created by Vercel: [Github Repository](https://github.com/vercel/ai-chatbot). Taiwan stock market support was added by [tbdavid2019](https://github.com/tbdavid2019).