Skip to content

belgrano9/alpaca_trading_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Alpaca Based Trading Bot/Platform

A Python-based automated trading platform using Alpaca Markets API for executing algorithmic trading strategies with real-time monitoring and risk management.

Features

  • 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

Project Structure

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

Installation

  1. Clone the repository
  2. Install dependencies with Poetry:
poetry install
  1. Create .env file with your Alpaca credentials:
API_KEY=your_api_key
SECRET_KEY=your_secret_key

Usage

  1. Verify account setup:
poetry run python src/verify_setup.py
  1. Run the trading system:
poetry run python src/main.py
  1. Monitor positions and orders:
poetry run python src/monitoring.py

Configuration

  • Minimum signal confidence: 0.5
  • Minimum risk/reward ratio: 1.5
  • Default monitoring interval: 60 seconds

Development Status

🚧 This project is under active development. Features are being added and refined regularly.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages