A multi-agent system built with Strands for automated trading strategy development and backtesting using historical market data.
This project is for educational and research purposes only. The backtesting results, trading strategies, and any analysis provided by this system do not constitute financial advice, investment recommendations, or an offer to buy or sell any securities. Past performance does not guarantee future results. Trading and investing involve substantial risk of loss. Always consult with a qualified financial advisor before making any investment decisions.
The system provides an intuitive web interface for submitting trading ideas and viewing results:
Agent Input:
Backtest Results:
Strategy Review & Recommendations:
This system uses 4 specialized agents orchestrated through Strands to transform trading ideas into backtested strategies:
- Strategy Generator Agent - Converts natural language trading ideas into executable Backtrader strategies
- Market Data Tool - Fetches historical market data from S3 Table
- Backtest Tool - Executes backtests using Backtrader framework
- Results Summary Agent - Analyzes performance and generates comprehensive reports
This project leverages Strands Agent SDK and Amazon Bedrock AgentCore to build a multi-agent backtesting system:
-
Strands Agent SDK: A Python framework for building agentic applications with tool-calling capabilities. Strands provides decorators like
@toolto easily expose Python functions as agent tools, enabling seamless integration between agents and external services. -
AgentCore Runtime: A managed service for deploying and orchestrating AI agents at scale. AgentCore handles agent runtime management, memory persistence, and secure communication between agents through its Gateway service with Cognito authentication.
-
AgentCore Gateway with MCP: The Market Data Gateway implements the Model Context Protocol (MCP) to provide standardized access to external data sources. It uses Cognito for authentication and connects to Lambda functions that query S3 Tables for historical market data.
For complete deployment instructions, please refer to DEPLOYMENT_GUIDE.md.
The deployment guide covers:
- Prerequisites and required tools
- Market Data MCP tool setup with Cognito authentication
- Step-by-step backend agent deployment (Strategy Generator, Result Summarizer, Quant Agent)
- Frontend deployment instructions
- Coordinates all agents using Strands framework
- Handles timing and data flow between agents
- Provides unified interface for user interactions
- Deploy to Agentcore Runtime
- Converts natural language to Backtrader strategy code
- Generates executable Python code with proper indicators
- Template-based approach for consistent strategy structure
- Deploy to Agentcore Runtime
- Connects to S3 Table for historical data
- Deploy to Agentcore Gateway
- Executes strategies using Backtrader framework
- Configurable parameters (initial cash, commission, etc.)
- Returns comprehensive performance metrics
- Analyzes backtest performance metrics
- Provides performance assessment and recommendations
- Deploy to Agentcore Runtime



