Stock Analyst Specialist
Overview
Wraps virattt/ai-hedge-fund and
ZhuLinsen/daily_stock_analysis.
Orchestrates a three-stage fixture pipeline for a requested ticker string: synthetic fundamentals,
synthetic technical indicators, and synthetic news sentiment. The layers are merged into a structured
response with a demonstration stance signal.
No market data is loaded. Every price, ratio, indicator, article count, theme, and stance is generated
deterministically from the ticker string and is unsuitable for trading or valuation.
Prerequisites
- Use Python 3.11+ in a local OSS Agent Lab checkout and run
pip install -e ..
- Use a valid test ticker and treat the response strictly as fixture data.
- Read the runtime contract for supported bounds and disclaimers.
Capabilities
- analyze: Exercise the full synthetic pipeline for a ticker and period label.
- finance: Return a finance-shaped fixture for integration tests.
- stock_analysis: Generate price, market cap, P/E, sector, and recommendation fixtures.
- technical_analysis: Generate RSI, MACD, moving-average, and signal fixtures.
Tools
| Tool |
Description |
Side Effects |
analyze_ticker |
Generate synthetic fundamental fields |
None |
technical_indicators |
Generate synthetic indicator fields |
None |
news_sentiment |
Generate synthetic sentiment, count, and theme fields |
None |
Parameters
All parameters are passed via request.intent.parameters:
| Parameter |
Type |
Default |
Description |
ticker |
str |
(query text) |
Stock ticker symbol, e.g. AAPL |
period |
str |
"1y" |
Lookback period: 1m, 3m, 6m, 1y, 3y, 5y |
indicators |
list[str] |
all |
Subset of rsi, macd, moving_averages |
days |
int |
7 |
News lookback window in calendar days |
Instructions
- Normalize a non-empty ticker and choose a supported period, indicator subset, and day count.
- Run the local Python API or CLI.
- Label all values and recommendations as synthetic test output.
- For real analysis, obtain timestamped data from an authoritative provider and use qualified advice.
Examples
Python API
from agents.specialists.stock_analyst.agent import StockAnalystSpecialist
from oss_agent_lab.contracts import Intent, Query, SpecialistRequest
specialist = StockAnalystSpecialist()
request = SpecialistRequest(
intent=Intent(
action="analyze",
domain="finance",
confidence=0.95,
parameters={"ticker": "AAPL", "period": "1y", "days": 14},
),
query=Query(user_input="AAPL"),
specialist_name="stock_analyst",
)
response = await specialist.execute(request)
print(response.result["summary"]["overall_stance"]) # "bullish" | "neutral" | "bearish"
CLI
oss-lab run stock_analyst "AAPL"
Output shape
{
"ticker": "AAPL",
"fundamental": {
"price": 182.0,
"market_cap": 295.4,
"pe_ratio": 28.0,
"recommendation": "hold",
"sector": "Technology"
},
"technical": {
"rsi": 54.0,
"macd": {"line": 1.2, "signal": 0.8, "histogram": 0.4},
"moving_averages": {"sma_20": 183.6, "sma_50": 185.2, "sma_200": 179.1},
"signals": ["RSI neutral", "MACD bullish crossover", "Short-term trend above medium-term: bullish bias"]
},
"sentiment": {
"overall_sentiment": "positive",
"articles_analyzed": 23,
"key_themes": ["earnings beat", "product launch"],
"sentiment_score": 0.65
},
"summary": {
"overall_stance": "bullish",
"confidence": 0.715,
"key_signals": ["Fundamental: hold (P/E 28.0)", "Sentiment: positive (+0.650)"],
"risk_note": "Simulated outputs — not financial advice. Verify with live market data before acting."
}
}
Output
The response combines synthetic fundamental, technical, sentiment, and summary dictionaries. The
risk_note states that outputs are simulated; preserve it in every user-facing rendering.
Error Handling
- Reject empty tickers, unsupported periods/indicators, and non-positive news windows.
- Never infer that an upstream API, filing, exchange, or news source was contacted.
- Refuse to frame the generated buy/hold/sell value as financial advice.
Resources
Wraps virattt/ai-hedge-fund and
ZhuLinsen/daily_stock_analysis.
The local specialist only mirrors pipeline patterns. See
the runtime contract.
1---2name: stock-analyst3description: Generate deterministic synthetic fundamentals, indicators, and news sentiment from a ticker string. Use when testing the Stock Analyst response contract, never for an investment decision. Trigger with simulate stock analysis.4license: MIT5---67# Stock Analyst Specialist89## Overview1011Wraps [virattt/ai-hedge-fund](https://github.com/virattt/ai-hedge-fund) and12[ZhuLinsen/daily_stock_analysis](https://github.com/ZhuLinsen/daily_stock_analysis).1314Orchestrates a three-stage fixture pipeline for a requested ticker string: synthetic fundamentals,15synthetic technical indicators, and synthetic news sentiment. The layers are merged into a structured16response with a demonstration stance signal.1718No market data is loaded. Every price, ratio, indicator, article count, theme, and stance is generated19deterministically from the ticker string and is unsuitable for trading or valuation.2021## Prerequisites2223- Use Python 3.11+ in a local OSS Agent Lab checkout and run `pip install -e .`.24- Use a valid test ticker and treat the response strictly as fixture data.25- Read [the runtime contract](references/runtime-contract.md) for supported bounds and disclaimers.2627## Capabilities2829- **analyze**: Exercise the full synthetic pipeline for a ticker and period label.30- **finance**: Return a finance-shaped fixture for integration tests.31- **stock_analysis**: Generate price, market cap, P/E, sector, and recommendation fixtures.32- **technical_analysis**: Generate RSI, MACD, moving-average, and signal fixtures.3334## Tools3536| Tool | Description | Side Effects |37|------|-------------|--------------|38| `analyze_ticker` | Generate synthetic fundamental fields | None |39| `technical_indicators` | Generate synthetic indicator fields | None |40| `news_sentiment` | Generate synthetic sentiment, count, and theme fields | None |4142## Parameters4344All parameters are passed via `request.intent.parameters`:4546| Parameter | Type | Default | Description |47|-----------|------|---------|-------------|48| `ticker` | `str` | *(query text)* | Stock ticker symbol, e.g. `AAPL` |49| `period` | `str` | `"1y"` | Lookback period: `1m`, `3m`, `6m`, `1y`, `3y`, `5y` |50| `indicators` | `list[str]` | all | Subset of `rsi`, `macd`, `moving_averages` |51| `days` | `int` | `7` | News lookback window in calendar days |5253## Instructions54551. Normalize a non-empty ticker and choose a supported period, indicator subset, and day count.562. Run the local Python API or CLI.573. Label all values and recommendations as synthetic test output.584. For real analysis, obtain timestamped data from an authoritative provider and use qualified advice.5960## Examples6162### Python API6364```python65from agents.specialists.stock_analyst.agent import StockAnalystSpecialist66from oss_agent_lab.contracts import Intent, Query, SpecialistRequest6768specialist = StockAnalystSpecialist()6970request = SpecialistRequest(71 intent=Intent(72 action="analyze",73 domain="finance",74 confidence=0.95,75 parameters={"ticker": "AAPL", "period": "1y", "days": 14},76 ),77 query=Query(user_input="AAPL"),78 specialist_name="stock_analyst",79)8081response = await specialist.execute(request)82print(response.result["summary"]["overall_stance"]) # "bullish" | "neutral" | "bearish"83```8485### CLI8687```bash88oss-lab run stock_analyst "AAPL"89```9091### Output shape9293```json94{95 "ticker": "AAPL",96 "fundamental": {97 "price": 182.0,98 "market_cap": 295.4,99 "pe_ratio": 28.0,100 "recommendation": "hold",101 "sector": "Technology"102 },103 "technical": {104 "rsi": 54.0,105 "macd": {"line": 1.2, "signal": 0.8, "histogram": 0.4},106 "moving_averages": {"sma_20": 183.6, "sma_50": 185.2, "sma_200": 179.1},107 "signals": ["RSI neutral", "MACD bullish crossover", "Short-term trend above medium-term: bullish bias"]108 },109 "sentiment": {110 "overall_sentiment": "positive",111 "articles_analyzed": 23,112 "key_themes": ["earnings beat", "product launch"],113 "sentiment_score": 0.65114 },115 "summary": {116 "overall_stance": "bullish",117 "confidence": 0.715,118 "key_signals": ["Fundamental: hold (P/E 28.0)", "Sentiment: positive (+0.650)"],119 "risk_note": "Simulated outputs — not financial advice. Verify with live market data before acting."120 }121}122```123124## Output125126The response combines synthetic fundamental, technical, sentiment, and summary dictionaries. The127`risk_note` states that outputs are simulated; preserve it in every user-facing rendering.128129## Error Handling130131- Reject empty tickers, unsupported periods/indicators, and non-positive news windows.132- Never infer that an upstream API, filing, exchange, or news source was contacted.133- Refuse to frame the generated buy/hold/sell value as financial advice.134135## Resources136137Wraps [virattt/ai-hedge-fund](https://github.com/virattt/ai-hedge-fund) and138[ZhuLinsen/daily_stock_analysis](https://github.com/ZhuLinsen/daily_stock_analysis).139140The local specialist only mirrors pipeline patterns. See141[the runtime contract](references/runtime-contract.md).