How wonglaitung/fortune works
This repository is a dual-market financial analysis and trading assistant for Hong Kong and A-share equities. Its principal workflow collects market and company data, derives technical and market features, produces multi-horizon model predictions and complementary analysis, combines signals into trading recommendations, then delivers reports and alerts. Separate branches cover anomaly detection, Hang Seng Index forecasts, A-share analysis, and strategy validation/performance monitoring. The README documents these capabilities; several implementation files were not sampled, so links for those branches are limited to documented workflow relationships.
Main entry points: ml_trading_model.py HK stock model · notifier.py Notification service · tencent_finance.py HK market data · comprehensive_analysis.py HK recommendations
Components 27
Market data
- HK market data
data_services/tencent_finance.py - A-share data
data_services/a_stock_data.py - Fundamentals
data_services/fundamental_data.py
Analysis and signals
- Technical indicators
data_services/technical_analysis.py - Calendar features
data_services/calendar_features.py - Sector analysis
data_services/hk_sector_analysis.py - Market regimes
data_services/regime_detector.py - Stock networks
ml_services/stock_network_analysis.py - Anomaly detection
anomaly_detector/isolation_forest_detector.py - Qwen analysis
llm_services/qwen_engine.py - HK recommendations
comprehensive_analysis.py - A-share recommendations
a_stock_comprehensive_analysis.py - HSI / HK alerts
hsi_email.py - Anomaly workflow
detect_stock_anomalies.py
Prediction and validation
- HK stock model
ml_services/ml_trading_model.py - A-share model
a_stock_ml_model.py - HSI forecasts
ml_services/hsi_ml_model.py - Walk-forward validation
ml_services/walk_forward_validation.py - Performance monitoring
ml_services/performance_monitor.py
Reports and alerts
- Notification service
message_services/notifier.py - Email delivery
message_services/email_sender.py - WeChat delivery
message_services/wechat_work_bot.py - WxPusher delivery
message_services/wxpusher_bot.py
Other components
- Investor / schedule
- Qwen API
- SMTP server
- Report recipients
Connections 32
- Investor / schedule → HK recommendations: requests report
- Investor / schedule → A-share recommendations: requests report
- HK market data → Technical indicators: provides prices
- HK market data → Fundamentals: provides market context
- HK market data → Sector analysis: provides prices
data_services/hk_sector_analysis.py - HK market data → Calendar features: provides market data
data_services/calendar_features.py - A-share data → A-share model: provides prices
data_services/a_stock_data.py - Technical indicators → HK stock model: supplies features
ml_services/ml_trading_model.py - Fundamentals → HK stock model: supplies features
ml_services/ml_trading_model.py - Calendar features → HK stock model: supplies features
ml_services/ml_trading_model.py - Market regimes → HK stock model: supplies features
ml_services/ml_trading_model.py - Sector analysis → HK stock model: supplies features
ml_services/ml_trading_model.py - Stock networks → HK stock model: supplies features
- HK market data → HSI forecasts: provides prices
- Anomaly detection → HSI forecasts: detects outliers
- HK stock model → HK recommendations: provides predictions
comprehensive_analysis.py - Qwen analysis → HK recommendations: provides analysis
comprehensive_analysis.py - Qwen API → Qwen analysis: answers requests
llm_services/qwen_engine.py - A-share model → A-share recommendations: provides predictions
- HSI forecasts → HSI / HK alerts: provides forecasts
- Anomaly workflow → Anomaly detection: runs detection
- HK recommendations → Notification service: sends report
- A-share recommendations → Notification service: sends report
- HSI / HK alerts → Notification service: sends alerts
- Notification service → Email delivery: dispatches email
message_services/__init__.py - Notification service → WeChat delivery: dispatches WeChat
message_services/__init__.py - Notification service → WxPusher delivery: dispatches push
message_services/__init__.py - Email delivery → SMTP server: sends mail
message_services/email_sender.py - Email delivery → Report recipients: delivers report
- HK stock model → Walk-forward validation: evaluates model
ml_services/walk_forward_validation.py - Walk-forward validation → Performance monitoring: tracks performance
- Performance monitoring → Notification service: reports metrics
ml_services/performance_monitor.py