A Bot written in python to trade stocks (and crypto in the future?). At the moment, the Alpaca trading API is being used for making trades, but this might be changed in the future, as we've had many problems with it.
- Allow for trades to be made and viewed through the alpaca API
- Allow for stock data to be viewed and updated through alpaca data streaming API
- Create simulated trading environment for historical data
- Create algorithm which can be used to trade in either simulated or real environment
- Install Python
- Create fork of the repository
- Setup github ssh keys for your current device if you haven't yet.
- Ensure git is installed
- Clone fork:
git clone https://github.com/username/Stock-Bot.git
- Change to project directory:
cd Stock-Bot
- Run setup.sh:
./setup.sh
. This will do the following (note that these commands can be run manually if desired):- Create virtual environment using venv:
- Windows:
python -m venv venv --prompt stock-bot
- Linux:
python3 -m venv venv --prompt stock-bot
- Windows:
- Activate virtual environment:
- Windows:
source venv/Scripts/activate
- Linux:
source venv/bin/activate
- Windows:
- Install requirements:
pip install -r requirements.txt
- Install pre-commit git hooks:
pre-commit install
- Setup post-merge hooks to update pip, requirements, and hooks on merge.
- Create virtual environment using venv:
This project is currently not in a runnable state. You can look at and tinker with the code in this repository, but at the moment there is no specific way of running the project.
- Move into cloned directory:
cd Stock-Bot
- Add upstream remote if you haven't already (view currently set remotes through
git remote -v
):git remote add upstream git@github.com:Enprogames/Stock-Bot.git
- Pull in any changes:
git pull upstream main
- Create new branch for the issue you will be working on:
git checkout -b your-branch-name
- Make changes to the project
- Run pre-commit hooks through
pre-commit run --all-files
and make necessary changes to ensure all hooks pass. Pre-commit will not allow you to commit until all hooks have passed. - Add any new files through:
git add .
and commit them through:git commit -am "useful commit message; Closes #123"
. - Pull in any new changes (which could have been made while you were working) and rebase your commits on top of these changes:
git pull upstream main --rebase
- Push your changes to your fork:
git push origin your-branch-name
- Navigate to your fork on github.com and open a new pull request If an option doesn't immediately show up to open a pull request when navigating to your fork, click on the branch button and click contribute to open one.
- Fill out pull request with useful information about changes.
- Checkout main branch:
git checkout main
. - Contribute again by starting at step 3.