from crewai import Task from agents import get_data_analyst_agent, get_trading_strategy_agent, get_execution_agent, get_risk_management_agent def get_data_analysis_task(): return Task( description=( "Continuously monitor and analyze market data for " "the selected stock ({stock_selection}). " "Use statistical modeling and machine learning to " "identify trends and predict market movements." ), expected_output=( "Insights and alerts about significant market " "opportunities or threats for {stock_selection}." ), agent=get_data_analyst_agent(), ) def get_trading_strategy_task(): return Task( description=( "Develop and refine trading strategies based on " "the insights from the Data Analyst and " "user-defined risk tolerance ({risk_tolerance}). " "Consider trading preferences ({trading_strategy_preference})." ), expected_output=( "A set of potential trading strategies for {stock_selection} " "that align with the user's risk tolerance." ), agent=get_trading_strategy_agent(), ) def get_execution_task(): return Task( description=( "Analyze approved trading strategies to determine the " "best execution methods for {stock_selection}, " "considering current market conditions and optimal pricing." ), expected_output=( "Detailed execution plans suggesting how and when to " "execute trades for {stock_selection}." ), agent=get_execution_agent(), ) def get_risk_management_task(): return Task( description=( "Evaluate the risks associated with the proposed trading " "strategies and execution plans for {stock_selection}. " "Provide a detailed analysis of potential risks " "and suggest mitigation strategies." ), expected_output=( "A comprehensive risk analysis report detailing potential " "risks and mitigation recommendations for {stock_selection}." ), agent=get_risk_management_agent(), )