| name | quick-analyzer-agent |
| description | Fast ticker analysis for /analysis page. Provides quick BUY/SELL/HOLD recommendations based on technical indicators, recent news, and basic fundamentals within seconds. Optimized for speed over depth. |
| license | Proprietary |
| compatibility | Requires market data (OHLCV), news_articles table, basic financial data |
| metadata | {"author":"ai-trading-system","version":"1.0","category":"analysis","agent_role":"quick_analyst"} |
Quick Analyzer Agent - ๋น ๋ฅธ ํฐ์ปค ๋ถ์
Role
/analysis ํ์ด์ง์์ ์ฌ์ฉ์๊ฐ ํฐ์ปค๋ฅผ ์
๋ ฅํ๋ฉด 5์ด ์ด๋ด์ BUY/SELL/HOLD ์ถ์ฒ์ ์ ๊ณตํฉ๋๋ค. ์๋๋ฅผ ์ํด ํต์ฌ ์งํ๋ง ๋ถ์ํฉ๋๋ค.
Core Capabilities
1. Fast Technical Analysis
Price Action
- Moving Averages: MA20, MA50 ๊ต์ฐจ ํ์ธ
- Trend: ์์น/ํ๋ฝ/ํก๋ณด ํ๋จ
- Support/Resistance: ์ฃผ์ ๊ฐ๊ฒฉ๋
Momentum Indicators
- RSI (14์ผ): ๊ณผ๋งค์(>70), ๊ณผ๋งค๋(<30)
- MACD: ๊ณจ๋ ํฌ๋ก์ค/๋ฐ๋ํฌ๋ก์ค
- Volume: ๊ฑฐ๋๋ ์ฆ๊ฐ/๊ฐ์ ํจํด
2. Recent News Scan (Last 7 Days)
news_articles = get_recent_news(ticker, days=7)
avg_sentiment = sum(a.sentiment_score for a in news_articles) / len(news_articles)
positive_ratio = len([a for a in news_articles if a.sentiment_score > 0.3]) / len(news_articles)
News Signals
- Very Positive (avg > 0.6): ๊ฐํ ํธ์ฌ
- Positive (avg > 0.3): ๊ธ์ ์
- Neutral (avg -0.3 to 0.3): ์ค๋ฆฝ
- Negative (avg < -0.3): ๋ถ์ ์
- Very Negative (avg < -0.6): ๊ฐํ ์
์ฌ
3. Basic Fundamental Check
Valuation
- P/E Ratio: ํ์ฌ vs ์
์ข
ํ๊ท
- P/B Ratio: ์์ฐ ๊ฐ์น ๋๋น
- Quick Check: ๊ณผ๋/์ ์ /์ ํ๊ฐ
Recent Earnings
- Beat/Miss: ์ต๊ทผ ๋ถ๊ธฐ ์ค์
- Surprise %: ์ปจ์ผ์์ค ๋๋น
Decision Framework
Step 1: Technical Analysis
score_technical = 0
IF MA20 > MA50:
score_technical += 2
IF RSI in [30, 70]:
score_technical += 1
ELIF RSI < 30:
score_technical += 3 # Oversold
ELIF RSI > 70:
score_technical -= 3 # Overbought
IF Volume > avg_volume * 1.5:
score_technical += 1
Step 2: News Analysis
score_news = 0
IF avg_sentiment > 0.6:
score_news += 3
ELIF avg_sentiment > 0.3:
score_news += 2
ELIF avg_sentiment < -0.3:
score_news -= 2
ELIF avg_sentiment < -0.6:
score_news -= 3
Step 3: Fundamental Check
score_fundamental = 0
IF P/E < industry_avg * 0.8:
score_fundamental += 2 # Undervalued
ELIF P/E > industry_avg * 1.2:
score_fundamental -= 2 # Overvalued
IF recent_earnings == 'BEAT':
score_fundamental += 2
Step 4: Final Decision
total_score = score_technical + score_news + score_fundamental
IF total_score >= 5:
action = "BUY"
confidence = min(0.9, 0.6 + total_score * 0.05)
ELIF total_score <= -5:
action = "SELL"
confidence = min(0.9, 0.6 + abs(total_score) * 0.05)
ELSE:
action = "HOLD"
confidence = 0.5 + abs(total_score) * 0.03
Output Format
{
"ticker": "AAPL",
"action": "BUY",
"confidence": 0.75,
"reasoning": "๊ธฐ์ ์ ๊ณจ๋ ํฌ๋ก์ค (MA20 > MA50), ์ต๊ทผ ๋ด์ค ๊ธ์ ์ (sentiment +0.6), ์
์ข
๋๋น ์ ํ๊ฐ (P/E 25 vs 28)",
"analysis_time_ms": 3200,
"price_info": {
"current": 197.50,
"change_1d_pct": 0.024,
"change_1w_pct": 0.058,
"ma20": 195.00,
"ma50": 192.00,
"ma200": 185.00,
"support_level": 190.00,
"resistance_level": 205.00
},
Examples
Example 1: Strong BUY Signal
Input:
- Ticker: NVDA
- Price: $520
- MA20: $510, MA50: $490 (๊ณจ๋ ํฌ๋ก์ค)
- RSI: 55
- News: 8 positive, 1 negative (avg +0.7)
- P/E: 45 (industry 52) - ์ ํ๊ฐ
- Recent Earnings: Beat 15%
Calculation:
- Technical Score: +6 (MA๊ณจ๋ +2, RSI์ค๋ฆฝ+1, Volume+1, Trend+2)
- News Score: +3 (๋งค์ฐ ๊ธ์ )
- Fundamental Score: +4 (์ ํ๊ฐ+2, Beat+2)
- Total: 13
Output:
- Action: BUY
- Confidence: 0.85
- Reasoning: "๊ฐํ ๊ธฐ์ ์ ์ ํธ + ๊ธ์ ์ ๋ด์ค + ์ ํ๊ฐ"
Example 2: SELL Signal
Input:
- Ticker: XYZ
- MA20 < MA50 (๋ฐ๋ํฌ๋ก์ค)
- RSI: 78 (๊ณผ๋งค์)
- News: 2 positive, 7 negative (avg -0.5)
- P/E: 85 (industry 40) - ๊ณ ํ๊ฐ
Calculation:
- Technical Score: -4 (๋ฐ๋ํฌ๋ก์ค-2, ๊ณผ๋งค์-3, ์ ์๋ณผ๋ฅจ+1)
- News Score: -2 (๋ถ์ )
- Fundamental Score: -2 (๊ณ ํ๊ฐ)
- Total: -8
Output:
- Action: SELL
- Confidence: 0.80
- Reasoning: "๊ธฐ์ ์ ์ฝ์ธ + ๋ถ์ ๋ด์ค + ๊ณ ํ๊ฐ"
Example 3: HOLD Signal
Input:
- Ticker: MSFT
- MA20 โ MA50 (ํก๋ณด)
- RSI: 52
- News: 4 positive, 3 negative (avg +0.1)
- P/E: 30 (industry 30) - ์ ์
Calculation:
- Technical Score: +1
- News Score: 0
- Fundamental Score: 0
- Total: 1
Output:
- Action: HOLD
- Confidence: 0.55
- Reasoning: "๋ช
ํํ ๋ฐฉํฅ์ฑ ๋ถ์ฌ, ๊ด๋ง ์ถ์ฒ"
Guidelines
Do's โ
- Speed First: 5์ด ์ด๋ด ์๋ต (๋ณต์กํ ๋ถ์ ์ง์)
- ํต์ฌ ์งํ๋ง: RSI, MA, P/E, News Sentiment
- ๋ช
ํํ ์ ํธ: ๊ฐํ BUY/SELL๋ง, ์ ๋งคํ๋ฉด HOLD
- Risk Factors ํฌํจ: ์ฃผ์ ๋ฆฌ์คํฌ 1-2๊ฐ ์ธ๊ธ
Don'ts โ
- ๊ณผ๋ํ ๋ถ์ ๊ธ์ง (Deep Reasoning Agent ์ญํ ์๋)
- ๋ณต์กํ ๋ชจ๋ธ ์ฌ์ฉ ๊ธ์ง (์๋ ์ ํ)
- ๋ชจํธํ ํํ ๊ธ์ง ("maybe", "possibly")
- 100% ํ์ ๊ธ์ง (confidence ์ต๋ 0.90)
Integration
API Endpoint
from fastapi import APIRouter, HTTPException
from backend.ai.skills.base_agent import AnalysisSkillAgent
router = APIRouter()
@router.get("/api/analysis/quick/{ticker}")
async def quick_analyze_ticker(ticker: str):
"""Quick analysis for a ticker"""
try:
agent = QuickAnalyzerAgent()
result = await agent.execute({
'ticker': ticker,
'task_description': f'Provide quick analysis for {ticker}'
})
return result
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
Data Sources
from backend.data.yahoo_client import YahooClient
from backend.database.models import NewsArticle
from sqlalchemy.orm import Session
async def gather_quick_data(ticker: str, db: Session) -> Dict:
"""Gather data for quick analysis"""
yahoo = YahooClient()
price_data = yahoo.get_current_price(ticker)
tech_data = yahoo.get_technical_indicators(ticker)
news = db.query(NewsArticle).filter(
NewsArticle.ticker == ticker,
NewsArticle.created_at >= datetime.now() - timedelta(days=7)
).all()
fundamentals = yahoo.get_key_stats(ticker)
return {
'price': price_data,
'technical': tech_data,
'news': news,
'fundamentals': fundamentals
}
Performance Metrics
- Response Time: ๋ชฉํ < 5์ด (ํ๊ท 3์ด)
- Accuracy: > 60% (๋น ๋ฅธ ๋ถ์์ด๋ฏ๋ก Deep Reasoning๋ณด๋ค ๋ฎ์)
- User Satisfaction: > 4/5 (์๋ ์ค์)
- Cache Hit Rate: > 70% (๋์ผ ticker 5๋ถ ๋ด ์ฌ์กฐํ ์)
Caching Strategy
from functools import lru_cache
from time import time
@lru_cache(maxsize=100)
def cached_quick_analysis(ticker: str, timestamp: int) -> Dict:
"""Cache analysis for 5 minutes"""
return perform_quick_analysis(ticker)
current_5min_slot = int(time() // 300)
result = cached_quick_analysis(ticker, current_5min_slot)
Comparison with Other Agents
| Agent | Speed | Depth | Use Case |
|---|
| Quick Analyzer | โญโญโญ 5s | โญ Basic | ๋น ๋ฅธ ํ์ธ |
| Deep Reasoning | โญ 30s | โญโญโญ Deep | ์ค์ํ ๊ฒฐ์ |
| War Room | โญโญ 15s | โญโญ Medium | ํฉ์ ๊ธฐ๋ฐ |
Version History
- v1.0 (2025-12-21): Initial release with 5-second target response time