bstraehle commited on
Commit
d6269a1
1 Parent(s): 93e5d93

Update tasks.py

Browse files
Files changed (1) hide show
  1. tasks.py +62 -56
tasks.py CHANGED
@@ -1,60 +1,66 @@
1
- from crewai import Agent, Task, Crew
2
 
3
- # Task for Data Analyst Agent: Analyze Market Data
4
- data_analysis_task = Task(
5
- description=(
6
- "Continuously monitor and analyze market data for "
7
- "the selected stock ({stock_selection}). "
8
- "Use statistical modeling and machine learning to "
9
- "identify trends and predict market movements."
10
- ),
11
- expected_output=(
12
- "Insights and alerts about significant market "
13
- "opportunities or threats for {stock_selection}."
14
- ),
15
- agent=data_analyst_agent,
16
- )
17
 
18
- # Task for Trading Strategy Agent: Develop Trading Strategies
19
- strategy_development_task = Task(
20
- description=(
21
- "Develop and refine trading strategies based on "
22
- "the insights from the Data Analyst and "
23
- "user-defined risk tolerance ({risk_tolerance}). "
24
- "Consider trading preferences ({trading_strategy_preference})."
25
- ),
26
- expected_output=(
27
- "A set of potential trading strategies for {stock_selection} "
28
- "that align with the user's risk tolerance."
29
- ),
30
- agent=trading_strategy_agent,
31
- )
 
32
 
33
- # Task for Trade Advisor Agent: Plan Trade Execution
34
- execution_planning_task = Task(
35
- description=(
36
- "Analyze approved trading strategies to determine the "
37
- "best execution methods for {stock_selection}, "
38
- "considering current market conditions and optimal pricing."
39
- ),
40
- expected_output=(
41
- "Detailed execution plans suggesting how and when to "
42
- "execute trades for {stock_selection}."
43
- ),
44
- agent=execution_agent,
45
- )
 
 
46
 
47
- # Task for Risk Advisor Agent: Assess Trading Risks
48
- risk_assessment_task = Task(
49
- description=(
50
- "Evaluate the risks associated with the proposed trading "
51
- "strategies and execution plans for {stock_selection}. "
52
- "Provide a detailed analysis of potential risks "
53
- "and suggest mitigation strategies."
54
- ),
55
- expected_output=(
56
- "A comprehensive risk analysis report detailing potential "
57
- "risks and mitigation recommendations for {stock_selection}."
58
- ),
59
- agent=risk_management_agent,
60
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from crewai import Task
2
 
3
+ from agents import get_data_analyst_agent, get_trading_strategy_agent, get_execution_agent, get_risk_management_agent
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
+ def get_data_analysis_task():
6
+ # Task for Data Analyst Agent: Analyze Market Data
7
+ data_analysis_task = Task(
8
+ description=(
9
+ "Continuously monitor and analyze market data for "
10
+ "the selected stock ({stock_selection}). "
11
+ "Use statistical modeling and machine learning to "
12
+ "identify trends and predict market movements."
13
+ ),
14
+ expected_output=(
15
+ "Insights and alerts about significant market "
16
+ "opportunities or threats for {stock_selection}."
17
+ ),
18
+ agent=get_data_analyst_agent(),
19
+ )
20
 
21
+ def get_strategy_development_task():
22
+ # Task for Trading Strategy Agent: Develop Trading Strategies
23
+ strategy_development_task = Task(
24
+ description=(
25
+ "Develop and refine trading strategies based on "
26
+ "the insights from the Data Analyst and "
27
+ "user-defined risk tolerance ({risk_tolerance}). "
28
+ "Consider trading preferences ({trading_strategy_preference})."
29
+ ),
30
+ expected_output=(
31
+ "A set of potential trading strategies for {stock_selection} "
32
+ "that align with the user's risk tolerance."
33
+ ),
34
+ agent=get_trading_strategy_agent(),
35
+ )
36
 
37
+ def get_execution_planning_task():
38
+ # Task for Trade Advisor Agent: Plan Trade Execution
39
+ execution_planning_task = Task(
40
+ description=(
41
+ "Analyze approved trading strategies to determine the "
42
+ "best execution methods for {stock_selection}, "
43
+ "considering current market conditions and optimal pricing."
44
+ ),
45
+ expected_output=(
46
+ "Detailed execution plans suggesting how and when to "
47
+ "execute trades for {stock_selection}."
48
+ ),
49
+ agent=get_execution_agent(),
50
+ )
51
+
52
+ def get_risk_assessment_task():
53
+ # Task for Risk Advisor Agent: Assess Trading Risks
54
+ return = Task(
55
+ description=(
56
+ "Evaluate the risks associated with the proposed trading "
57
+ "strategies and execution plans for {stock_selection}. "
58
+ "Provide a detailed analysis of potential risks "
59
+ "and suggest mitigation strategies."
60
+ ),
61
+ expected_output=(
62
+ "A comprehensive risk analysis report detailing potential "
63
+ "risks and mitigation recommendations for {stock_selection}."
64
+ ),
65
+ agent=get_risk_management_agent(),
66
+ )