QuantAgent uses four specialized agent nodes connected in a fixed sequence:Documentation 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.
create_indicator_agent(llm, toolkit)
create_indicator_agent(llm, toolkit)
| Parameter | Type | Description |
|---|---|---|
llm | BaseChatModel | The LLM that calls indicator tools and synthesizes the report. Bound with tool-calling capability. |
toolkit | TechnicalTools | Toolkit instance exposing the indicator methods as LangChain tools. |
compute_macd— MACD line, signal, and histogramcompute_rsi— Relative Strength Indexcompute_roc— Rate of Changecompute_stoch— Stochastic Oscillator %K and %Dcompute_willr— Williams %R
indicator_report.If the LLM returns empty content (common with multi-step Claude responses), the agent scans backwards through the message history for the most recent non-empty text content.State output| Key | Type | Description |
|---|---|---|
indicator_report | str | Narrative summary of all computed indicators. |
messages | list | Updated message list including all tool calls and responses. |
create_pattern_agent(agent_llm, graph_llm, toolkit)
create_pattern_agent(agent_llm, graph_llm, toolkit)
| Parameter | Type | Description |
|---|---|---|
agent_llm | BaseChatModel | Used for the tool-calling step to invoke generate_kline_image. |
graph_llm | BaseChatModel | Vision-capable LLM used to analyze the generated chart image. |
toolkit | TechnicalTools | Toolkit instance exposing generate_kline_image. |
generate_kline_image— Generates a candlestick chart of the most recent 40 candles and returns a base64-encoded PNG.
Check for precomputed image
If
pattern_image is already present in the state, the tool-calling step is skipped.| Key | Type | Description |
|---|---|---|
pattern_report | str | Narrative identifying the detected candlestick pattern(s) and reasoning. |
messages | list | Updated message list. |
create_trend_agent(agent_llm, graph_llm, toolkit)
create_trend_agent(agent_llm, graph_llm, toolkit)
| Parameter | Type | Description |
|---|---|---|
agent_llm | BaseChatModel | Used for the tool-calling step to invoke generate_trend_image. |
graph_llm | BaseChatModel | Vision-capable LLM used to analyze the annotated chart. |
toolkit | TechnicalTools | Toolkit instance exposing generate_trend_image. |
generate_trend_image— Generates a candlestick chart overlaid with fitted support (blue) and resistance (red) trendlines derived from recent closing prices, highs, and lows.
Check for precomputed image
If
trend_image is already present in the state, the tool-calling step is skipped.Generate annotated chart
agent_llm is prompted to call generate_trend_image with the current kline_data.| Key | Type | Description |
|---|---|---|
trend_report | str | Narrative describing trendline interaction and directional prediction. |
trend_image | str | Base64-encoded PNG of the annotated chart. |
trend_image_filename | str | Local filename where the chart was saved ("trend_graph.png"). |
trend_image_description | str | Short description of the chart. |
messages | list | Updated message list. |
create_final_trade_decider(llm)
create_final_trade_decider(llm)
LONG or SHORT trade directive.Parameters| Parameter | Type | Description |
|---|---|---|
llm | BaseChatModel | The LLM used to produce the final decision. Does not use tools. |
- Prioritize decisions where all three reports (Indicator, Pattern, Trend) align in the same direction.
- Give higher weight to strong, confirmed signals — MACD crossovers, RSI divergence, breakout confirmation.
- Default to the dominant trendline slope when reports are mixed (e.g., SHORT in a descending channel).
- Always output either
LONGorSHORT.HOLDis prohibited in the HFT context. - Suggest a risk-reward ratio between 1.2 and 1.8.
final_trade_decision field contains a JSON string with the following structure:Human-readable description of the prediction window (e.g.,
"Predicting next 3 candlesticks (45 minutes)").Trade direction:
"LONG" or "SHORT".Concise reasoning grounded in the three upstream reports.
Float between 1.2 and 1.8 as a string (e.g.,
"1.5").| Key | Type | Description |
|---|---|---|
final_trade_decision | str | JSON string containing the trade decision (see format above). |
decision_prompt | str | The full prompt string sent to the LLM, useful for debugging. |
messages | list | List containing the LLM response message. |
Graph execution order
The agents are chained in this fixed sequence insideSetGraph.set_graph():
Each agent reads from the shared IndicatorAgentState and writes its outputs back into it. The Decision Maker has access to all three reports when it runs.