| name | oh-my-stock |
| description | Run a lightweight TradingAgents-style stock analysis workflow as a Codex skill without external LLM API calls. Use this whenever the user asks Codex to analyze stocks/tickers with multi-agent TradingAgents-like logic, generate a Chinese or English investment research report, assemble analyst prompts, inspect generated market/news context, or troubleshoot the local oh-my-stock workflow. |
Oh My Stock
Use this skill to provide a closed-loop lightweight TradingAgents-style workflow from data collection to report delivery. The skill does not clone/import the upstream repository and does not call an external LLM. Scripts collect public market/news data and assemble role-specific prompts; Codex itself reads the prompt bundle, performs the analysis, and writes the final report.
TradingAgents-Style Pipeline
Follow this business pipeline. The scripts implement these stages, but Codex should explain and report results in the same structure.
Step 1: Resolve the Instrument
Map the user's stock name or ticker to a market symbol before running analysis.
Examples:
兆易创新 -> 603986.SH
NVDA -> NVDA
腾讯控股 -> 0700.HK
If the mapping is uncertain, say the assumed ticker explicitly before running.
Step 2: Build a Data Snapshot
Collect public market context for the analysis date:
- daily price history up to the requested date
- latest close, volume, returns, volatility
- technical indicators: SMA20/50/200, RSI14, MACD
- recent public Yahoo Finance news headlines when available
This stage is deterministic and does not require an LLM.
Step 3: Assemble Analyst Prompts
Assemble selected analyst roles over the same data snapshot:
market: trend, momentum, volatility, support/resistance
social: sentiment inferred from headlines
news: company/macro news relevance
fundamentals: valuation/fundamental caveats and missing-data disclosure
Do not call an external LLM. Codex must use the generated prompts and context to write each analyst section itself.
Step 4: Run Bull/Bear Research Debate
Create two opposing research views:
- Bull Researcher: strongest positive thesis
- Bear Researcher: strongest negative thesis and risk challenge
Then Codex, acting as Research Manager, synthesizes them into a balanced investment view with one explicit rating:
Buy, Overweight, Hold, Underweight, or Sell.
Step 5: Create a Trader Plan
Convert the research view into a research-only trade plan:
- entry logic
- invalidation condition
- risk controls
- position-sizing caveats
Do not represent this as live trading advice.
Step 6: Run Risk Review
Create three risk perspectives:
- Aggressive Risk Analyst
- Conservative Risk Analyst
- Neutral Risk Analyst
Use them to expose upside/downside asymmetry, concentration risk, volatility risk, and data-quality limits.
Step 7: Portfolio Decision and Artifacts
Codex, acting as Portfolio Manager, synthesizes all prior reports into the final decision. Save:
final_report.md
final_state.json
- per-stage markdown sections, if generated
run_summary.json
Return the final rating, short rationale, and artifact paths to the user.
Operating Workflow
-
Resolve the skill root:
SKILL_ROOT="${CODEX_HOME:-$HOME/.codex}/skills/oh-my-stock"
If running from a source checkout before installation, use the local oh-my-stock directory as SKILL_ROOT.
-
Prepare local directories:
python "$SKILL_ROOT/scripts/bootstrap.py"
-
Check configuration:
python "$SKILL_ROOT/scripts/configure.py" --check
-
If language or output settings are missing, help the user configure them:
python "$SKILL_ROOT/scripts/configure.py" --interactive
-
Build the prompt/data bundle:
python "$SKILL_ROOT/scripts/run_analysis.py" --ticker NVDA --date 2026-05-20 --analysts market news fundamentals --language Chinese
-
Read prompt_bundle.md and data_snapshot.json from the output directory. Codex must then write the final report itself using the TradingAgents-style stages.
-
Save the completed report to final_report.md in the same output directory.
-
Backfill final_state.json from the completed report:
python "$SKILL_ROOT/scripts/finalize_report.py" --output-dir <output_dir>
-
Report back:
- final decision/rating
- generated report directory
- data snapshot path
- any data-fetch warnings or assumptions
Common Commands
Check status only:
python "$SKILL_ROOT/scripts/configure.py" --check
Install or update runtime:
python "$SKILL_ROOT/scripts/bootstrap.py" --upgrade
Build prompts with fewer analysts:
python "$SKILL_ROOT/scripts/run_analysis.py" --ticker AAPL --date 2026-05-20 --analysts market news --research-depth 1
Analyst Selection
Use these analyst keys:
market: price/technical analysis
social: sentiment/news sentiment analysis
news: company/global news and insider-related context
fundamentals: financial statements and fundamentals
For crypto tickers such as BTC-USD, avoid fundamentals unless the user explicitly asks.
Configuration Rules
Store optional configuration in the user-level runtime directory:
~/.ohmystock/.env
The scripts read this file and export values before building the prompt bundle. External LLM provider keys are not required because Codex is the reasoning engine. Reports, cache, and intermediate prompt bundles are also written under ~/.ohmystock/ by default.
Supported common variables:
ALPHA_VANTAGE_API_KEY=
OH_MY_STOCK_OUTPUT_LANGUAGE=Chinese
OH_MY_STOCK_RESULTS_DIR=~/.ohmystock/results
OH_MY_STOCK_CACHE_DIR=~/.ohmystock/cache
Legacy TRADINGAGENTS_* variables are still accepted for compatibility.
References
Read references/tradingagents.md when you need implementation details, provider notes, or troubleshooting guidance.
Safety
TradingAgents produces research reports, not financial advice or live orders. State that outputs are for research/education. Do not claim performance, guarantee returns, or present the result as a real trade instruction.