Technical Analysis Agent
The Technical Analysis Agent serves as the quantitative core of the trading system. It is responsible for interpreting price action, calculating momentum indicators, and identifying critical market structures like support and resistance levels. Unlike a simple script, this agent uses Large Language Model (LLM) reasoning to synthesize multiple technical signals into a cohesive recommendation.
Overview
The Technical Analysis Agent processes raw market data to determine the current market phase and momentum. It operates within the TradingOrchestrator and provides structured data that the Risk and Sentiment agents use to contextualize their own findings.
Key Capabilities
- Momentum Analysis: Evaluates RSI (Relative Strength Index) and MACD (Moving Average Convergence Divergence) to identify overbought or oversold conditions.
- Trend Detection: Categorizes the market into
BULLISH,BEARISH, orNEUTRALtrends. - Price Level Identification: Locates key horizontal support and resistance levels.
- Contextual Reasoning: Uses RAG (Retrieval-Augmented Generation) to apply established technical analysis principles to current market conditions.
Structured Output Schema
The agent provides data in a strictly typed format using Pydantic. This ensures that the trading dashboard and other agents can reliably parse its findings.
TechnicalAnalysis Object
The output extends the base AgentRecommendation with a specialized TechnicalMetadata object.
| Field | Type | Description |
| :--- | :--- | :--- |
| recommendation | Literal["BUY", "SELL", "HOLD"] | The primary trading action suggested. |
| confidence | int (0-100) | The agent's certainty in its analysis. |
| reasoning | str | A detailed text explanation of the technical setup. |
| metadata | TechnicalMetadata | A nested object containing specific indicator values. |
TechnicalMetadata Fields
- rsi_signal: Current RSI state (e.g.,
OVERSOLD,NEUTRAL,OVERBOUGHT). - macd_signal: MACD crossover status (e.g.,
BULLISH,BEARISH). - trend_direction: The overall market trajectory (e.g.,
UPTREND,DOWNTREND). - support_level / resistance_level: The specific price points identified as floor and ceiling.
Knowledge Base Integration (RAG)
The Technical Analysis Agent is augmented by a specialized vector database. The KnowledgeIndexer processes documents within the knowledge/technical_analysis/ directory, allowing the agent to reference:
- Standardized trading strategies.
- Historical chart patterns.
- Specific technical analysis frameworks (e.g., Wyckoff theory, Elliott Wave).
When a query is processed, the agent retrieves relevant snippets from these documents to ensure its reasoning aligns with proven technical methodologies.
Example Usage & Output
When invoked by the orchestrator, the agent processes the market data and returns a structured response. Below is an example of the data generated by the agent:
{
"recommendation": "BUY",
"confidence": 85,
"reasoning": "Bitcoin has successfully tested the $42,000 support level. RSI is currently at 32, indicating near-oversold conditions, while a bullish MACD crossover is forming on the 4-hour timeframe.",
"key_factors": [
"RSI Oversold Bounce",
"Support at 42k held",
"MACD Bullish Cross"
],
"metadata": {
"rsi_signal": "OVERSOLD",
"macd_signal": "BULLISH",
"trend_direction": "UPTREND",
"support_level": 42000.0,
"resistance_level": 48500.0
}
}
Integration with the Dashboard
The results from the Technical Analysis Agent are streamed in real-time to the React-based frontend. Users can view the reasoning and key_factors directly in the Trade History table, providing transparency into why a specific technical decision was made during backtesting or live sessions.