Daily Stock Analysis: LLM-Powered Multi-Market Stock Intelligence System
An LLM-driven multi-market stock analysis system with real-time news, decision dashboards, and automated notifications. 48K stars. Supports zero-cost scheduled runs.
- Updated 2026-06-25
Daily Stock Analysis: LLM-Powered Multi-Market Stock Intelligence #
Daily Stock Analysis is an open-source, LLM-driven stock analysis system that provides multi-market intelligence with real-time news aggregation, automated decision dashboards, and intelligent notification systems. With 48,278 GitHub stars, it has become one of the most popular quantitative trading tools for retail investors seeking institutional-grade analysis.
This article covers installation, market data sources, LLM integration, dashboard configuration, automated analysis, and deployment strategies.
TL;DR #
Daily Stock Analysis combines real-time market data, news sentiment analysis, and LLM-powered insights into a unified decision-making platform. It supports multiple markets including US stocks, A-shares, cryptocurrencies, and futures. The system can run entirely for free with scheduled automated analysis, making institutional-quality stock research accessible to everyone.
What Is Daily Stock Analysis? #
Daily Stock Analysis is a comprehensive stock intelligence platform that leverages large language models to analyze market data, news sentiment, and technical indicators. Unlike traditional charting tools that only show price movements, this system provides contextual analysis that explains WHY markets are moving and WHAT might happen next.
The platform supports multiple markets and data sources:
- US Markets: NYSE, NASDAQ, with real-time and delayed data
- A-Shares: Shanghai and Shenzhen exchanges with comprehensive coverage
- Cryptocurrency: Major exchanges including Binance, Coinbase, and Kraken
- Futures & Commodities: Oil, gold, agricultural products, and indices
- Forex: Major currency pairs with real-time exchange rates
Installation Guide #
Prerequisites #
- Python: 3.10+ (3.11 recommended)
- Database: PostgreSQL 14+ or SQLite (for lightweight setups)
- LLM API: OpenAI, Anthropic, or local models via Ollama
- Market Data API: Tushare (A-shares), AKShare (free), or paid providers
- System: 8GB RAM minimum, 4GB for SQLite mode
Option 1: Docker Deployment (Easiest) #
# Clone the repository
git clone https://github.com/ZhuLinsen/daily_stock_analysis.git
cd daily_stock_analysis
# Configure environment variables
cp .env.example .env
# Edit .env with your API keys
# Start all services
docker compose up -d
# Check status
docker compose ps
Option 2: Manual Installation #
# Clone the repository
git clone https://github.com/ZhuLinsen/daily_stock_analysis.git
cd daily_stock_analysis
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Set up the database
python setup_database.py --init
# Configure LLM and data sources
cp config.example.yaml config.yaml
# Edit config.yaml with your settings
# Run the first analysis
python main.py --market us --date $(date +%Y-%m-%d)
Option 3: Local LLM Setup (Free) #
For users who want to avoid API costs entirely:
# Install Ollama for local LLM inference
curl -fsSL https://ollama.ai/install.sh | sh
# Pull a suitable model
ollama pull qwen2.5:14b
# Update config.yaml to use local model
cat >> config.yaml << EOF
llm:
provider: ollama
model: qwen2.5:14b
base_url: http://localhost:11434
EOF
# Run analysis with zero API costs
python main.py --market a_shares --date $(date +%Y-%m-%d)
Market Data Integration #
AKShare Integration (Free A-Share Data) #
AKShare provides free access to Chinese market data without any API key:
import akshare as ak
# Get daily A-share market data
df = ak.stock_zh_a_spot_em()
print(df.head())
# Get historical price data
hist_df = ak.stock_zh_a_hist(
symbol="000001",
period="daily",
start_date="20260101",
end_date="20260625",
adjust="qfq"
)
# Get sector performance
sector_df = ak.stock_board_industry_name_em()
print(sector_df)
Tushare Integration (Premium A-Share Data) #
For more comprehensive A-share data including fundamentals:
import tushare as ts
# Initialize with your API token
pro = ts.pro_api("YOUR_TUSHARE_TOKEN")
# Get daily A-share data
df = pro.daily(
ts_code="000001.SZ",
start_date="20260101",
end_date="20260625"
)
# Get financial statements
income_df = pro.income(
ts_code="000001.SZ",
period="20260331",
fields="total_operating_income,net_profit,total_expense"
)
# Get shareholder information
holder_df = pro.stock_holder_top10(
ts_code="000001.SZ",
ann_date="20260331"
)
US Market Data #
import yfinance as yf
# Get US stock data
ticker = yf.Ticker("AAPL")
df = ticker.history(period="3mo")
# Get options chain
options = ticker.options
# Get analyst recommendations
recommendations = ticker.recommendations
# Get news sentiment
news = ticker.news
for item in news:
print(f"{item['title']}: {item['providerPublishTime']}")
Cryptocurrency Data #
import ccxt
# Connect to exchange
exchange = ccxt.binance({
'apiKey': 'YOUR_API_KEY',
'secret': 'YOUR_SECRET',
})
# Get ticker data
ticker = exchange.fetch_ticker('BTC/USDT')
print(f"Price: {ticker['last']}")
print(f"Volume: {ticker['quoteVolume']}")
# Get order book
order_book = exchange.fetch_order_book('ETH/USDT')
print(f"Bid: {order_book['bids'][0][0]}")
print(f"Ask: {order_book['asks'][0][0]}")
LLM-Powered Analysis #
Sentiment Analysis Pipeline #
The core of Daily Stock Analysis is its LLM-powered sentiment analysis pipeline:
from daily_stock_analysis.llm import LLMAnalyzer
from daily_stock_analysis.data import MarketDataProvider
# Initialize components
llm = LLMAnalyzer(model="gpt-4o", temperature=0.3)
data_provider = MarketDataProvider(source="akshare")
# Fetch market data and news
market_data = data_provider.get_market_data(
symbol="000001.SZ",
period="1d",
indicators=["rsi", "macd", "bollinger"]
)
news_data = data_provider.get_news(
symbol="000001.SZ",
days=7,
sources=["eastmoney", "cls", "cnbc"]
)
# Run LLM analysis
analysis = llm.analyze_market(
market_data=market_data,
news_data=news_data,
prompt_template="comprehensive_analysis"
)
print(f"Overall Sentiment: {analysis.sentiment}")
print(f"Confidence: {analysis.confidence:.1%}")
print(f"Key Factors: {', '.join.analysis.key_factors)}")
print(f"Risk Level: {analysis.risk_level}")
Custom Analysis Prompts #
You can customize the LLM analysis prompts for different use cases:
# Technical analysis prompt
tech_prompt = """
Analyze the following stock technical indicators and provide:
1. Trend direction (bullish/bearish/neutral)
2. Key support and resistance levels
3. Momentum assessment
4. Volume analysis interpretation
5. Overall technical rating (1-10)
Data: {market_data}
"""
# Fundamental analysis prompt
fund_prompt = """
Analyze the following fundamental data and provide:
1. Revenue growth assessment
2. Profitability evaluation
3. Debt sustainability
4. Valuation comparison
5. Overall fundamental rating (1-10)
Data: {fundamental_data}
"""
# Combined analysis
combined = llm.analyze(
prompt_template="combined_analysis",
market_data=market_data,
fundamental_data=fundamental_data,
news_data=news_data
)
Multi-Market Comparative Analysis #
Compare stocks across different markets simultaneously:
# Compare US tech stocks
us_techs = llm.compare_stocks(
symbols=["AAPL", "MSFT", "GOOGL", "AMZN", "META"],
market="us",
comparison_metrics=["pe_ratio", "revenue_growth", "profit_margin"]
)
# Compare A-share sectors
a_share_sectors = llm.compare_sectors(
sectors=["新能源", "半导体", "医药", "消费"],
market="a_shares",
time_period="1m"
)
Dashboard Configuration #
Web Dashboard Setup #
Daily Stock Analysis includes a built-in web dashboard:
# Start the dashboard server
python dashboard.py --host 0.0.0.0 --port 8080
# Access at http://localhost:8080
The dashboard provides:
- Real-time market overview with heat maps
- Individual stock analysis with interactive charts
- Sector performance comparisons
- News sentiment timeline
- Automated analysis reports
Dashboard Customization #
# dashboard_config.yaml
dashboard:
refresh_interval: 300 # 5 minutes
default_market: "a_shares"
charts:
- type: "heatmap"
title: "Market Heatmap"
data_source: "sector_performance"
- type: "line"
title: "Stock Price History"
data_source: "historical_prices"
- type: "sentiment"
title: "News Sentiment"
data_source: "llm_sentiment"
alerts:
- threshold: 0.8
action: "notification"
channels: ["email", "telegram"]
Exporting Reports #
# Generate daily report in PDF
python report_generator.py --format pdf --output daily_report.pdf
# Generate HTML report with charts
python report_generator.py --format html --output daily_report.html
# Export analysis data as CSV
python report_generator.py --format csv --output analysis_data.csv
Automated Scheduling #
Cron Job Setup #
Schedule automatic analysis runs:
# Edit crontab
crontab -e
# Add daily analysis at 7 AM
0 7 * * * cd /path/to/daily_stock_analysis && python main.py --market a_shares --auto
# Add US market analysis after market open
0 21 * * 1-5 cd /path/to/daily_stock_analysis && python main.py --market us --auto
# Weekly comprehensive report on Sunday
0 9 * * 0 cd /path/to/daily_stock_analysis && python weekly_report.py
Systemd Service #
For persistent background operation:
# /etc/systemd/system/daily-stock-analysis.service
[Unit]
Description=Daily Stock Analysis Service
After=network.target postgresql.service
[Service]
Type=simple
User=stockuser
WorkingDirectory=/opt/daily_stock_analysis
ExecStart=/opt/daily_stock_analysis/venv/bin/python main.py --daemon
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
# Enable and start the service
sudo systemctl enable daily-stock-analysis
sudo systemctl start daily-stock-analysis
sudo systemctl status daily-stock-analysis
Notification System #
Telegram Notifications #
# Configure Telegram bot
python notify.py --setup telegram \
--bot-token "${TELEGRAM_BOT_TOKEN}" \
--chat-id "${TELEGRAM_CHAT_ID}"
# Send test notification
python notify.py --send "Daily analysis complete for AAPL" \
--channel telegram
Email Notifications #
from daily_stock_analysis.notify import Notifier
# Configure email notifier
notifier = Notifier(
provider="smtp",
smtp_server="smtp.gmail.com",
smtp_port=587,
username="your_email@gmail.com",
password="your_app_password"
)
# Send analysis report
notifier.send_email(
to="your_email@gmail.com",
subject="Daily Stock Analysis Report",
body=analysis_report,
attach_pdf=True
)
Custom Webhook Notifications #
# Send to custom webhook (e.g., Slack, Discord)
notifier.send_webhook(
url="https://hooks.slack.com/services/YOUR/WEBHOOK/URL",
payload={
"text": f"Analysis complete for {symbol}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": f"*{symbol}* - Sentiment: {sentiment}"
}
}
]
}
)
Comparison: Daily Stock Analysis vs Alternatives #
| Feature | Daily Stock Analysis | TradingView | Wind Financial | Choice Info |
|---|---|---|---|---|
| Price | Free | $15-60/mo | ¥5,000+/year | ¥3,000+/year |
| Open Source | Yes | No | No | No |
| LLM Analysis | Built-in | No | Basic | No |
| Multi-Market | Yes | Yes | China only | China only |
| API Access | Full REST | Paid API | Limited | Limited |
| Custom Scripts | Yes | Pine Script | No | No |
| Self-Hosted | Yes | No | No | No |
| A-Share Support | Comprehensive | Basic | Full | Full |
Limitations #
- LLM dependency: Analysis quality depends on the LLM provider’s capabilities and accuracy
- Data latency: Free data sources may have delays compared to paid real-time feeds
- Market coverage: While extensive, not every micro-cap or exotic security is covered
- Regulatory compliance: Users are responsible for ensuring their analysis tools comply with local regulations
- Past performance disclaimer: LLM analysis is informational only and should not be considered financial advice
Getting Started Checklist #
# 1. Clone the repository
git clone https://github.com/ZhuLinsen/daily_stock_analysis.git
cd daily_stock_analysis
# 2. Set up environment
cp .env.example .env
# Add your API keys
# 3. Install dependencies
pip install -r requirements.txt
# 4. Initialize database
python setup_database.py --init
# 5. Run first analysis
python main.py --market a_shares --date $(date +%Y-%m-%d)
# 6. Start dashboard
python dashboard.py --port 8080
# 7. Set up automated scheduling
crontab -e
# Add daily analysis cron job
Conclusion #
Daily Stock Analysis bridges the gap between institutional-grade stock research and retail investor accessibility. By leveraging LLM technology and free data sources, it provides comprehensive multi-market analysis that would traditionally require expensive Bloomberg terminals or Wind Financial systems.
Whether you are a seasoned quantitative trader or a beginner exploring the markets, Daily Stock Analysis offers the tools and insights needed to make informed decisions. Its open-source nature ensures transparency, while its active community guarantees continuous improvement and support.
Sources #
- Daily Stock Analysis GitHub Repository
- AKShare Documentation
- Tushare Data Platform
- CCXT Cryptocurrency Exchange Library
CTA #
Start your free stock analysis journey today. Visit the GitHub repository to get started. For hosting your analysis system, consider HTStack for affordable VPS hosting, or DigitalOcean for managed cloud services.
For Chinese users who need GPU resources for local LLM inference, 虎网云 offers affordable GPU servers starting at ¥0.5/hour.
FAQ #
q: Can I use this system with zero cost? #
a: Yes. By using AKShare for free A-share data, Ollama for local LLM inference, and SQLite instead of PostgreSQL, you can run the entire system at zero cost. The only requirement is an internet connection and a computer that can run Python.
q: Which LLM model is recommended for stock analysis? #
a: For best results, use GPT-4o or Claude Sonnet for comprehensive analysis. For local deployment, Qwen2.5 14B or 32B models provide good balance of quality and speed. The system supports any OpenAI-compatible API endpoint.
q: How often should I run the analysis? #
a: For A-shares, daily analysis before market open (7-8 AM Beijing time) is recommended. For US stocks, run analysis after market close (11 PM Beijing time). Cryptocurrency markets run 24/7, so hourly or real-time analysis is beneficial.
q: Can I add my own custom indicators? #
a: Yes. The system supports custom technical indicators through Python plugins. You can define your own formulas, backtest them against historical data, and integrate them into the LLM analysis pipeline.
q: Is the system suitable for algorithmic trading? #
a: While Daily Stock Analysis provides excellent research and analysis capabilities, it is primarily designed for informational purposes. For algorithmic trading, you would need to integrate its output with a trading execution system and implement proper risk management protocols.
q: Does it support options and futures analysis? #
a: The system includes basic options and futures data support through CCXT and market data providers. However, advanced derivatives analysis features are still under development. Check the GitHub issues page for the latest updates on derivatives support.
💬 Discussion