forked from Y-Research-SBU/QuantAgent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent_state.py
More file actions
67 lines (59 loc) · 2.65 KB
/
agent_state.py
File metadata and controls
67 lines (59 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
from typing import Annotated, List, TypedDict
from langchain_core.messages import BaseMessage
class IndicatorAgentState(TypedDict):
"""State type for the Indicator Agent including messages, input data, and analysis result."""
kline_data: Annotated[
dict, "OHLCV dictionary used for computing technical indicators"
]
time_frame: Annotated[str, "time period for k line data provided"]
stock_name: Annotated[dict, "stock name for prompt"]
# Indicator Agent Tools output values (explicitly added per indicator)
rsi: Annotated[List[float], "Relative Strength Index values"]
macd: Annotated[List[float], "MACD line values"]
macd_signal: Annotated[List[float], "MACD signal line values"]
macd_hist: Annotated[List[float], "MACD histogram values"]
stoch_k: Annotated[List[float], "Stochastic Oscillator %K values"]
stoch_d: Annotated[List[float], "Stochastic Oscillator %D values"]
roc: Annotated[List[float], "Rate of Change values"]
willr: Annotated[List[float], "Williams %R values"]
indicator_report: Annotated[
str, "Final indicator agent summary report to be used by downstream agents"
]
# Pattern Agent
pattern_image: Annotated[
str, "Base64-encoded K-line chart for pattern recognition agent use"
]
pattern_image_filename: Annotated[
str, "Local file path to saved K-line chart image"
]
pattern_image_description: Annotated[
str, "Brief description of the generated K-line image"
]
pattern_report: Annotated[
str, "Final pattern agent summary report to be used by downstream agents"
]
# Trend Agent
trend_image: Annotated[
str,
"Base64-encoded trend-annotated candlestick (K-line) chart for trend recognition agent use",
]
trend_image_filename: Annotated[
str, "Local file path to saved trendline-enhanced K-line chart image"
]
trend_image_description: Annotated[
str,
"Brief description of the chart, including presence of support/resistance lines and visual characteristics",
]
trend_report: Annotated[
str,
"Final trend analysis summary, describing structure, directional bias, and technical observations for downstream agents",
]
# Final analysis and messaging context
analysis_results: Annotated[str, "Computed result of the analysis or decision"]
messages: Annotated[
List[BaseMessage], "List of chat messages used in LLM prompt construction"
]
decision_prompt: Annotated[str, "decision prompt for reflection"]
final_trade_decision: Annotated[
str, "Final BUY or SELL decision made after analyzing indicators"
]