This project provides a set of Python scripts for automating stock trading using the Alpaca trading API (All the code examples are to be executed in the root directory)
Before running the scripts, you need to set up a few things:
- Create an account on Alpaca
- Obtain API credentials (API key and secret key) from Alpaca and store them in a .env file in the root directory of the project, using the following format:
api_key=<your_api_key>
secret_key=<your_secret_key>
end_point="https://paper-api.alpaca.markets"
end_point_for_data=<"https://data.alpaca.markets">
- Install the required Python packages by running
pip install -r requirements.txt
To run the main application, execute the following command in the root directory of the project:
python3 src/main.py
To run the unit tests, execute the following command in the root directory of the project:
python3 -m unittest
The Alpaca trading API reference is available at: