How to Build Your Own AI Stock Monitoring System in 10 Minutes with PanWatch
A practical, step-by-step guide to deploying PanWatch using Docker, configuring LLM APIs for the TradingAgents decision engine, setting up real-time stock alerts, and pushing AI-generated market analysis directly to your favorite IM apps.

Have you ever stared at a chart, blinked, and missed the perfect entry or exit? Or spent hours analyzing K-lines only to make an emotional trade? After years of backend development, I've started leaning towards letting AI handle the "information preprocessing" for me. Not to make the actual trading decisions, but to digest messy market data, news, and technical indicators into clear, actionable insights.
Today, I'll walk you through deploying PanWatch (1.1k+ Stars) from scratch to build your own AI stock monitoring assistant. Once deployed, you'll be able to:
- Monitor A-share, HK, and US stocks in real-time with automated pre-market, intra-day, and post-market analysis reports.
- Trigger the TradingAgents 9-Agent decision chain with one click, getting bull/bear debates, risk control checks, and a PM decision report in 3-5 minutes.
- Push alerts to all major channels (WeCom, DingTalk, Feishu, Telegram). Your phone buzzes, and the AI has already done the watching for you.
All your holding data stays on your own machine. No third-party privacy concerns.
Prerequisites
Before we start, ensure you have:
- A machine with Docker installed (server, NAS, or local PC). Docker 20+ is sufficient.
- An OpenAI-compatible API Key (OpenAI, Zhipu, DeepSeek, Ollama, etc.). I recommend DeepSeek for its cost-effectiveness (~$0.05 per analysis).
- A Webhook URL or enterprise app URL for your preferred notification channel (WeCom group bot, DingTalk custom bot, Feishu bot, etc.).
This guide takes about 10-15 minutes.
Quick Start: One-Click Docker Deployment
Why Docker? The project bundles FastAPI backend + React frontend + Playwright browser dependencies. No Python or Node.js environment setup is needed. One command to go.
Step 1: Pull Image & Start Container
bash
docker run -d \
--name panwatch \
-p 8000:8000 \
-v panwatch_data:/app/data \
-e TZ=Asia/Shanghai \
sunxiao0721/panwatch:latest
Here's what each parameter does:
-p 8000:8000: Maps container port 8000 to the host for browser access.-v panwatch_data:/app/data: Mounts a persistent volume. All holdings, accounts, and agent analysis records are stored here. Data survives container deletion.-e TZ=Asia/Shanghai: Sets the timezone. This is crucial because pre/post-market agent scheduling relies on system time.
Tip / Gotcha: On first startup, Playwright will automatically download Chromium to
panwatch_data/playwright. If your network is slow, it may take a few minutes. If you don't need screenshot features, add-e PLAYWRIGHT_SKIP_BROWSER_INSTALL=1to skip the download.
After running docker logs panwatch and seeing no errors, visit http://YOUR_IP:8000.
Step 2: First Access & Account Setup
Open http://localhost:8000 in your browser. The first visit will prompt you to set a username and password. This writes local auth configurations; you'll need these credentials for every subsequent login.
Step 3: Configure AI Provider
This is the core. Go to Settings → AI Provider and fill in your OpenAI-compatible API details:
| Field | Description |
|---|---|
| API Base URL | API endpoint, e.g., https://api.deepseek.com/v1 for DeepSeek |
| API Key | Your secret key |
| Model | Model name, e.g., deepseek-chat |
Why the OpenAI-compatible protocol? Major providers like Zhipu, DeepSeek, and local Ollama deployments all support it. You can swap models without modifying any code.
Step 4: Configure Notification Channels
Go to Settings → Notification Channels and add your push URLs. Taking WeCom Group Bot as an example:
- Add a "Group Robot" in your WeCom group chat.
- Copy the Webhook URL (e.g.,
https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx). - In PanWatch, select "WeCom", paste the URL, and save.
You can configure DingTalk, Feishu, and Telegram simultaneously, and select specific channels per notification later.
Practical Walkthrough: From Setup to AI Reports
Now that configuration is complete, let's run through a complete workflow with a simple A-share holding.
1. Add Holdings
Go to the Holdings page and click "Add Stock". You can:
- Enter the stock code (e.g.,
600519for Kweichow Moutai). - Set your trading style (Short-term / Swing / Long-term), which influences the AI's strategy recommendations.
- Create multiple "Accounts" after adding stocks, ideal for segmented portfolio management.
2. Experience the Pre-Market Analysis Agent
Agents are PanWatch's highlight. The system includes four built-in agents that run automatically on a schedule:
| Agent | Trigger | Task |
|---|---|---|
| Pre-market Analysis | Daily before market open | Synthesizes overnight US markets, news, and technical patterns to suggest today's strategy. |
| Intra-day Monitor | Real-time during trading | Monitors abnormal signals, pushes alerts on RSI/KDJ/MACD resonance. |
| Post-market Daily | Daily after market close | Reviews daily trends, analyzes capital flow, and plans next-day operations. |
| News Flash | Scheduled collection | AI filters important financial news relevant to your holdings. |
You don't need to run them manually. They trigger automatically based on your TZ setting. Right after deployment, you can go to the Holdings page and click the 🧠 icon to manually trigger a TradingAgents analysis. It runs the full reasoning chain:
Technical Analyst + Sentiment Analyst + News Analyst + Fundamental Analyst
→ Bull vs Bear Debate
→ Risk Control Review
→ PM Integration Decision
→ Results pushed to your configured WeCom/DingTalk
It takes about 3-5 minutes. You'll receive a structured reasoning report directly on your phone.
3. Set Price Alerts
Beyond automated AI analysis, you can set manual price alerts:
- Go to the Price Alerts page and select the stock to monitor.
- Set trigger conditions: Price, Change %, Volume, Volume Ratio, supports AND/OR combinations.
- Define active hours (trading hours only or all day), cooldown period, and daily trigger limits.
- Choose the notification channel: You can route this specific alert only to DingTalk while others use the default channel.
Troubleshooting & Tips
1. Connection failed when loading the page?
Check container status: docker ps | grep panwatch. If exited, run docker logs panwatch to check errors. The most common cause is port 8000 being occupied. Change the host mapping: -p 9000:8000.
2. AI analysis reports an API error?
90% of the time, it's an incorrect API Key or insufficient balance. Test your Key with curl in the terminal first. Also, verify that the Model name matches your provider's documentation.
3. Agents not triggering on schedule?
Check the timezone. The container defaults to UTC. You must configure -e TZ=Asia/Shanghai, otherwise pre/post-market scheduling will be off by 8 hours.
4. Need a proxy for overseas APIs?
Add -e HTTP_PROXY=http://host:port to environment variables, or configure it in the UI under Settings → Global HTTP Proxy. Priority order: Environment Variable > UI > .env file.
5. Want to debug the underlying scheduler logic?
Add -e LOG_LEVEL=DEBUG on startup. You'll see detailed heartbeat and data collection logs, which are highly useful for troubleshooting.
Summary
At this point, you have successfully:
- Deployed PanWatch with a single Docker command.
- Configured the LLM API and notification channels.
- Added holdings and experienced the TradingAgents multi-agent decision chain.
- Set up price alerts and automated AI agent analysis.
Next steps you can explore:
- Test strategies in paper trading to review equity curves and performance metrics.
- Customize agent strategies. Refer to the project's
CONTRIBUTING.mdto develop your own data sources or agents. - Add PanWatch to your phone's PWA (open in browser → "Add to Home Screen") to use it like a native app.
AI won't trade for you, but it minimizes your information asymmetry to the smallest possible margin. Once this system is set up, you can save hours of screen-staring time for what truly matters. If this guide was helpful, please consider starring the project to encourage the author.