Standalone stock-analysis agent toolkit for China A-shares, US stocks, and Hong Kong stocks.
This repository now contains one recommended deep-wide analysis skill plus multiple standalone strategy skills. The recommended entry point is love_stock_deep_wide/: it collects stock data, recent candles, chip data where available, news, market-wide context, sector/breadth data, then produces a clean Markdown report suitable for email delivery.
Author: Miraclemin
中文说明见 README.zh-CN.md.
Open strategy-learning.html in a browser to learn all built-in strategies visually. The page includes a Chinese/English language selector and three simple SVG examples for each strategy: when to buy, when to wait, and when not to enter.
love_stock_deep_wide/
Use this for day-to-day analysis. The final report contains:
- Market-wide recap
- Core conclusion
- Quote and data status
- Technical-method table
- Fundamentals and catalysts
- Risks
- Suggestions for empty-position users
- Suggestions for holders
- Data confidence
- Interface-status appendix
Quick run:
cd love_stock_deep_wide
python scripts/analyze.py --check-config
python scripts/analyze.py --stocks 600487 --no-emailSend a finalized current-agent report:
python scripts/analyze.py \
--send-final-report /path/to/final_report.md \
--base-report ~/.stock_analysis/reports/report_xxx.md- Uses Tushare first for stock and market data, then falls back to Tencent, AkShare, or Yahoo when needed.
- Adds a market-wide recap before individual-stock analysis.
- Includes recent 10 daily candles in the prompt, so candlestick patterns such as
One Yang Three Yincan be judged directly. - Outputs a technical-method table that compares trend, pullback, breakout, MA cross, range, sentiment, theme, event, growth, Chan theory, wave theory, and other methods.
- Produces a clean email version: main report first, interface status as an appendix.
For A-shares:
- Index trend: Shanghai Composite, Shenzhen Component, ChiNext alignment, volume, support/resistance.
- Fund sentiment: up/down breadth, limit-up/limit-down structure, turnover, high-position divergence.
- Main sectors: leading/lagging sectors, event catalysts, leader stocks, downside spread.
For Hong Kong stocks:
- Hang Seng Index, Hang Seng Tech, HSCEI trend.
- Southbound flow and liquidity/risk appetite.
- Tech/platform, financial, property, consumer, and defensive rotation.
For US stocks:
- SPX, NDX, DJI alignment.
- Treasury yields, USD, inflation/Fed narrative.
- AI, semiconductor, software, megacap tech, financials, energy, defensives, and small-cap rotation.
The market module answers:
- Should I trade tomorrow?
- Which directions should I watch?
- Which stock signals are more credible?
- What conditional plan should I follow tomorrow?
- What conditions prevent impulsive open-market decisions?
love_stock_deep_wide already includes the analysis logic represented by the standalone strategy skills and combines them into one broad comparison table inside the final report. If you only want one method, each stock_*_analysis/ directory can still be executed independently with its own SKILL.md, scripts, configuration template, and reporting references.
| Directory | Strategy | Principle | Best For |
|---|---|---|---|
love_stock_deep_wide |
Deep-wide analysis | Market recap plus broad technical-method comparison | Default complete report |
stock_bull_trend_analysis |
Bull trend | MA5/MA10/MA20 alignment, rising MA20, controlled pullback, volume breakout | Trend-following stocks |
stock_shrink_pullback_analysis |
Shrink-volume pullback | Uptrend pullback to MA5/MA10 with contracting volume | Low-risk trend entries |
stock_volume_breakout_analysis |
Volume breakout | Resistance breakout confirmed by volume above 2x short average | Platform breakouts |
stock_ma_golden_cross_analysis |
MA golden cross | MA5 crossing MA10, MA10 crossing MA20, MACD/volume confirmation | Early trend starts |
stock_bottom_volume_analysis |
Bottom volume surge | Deep drawdown followed by high-volume bullish stabilization | Reversal attempts |
stock_box_oscillation_analysis |
Box range trading | Buy near range support, reduce near resistance, confirm breakouts by volume | Range trading |
stock_one_yang_three_yin_analysis |
One Yang Three Yin | Big bullish candle, three shrinking small/bearish candles, then bullish breakout | Short-term pattern confirmation |
stock_dragon_head_analysis |
Dragon head | Sector leadership, relative strength, active turnover, catalyst resonance | Sector/theme leaders |
stock_hot_theme_analysis |
Hot theme | Theme strength, stock relevance, relative strength, retreat risk | Theme rotation |
stock_emotion_cycle_analysis |
Sentiment cycle | Turnover, volume pulses, news tone, MA compression, volatility | Emotion bottom/top detection |
stock_event_driven_analysis |
Event-driven | Earnings, policy, order/product, M&A, regulatory event impact path | News/announcement catalysts |
stock_expectation_repricing_analysis |
Expectation repricing | Whether new information improves, realizes, or invalidates market expectations | Earnings/valuation rerating |
stock_growth_quality_analysis |
Growth quality | Revenue, profit, cash flow, ROE, valuation durability | Medium/long-term growth stocks |
stock_chan_theory_analysis |
Chan theory | Fractal, stroke, segment, central range, divergence, buy/sell point | Structural trading |
stock_wave_theory_analysis |
Elliott wave | Five-wave impulse and three-wave correction with Fibonacci levels | Swing structure analysis |
Run a single strategy:
cd stock_volume_breakout_analysis
python scripts/analyze.py --stocks 600487 --no-email| Data | Priority |
|---|---|
| A-share daily bars | Tushare daily |
| A-share quote supplement | Tushare realtime plus Tencent fields |
| A-share chip data | Tushare cyq_chips -> cyq_perf -> AkShare/Eastmoney -> local estimate |
| A-share market indices | Tushare index_daily -> Tencent indices |
| A-share market breadth | Tushare daily full-market statistics -> AkShare |
| A-share sectors | Tushare ths_index + ths_daily -> Tushare moneyflow_ind_ths -> Tushare moneyflow_ind_dc -> AkShare |
| HK daily bars | Tushare hk_daily -> Yahoo |
| HK market context | Tushare HK data -> Yahoo index/ETF proxies |
| US daily bars | Tushare us_daily -> Yahoo |
| US market context | Tushare US data -> Yahoo index/ETF proxies |
| News | Tavily / SerpAPI / SearXNG |
git clone https://github.com/Miraclemin/love-stock.git
cd love-stock/love_stock_deep_wide
python -m pip install -r requirements.txt
python scripts/analyze.py --check-configThe first config check creates:
~/.stock_analysis/.env
Edit it, then check again:
python scripts/analyze.py --check-configConfiguration priority:
process environment variables > ~/.stock_analysis/.env > local .env > defaults
Common fields:
TUSHARE_TOKEN=
TAVILY_API_KEYS=
SERPAPI_API_KEYS=
SEARXNG_BASE_URLS=
SEARXNG_PUBLIC_INSTANCES_ENABLED=true
NEWS_MAX_AGE_DAYS=3
REPORT_LANGUAGE=zh
EMAIL_ENABLED=false
EMAIL_SMTP_HOST=smtp.gmail.com
EMAIL_SMTP_PORT=587
EMAIL_USE_TLS=true
EMAIL_USER=
EMAIL_SENDER=
EMAIL_PASSWORD=
EMAIL_FROM=
EMAIL_TO=Full setup guide: love_stock_deep_wide/references/configuration.md.
# A-share
python scripts/analyze.py --stocks 600487 --no-email
# US stock
python scripts/analyze.py --stocks NVDA --no-email
# Hong Kong stock
python scripts/analyze.py --stocks 00700.HK --no-email
# Mixed markets
python scripts/analyze.py --stocks 600487,NVDA,00700.HK --no-email
# Chinese names require Tushare
python scripts/analyze.py --stocks 北方华创,亨通光电 --no-emailPut the desired skill directory under your client skill directory. For daily complete analysis:
~/.codex/skills/love_stock_deep_wide/
For strategy-only analysis:
~/.codex/skills/stock_volume_breakout_analysis/
~/.codex/skills/stock_shrink_pullback_analysis/
Data collection writes:
~/.stock_analysis/reports/report_YYYYMMDD_HHMMSS.md
~/.stock_analysis/prompts/prompt_YYYYMMDD_HHMMSS_1_CODE.md
After the current Agent writes the final report:
python scripts/analyze.py \
--send-final-report final_report.md \
--base-report ~/.stock_analysis/reports/report_YYYYMMDD_HHMMSS.mdThe email body uses the final report as the main content and appends interface status at the end.
- API keys are stored in
~/.stock_analysis/.env; do not commit that file. --check-configmasks secrets asset,set(n), ormissing.- Missing optional providers degrade the report; the tool should not fabricate data.
- This project is for research and workflow automation only. It is not financial advice.
MIT. See LICENSE.