A Python-based automated trading platform using Alpaca Markets API for executing algorithmic trading strategies with real-time monitoring and risk management.
- Automated trade execution via Alpaca API
- Signal-based trading strategy implementation
- Real-time order and position monitoring
- Risk management controls
- Account verification and status monitoring
- Configurable trading parameters
alpaca_trading/
βββ pyproject.toml # Poetry project configuration
βββ README.md
βββ .env # Environment variables (API keys)
βββ src/
β βββ config.py # Configuration management
β βββ models/
β β βββ signal.py # Signal dataclass/model
β βββ services/
β β βββ alpaca_service.py # Alpaca API wrapper
β β βββ signal_processor.py # Signal processing logic
β β βββ order_monitor.py # Order monitoring service
β βββ utils/
β β βββ logger.py # Logging configuration
β β βββ validators.py # Input validation
β βββ main.py # Entry point
βββ tests/
βββ test_services/
βββ test_alpaca.py
- Clone the repository
- Install dependencies with Poetry:
poetry install- Create
.envfile with your Alpaca credentials:
API_KEY=your_api_key
SECRET_KEY=your_secret_key
- Verify account setup:
poetry run python src/verify_setup.py- Run the trading system:
poetry run python src/main.py- Monitor positions and orders:
poetry run python src/monitoring.py- Minimum signal confidence: 0.5
- Minimum risk/reward ratio: 1.5
- Default monitoring interval: 60 seconds
π§ This project is under active development. Features are being added and refined regularly.
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.