An application that helps you backtest your algorithmic trading strategy
- Clone the repo locally into a directory which will be referred to in further instructions as backtestbuddy/
- Create a .env file in backtestbuddy/backend/app/ with the keys ALPACA_KEY and ALPACA_SECRET. These can be obtained from creating an account with Alpaca
- Install Docker Desktop if not already on your system
- Launch Docker Desktop
- Launch a terminal and navigate inside backtestbuddy/
- Run
docker-compose -f dev.docker-compose.yml up --watch
- Backend is now running on localhost:8000 and frontend is running on localhost:5173, WITH HMR
- Run
docker build -t backtestbuddy-frontend:latest -f frontend/dev.Dockerfile ./frontend
- Run
docker build -t backtestbuddy-backend:latest -f backend/dev.Dockerfile ./backend
- Run
docker run -p 5173:5173 backtestbuddy-frontend:latest
to start frontend on localhost:5173 WITHOUT HMR - Run
docker run -p 8000:8000 backtestbuddy-backend:latest
to start backend on localhost:8000 WITHOUT HMR
- Launch a terminal and navigate to backtestbuddy/frontend
- Run
npm install
- Run
npm run dev
to run frontend on localhost:5173 with HMR
- Launch a terminal and navigate to backtestbuddy/backend
- Optionally create and activate a virtual environment, I would recommend using Anaconda to manage virtual environments
- If using VScode, select the python interpreter by searching for
>Select Python Interpreter
and selecting the virtual environment, then use the in-built VScode terminal for the next instructions
- If using VScode, select the python interpreter by searching for
- Run
pip install -r requirements.txt
- Run
uvicorn app.main:app --reload
to run backend on localhost:8000 with HMR