Skip to content

Repository files navigation

AlphaStream 🚀

Autonomous Multi-Agent Day Trading System

An intelligent, multi-agent trading system that leverages AI to autonomously discover and execute day trading opportunities in the Indian stock market.

Python License Status

⚠️ WARNING: This system trades autonomously with real money. Use with extreme caution and proper risk management.

🎯 Features

  • Multi-Agent Architecture: Specialized AI agents for market intelligence, opportunity discovery, and trade validation
  • Autonomous Trading: Fully automated discovery and execution of trading opportunities
  • Real-time Market Analysis: Live market data processing and technical analysis
  • Risk Management: Built-in validation and risk assessment mechanisms
  • Indian Market Focus: Optimized for NSE/BSE trading with INR-based strategies

🏗️ Architecture

The system consists of three core agents:

  1. Market Intelligence Agent: Generates daily market briefings and identifies priority sectors/stocks
  2. Organic Discovery Agent: Discovers trading opportunities using technical and fundamental analysis
  3. Validation Agent: Validates opportunities and manages risk before execution

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Valid trading account API credentials
  • Market data feed access

Installation

  1. Clone the repository:
git clone https://github.com/Rudr4Khunt1/AlphaStream.git
cd AlphaStream
  1. Install dependencies:
pip install -r requirements.txt
  1. Configure environment variables:
cp .env.example .env
# Edit .env with your API credentials

Configuration

Create a .env file with the following variables:

# Trading API Configuration
BROKER_API_KEY=your_api_key
BROKER_SECRET=your_secret
BROKER_USER_ID=your_user_id

# Market Data
MARKET_DATA_API_KEY=your_market_data_key

# Risk Management
MAX_DAILY_LOSS=5000
MAX_POSITION_SIZE=10000
MAX_OPEN_POSITIONS=5

Running the System

python main.py

📊 System Workflow

  1. Market Intelligence: Generate daily briefing with sector priorities and key levels
  2. Opportunity Discovery: Scan for trading setups based on technical and fundamental factors
  3. Validation: Risk assessment and trade parameter optimization
  4. Execution: Automated order placement and position management
  5. Monitoring: Real-time trade tracking and risk management

🛡️ Risk Management

  • Position Sizing: Automated position sizing based on volatility and account size
  • Stop Losses: Mandatory stop-loss orders on all positions
  • Daily Limits: Maximum daily loss and position limits
  • Validation Layer: Multiple validation checks before trade execution

📁 Project Structure

AlphaStream/
├── main.py                 # Entry point
├── core_workflow.py        # Main workflow orchestration
├── trading_agents/         # AI trading agents
│   ├── market_intelligence_agent.py
│   ├── organic_discovery_agent.py
│   └── validation_agent.py
├── models/                 # Data models
│   ├── discovery.py
│   ├── market_intelligence.py
│   └── validation.py
├── trading_tools/          # Trading utilities
├── tools/                  # External tools and APIs
└── utils/                  # Helper utilities

⚙️ Configuration

Trading Parameters

Modify settings.py to adjust:

  • Risk tolerance levels
  • Trading timeframes
  • Market segments
  • Position sizing rules

Agent Configuration

Each agent can be configured independently:

  • Market Intelligence: Sector focus, analysis depth
  • Discovery: Screening criteria, technical indicators
  • Validation: Risk thresholds, validation rules

📈 Supported Markets

  • NSE (National Stock Exchange)
  • BSE (Bombay Stock Exchange)
  • Equity Cash Segment
  • F&O (Futures & Options) - Coming Soon

🔧 Development

Running Tests

python -m pytest tests/

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

⚠️ Disclaimer

This software is for educational and research purposes. Trading involves substantial risk of loss. The authors are not responsible for any financial losses incurred through the use of this system. Always:

  • Start with paper trading
  • Use proper risk management
  • Understand the code before running
  • Monitor the system closely
  • Never risk more than you can afford to lose

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👨‍💻 Author

Rudra Khunti

🤝 Support

If you find this project helpful, please consider:

  • ⭐ Starring the repository
  • 🐛 Reporting bugs
  • 💡 Suggesting new features
  • 🔄 Contributing code

Remember: Past performance does not guarantee future results. Trade responsibly!

About

Streaming market-data and signal generation pipeline for equities research.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages