Algotrader
Custom Trading App for Algorithmic Trading
Install / Use
/learn @s-stolz/AlgotraderREADME
AlgoTrader
AlgoTrader is an experimental trading project that uses the Lightweight Charts library to visualize historical market data.
Architecture
The project is structured into multiple services, each responsible for a specific aspect of the trading system:

Development Disclaimer
This project is in active development and may undergo significant changes. Backward compatibility is not guaranteed—things might break! Please use this repository for reference only and not as a stable library.
Trading Risk Disclaimer
Trading in derivative instruments—including futures, options, CFDs, Forex, and certificates—carries significant risk and may not be appropriate for all investors. There is a possibility of losing the entire initial investment or even more. Use this project at your own risk.
Support the Project
If AlgoTrader has helped you with your algorithmic trading journey, you can support its continued development by using my IC Trading affiliate link when opening a trading account. IC Trading offers competitive spreads and reliable execution for algorithmic traders.
Using this link costs you nothing extra but helps fund the development of new features and improvements.
Prerequisites
- Docker installed on your machine.
Getting Started
- Clone the repository:
git clone https://github.com/s-stolz/algotrader.git cd algotrader - Create local secrets from the example:
cp config/.env.secrets.example config/.env.secrets.local - Generate the root
.envfrom the tracked topology + local secrets:python scripts/generate_env.py - Edit
config/topology.yamlfor shared non-secret settings (ports, hosts, tuning), and editconfig/.env.secrets.localfor credentials/secrets. - Run the project and explore.
Running with Docker Compose
Default workflow (auto-regenerates .env before Compose):
make up
Direct Docker Compose usage:
python scripts/generate_env.py --force
docker compose up --build
This will build and start all necessary services as defined in the docker-compose.yml file.
Central Configuration Model
- Tracked shared topology:
config/topology.yaml - Gitignored secrets:
config/.env.secrets.local - Generated runtime env files:
config/.env.shared,config/.env.secrets.db,config/.env.secrets.runtime,config/.env.secrets.broker - Generator script:
scripts/generate_env.py
Validation and overwrite
python scripts/generate_env.py --validate
python scripts/generate_env.py --force
Make targets
make config
make validate-config
make up
make build
make down
make restart
make logs
make ps
Local Python Environments
Use a root virtual environment for shared library/test tooling and per-service virtual environments for service runtime dependencies.
Shared constraints + service requirements
- Shared versions live in
constraints-shared.txt. - Each service keeps its own
requirements.txt. - If a service must diverge, add
<service>/constraints.override.txtwith a short rationale comment.
Bootstrap all service venvs
make venvs
Equivalent direct command:
./scripts/setup_venvs.sh all
This now creates:
- root environment:
.venvusingrequirements.root.txt - service environments:
<service>/.venvusing each servicerequirements.txt
Bootstrap only root venv
make venv-root
Setup one service
make venv SERVICE=broker-service
Recreate all service venvs
make venvs-recreate
Validate existing environments
make venvs-check
VS Code Multi-Venv Workflow
- Open
algotrader.code-workspacein VS Code (not only the repo root folder). - The workspace uses
python.defaultInterpreterPath = ${workspaceFolder}/.venv/bin/python, so each service folder resolves to its own.venv. - If a service interpreter is not picked up immediately, run
Python: Select Interpreteronce while a file from that service is active.
License
This project is licensed under the MIT License - see the LICENSE file for details.
This project makes use of third-party software so please check the ATTRIBUTIONS.md file for more information.
