Each node in the QuantAgent pipeline is a self-contained function that reads fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Y-Research-SBU/QuantAgent/llms.txt
Use this file to discover all available pages before exploring further.
IndicatorAgentState, performs its analysis, and returns a partial state update. LangGraph merges these updates automatically before invoking the next node.
Indicator Agent
The Indicator Agent is the first node in the graph. It receives raw OHLCV data and usesgraph_llm bound to five TA-Lib tools to compute technical indicators.
Tools available:
| Tool | Computes |
|---|---|
compute_macd | MACD line, signal line, histogram |
compute_rsi | RSI values |
compute_roc | Rate of Change values |
compute_stoch | Stochastic %K and %D |
compute_willr | Williams %R values |
Initial tool call
The LLM is prompted with the OHLCV data and asked to call whichever indicator tools it needs. All tool results are appended to the message history as
ToolMessage objects.Multi-call iteration (up to 5 rounds)
After tool results are available, the LLM is re-invoked. If it issues more tool calls (common with Claude, which may batch calls across turns), those are executed and appended. This loop repeats until the LLM returns a plain text response or the 5-iteration cap is hit.
messages, indicator_report
Pattern Agent
The Pattern Agent generates a candlestick chart from the last 40 candles and passes it to a vision LLM for pattern identification. Tool available:generate_kline_image — renders OHLCV data as a candlestick chart and returns a base64-encoded PNG.
Check for precomputed image
If
pattern_image is already present in state (e.g., pre-generated before graph invocation), the agent skips tool generation and proceeds directly to vision analysis.Generate chart (if needed)
agent_llm is bound to generate_kline_image and prompted to call it. The tool returns pattern_image (base64 PNG) and pattern_image_description. If the tool returns no image, it is retried up to 3 times with a 4-second wait between attempts.- Inverse Head and Shoulders, Double Bottom, Rounded Bottom, Hidden Base
- Falling Wedge, Rising Wedge, Ascending Triangle, Descending Triangle
- Bullish Flag, Bearish Flag, Rectangle, Island Reversal
- V-shaped Reversal, Rounded Top, Expanding Triangle, Symmetrical Triangle
messages, pattern_report
Trend Agent
The Trend Agent generates a trendline-annotated candlestick chart from the last 50 candles and uses a vision LLM to predict short-term directional bias. Tool available:generate_trend_image — runs the trendline fitting algorithm (see Technical analysis) and overlays support and resistance lines on the chart.
The chart encodes four trendlines:
- Blue line — close-based support (from
fit_trendlines_single) - Red line — close-based resistance (from
fit_trendlines_single) - White lines — high/low-based support and resistance channels (from
fit_trendlines_high_low)
Generate trendline chart (if needed)
agent_llm is bound to generate_trend_image and prompted to call it. The tool returns the base64-encoded chart.messages, trend_report, trend_image, trend_image_filename, trend_image_description
Decision Agent
The Decision Agent is the final node. It reads all three upstream reports and synthesizes them into a single structured trade decision usinggraph_llm (no tools, no vision).
The agent’s prompt enforces strict decision logic:
- Only act on confirmed signals — avoid emerging, speculative, or conflicting signals
- Prioritize decisions where all three reports align in the same direction
- Weight recent strong momentum (MACD crossover, RSI breakout) over weak oscillator hints
- HOLD is explicitly prohibited — the output must be LONG or SHORT
- Risk-reward ratio must be between 1.2 and 1.8
final_trade_decision:
final_trade_decision, messages, decision_prompt
State fields reference
The completeIndicatorAgentState fields that flow through the pipeline: