Loading...
Loading...
LLM-powered A/H/US stock intelligent analysis system with multi-source data, real-time news, AI decision dashboards, and multi-channel push notifications via GitHub Actions.
npx skill4agent add aradotso/trending-skills daily-stock-analysisSkill by ara.so — Daily 2026 Skills collection.
https://github.com/ZhuLinsen/daily_stock_analysisSettings → Secrets and variables → ActionsGEMINI_API_KEY # Google AI Studio (free tier available)
OPENAI_API_KEY # OpenAI or compatible (DeepSeek, Qwen, etc.)
OPENAI_BASE_URL # e.g. https://api.deepseek.com/v1
OPENAI_MODEL # e.g. deepseek-chat, gpt-4o
AIHUBMIX_KEY # AIHubMix (recommended, covers Gemini+GPT+Claude+DeepSeek)
ANTHROPIC_API_KEY # ClaudeSTOCKS # e.g. 600519,300750,AAPL,TSLA,00700.HKTELEGRAM_BOT_TOKEN
TELEGRAM_CHAT_ID
FEISHU_WEBHOOK_URL
WECHAT_WEBHOOK_URL
EMAIL_SENDER / EMAIL_PASSWORD / EMAIL_RECEIVERS
DISCORD_WEBHOOK_URLActions → stock_analysis → Run workflowgit clone https://github.com/ZhuLinsen/daily_stock_analysis
cd daily_stock_analysis
cp .env.example .env
# Edit .env with your keys
pip install -r requirements.txt
python main.pydocker build -t stock-analysis .
docker run --env-file .env stock-analysisdocker-compose up -d.env# LLM - pick one or more
GEMINI_API_KEY=your_gemini_key
OPENAI_API_KEY=your_openai_key
OPENAI_BASE_URL=https://api.deepseek.com/v1
OPENAI_MODEL=deepseek-chat
AIHUBMIX_KEY=your_aihubmix_key
# Stock list (comma-separated)
STOCKS=600519,300750,AAPL,TSLA,00700.HK
# Notification
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id
# Optional settings
REPORT_TYPE=full # simple | full | brief
ANALYSIS_DELAY=10 # seconds between stocks (avoid rate limiting)
MAX_WORKERS=3 # concurrent analysis threads
SINGLE_STOCK_NOTIFY=false # push each stock immediately when done
NEWS_MAX_AGE_DAYS=3 # ignore news older than N daysLLM_CHANNELS=gemini,deepseek,claude
LLM_GEMINI_PROTOCOL=google
LLM_GEMINI_API_KEY=your_key
LLM_GEMINI_MODELS=gemini-2.0-flash,gemini-1.5-pro
LLM_GEMINI_ENABLED=true
LLM_DEEPSEEK_PROTOCOL=openai
LLM_DEEPSEEK_BASE_URL=https://api.deepseek.com/v1
LLM_DEEPSEEK_API_KEY=your_key
LLM_DEEPSEEK_MODELS=deepseek-chat
LLM_DEEPSEEK_ENABLED=trueSTOCK_GROUP_1=600519,300750,000858
EMAIL_GROUP_1=investor1@example.com
STOCK_GROUP_2=AAPL,TSLA,NVDA
EMAIL_GROUP_2=investor2@example.comMARKET_REVIEW=cn # cn | us | both
# cn = A-share three-phase review strategy
# us = US Regime Strategy (risk-on/neutral/risk-off)
# both = both markets# Run full analysis immediately
python main.py
# Analyze specific stocks only
STOCKS=600519,AAPL python main.py
# Run web dashboard
python web_app.py
# Access at http://localhost:5000
# Run with Docker (env file)
docker run --env-file .env stock-analysis python main.py
# Run schedule mode (waits for cron, then runs)
SCHEDULE_RUN_IMMEDIATELY=true python main.py.github/workflows/stock_analysis.yml# Default schedule - customize in the workflow file
on:
schedule:
- cron: '30 1 * * 1-5' # 9:30 AM CST (UTC+8) weekdays
workflow_dispatch: # manual trigger.github/workflows/stock_analysis.ymlgh secret set GEMINI_API_KEY --body "$GEMINI_API_KEY"
gh secret set STOCKS --body "600519,300750,AAPL,TSLA"
gh secret set TELEGRAM_BOT_TOKEN --body "$TG_TOKEN"
gh secret set TELEGRAM_CHAT_ID --body "$TG_CHAT_ID"# Run analysis for specific stocks programmatically
import asyncio
from analyzer import StockAnalyzer
async def analyze():
analyzer = StockAnalyzer()
# Analyze a single A-share stock
result = await analyzer.analyze_stock("600519") # Moutai
print(result['conclusion'])
print(result['buy_price'])
print(result['stop_loss'])
print(result['target_price'])
asyncio.run(analyze())from notifier import NotificationManager
notifier = NotificationManager()
# Send to Telegram
await notifier.send_telegram(
token=os.environ['TELEGRAM_BOT_TOKEN'],
chat_id=os.environ['TELEGRAM_CHAT_ID'],
message="📈 Analysis complete\n600519: BUY at 1680, SL: 1620, TP: 1800"
)
# Send to Feishu webhook
await notifier.send_feishu(
webhook_url=os.environ['FEISHU_WEBHOOK_URL'],
content=analysis_report
)import requests
# Ask the stock agent a strategy question
response = requests.post('http://localhost:5000/api/agent/chat', json={
"message": "600519现在适合买入吗?用均线金叉策略分析",
"stock_code": "600519",
"strategy": "ma_crossover" # ma_crossover, elliott_wave, chan_theory, etc.
})
print(response.json()['reply'])import requests
# Trigger backtest for a stock
response = requests.post('http://localhost:5000/api/backtest', json={
"stock_code": "600519",
"days": 30 # evaluate last 30 days of AI predictions
})
result = response.json()
print(f"Direction accuracy: {result['direction_accuracy']}%")
print(f"Take-profit hit rate: {result['tp_hit_rate']}%")
print(f"Stop-loss hit rate: {result['sl_hit_rate']}%")import requests
# Upload screenshot of stock list for AI extraction
with open('watchlist_screenshot.png', 'rb') as f:
response = requests.post(
'http://localhost:5000/api/stocks/import/image',
files={'image': f}
)
stocks = response.json()['extracted_stocks']
# Returns: [{"code": "600519", "name": "贵州茅台", "confidence": 0.98}, ...]python web_app.py| Route | Feature |
|---|---|
| Today's analysis dashboard |
| Holdings management, P&L tracking |
| Past analysis reports (bulk delete supported) |
| AI prediction accuracy backtest |
| Multi-turn strategy Q&A |
| LLM channels, notification config |
| Import stocks from image/CSV/clipboard |
# A-shares (6-digit code)
600519 # 贵州茅台
300750 # 宁德时代
000858 # 五粮液
# HK stocks (5-digit + .HK)
00700.HK # 腾讯控股
09988.HK # 阿里巴巴
# US stocks (ticker)
AAPL
TSLA
NVDA
# US indices
SPX # S&P 500
DJI # Dow Jones
IXIC # NASDAQ| Rule | Config |
|---|---|
| No chasing highs | |
| Trend trading | MA5 > MA10 > MA20 bullish alignment required |
| Precise targets | Buy price, stop-loss, take-profit per stock |
| News freshness | |
| Checklist | Each condition marked: ✅ Satisfied / ⚠️ Caution / ❌ Not Met |
# Check notification config
python -c "from notifier import test_all_channels; test_all_channels()"
# Verify secrets are set (GitHub Actions)
gh secret listANALYSIS_DELAY=15 # increase delay between stocks
MAX_WORKERS=1 # reduce concurrency
LITELLM_FALLBACK_MODELS=gemini-1.5-flash,deepseek-chat # add fallbackspip install akshare --upgrade
# A-share data requires Chinese network or proxypip install yfinance --upgrade
# US stocks use YFinance exclusively for consistencySettings → Actions → General → Allow all actions.github/workflows/stock_analysis.yml# If auth was disabled and re-enabled, current password required
# Reset via environment variable
WEB_ADMIN_PASSWORD=new_password# Auth toggle only applies to current process
# Must restart all workers to sync state
docker-compose restartREPORT_TYPE=simple # Concise: conclusion + key prices only
REPORT_TYPE=full # Complete: all technical + fundamental + news analysis
REPORT_TYPE=brief # 3-5 sentence summaryGemini → Anthropic → OpenAI/AIHubMix/CompatibleAIHUBMIX_KEY=$AIHUBMIX_KEY # covers Gemini, GPT, Claude, DeepSeek
# No OPENAI_BASE_URL needed — auto-configured