qalc is a modular, strategy-driven trading CLI and backtesting framework for Python, managed by Poetry. It supports pluggable data providers (Alpaca by default), strategy selection via CLI, and is designed for rapid strategy development and testing.
- Strategy registration and selection via CLI
- Pluggable data provider abstraction (Alpaca default)
- Backtesting workflows
- VS Code debug and task integration
- Environment variable management via
.env
-
Clone the repository:
git clone <repo-url> cd qalc
-
Install dependencies with Poetry (create .venv in project directory):
POETRY_VIRTUALENVS_IN_PROJECT=true poetry install --with=dev
-
Copy and edit your
.envfile for API keys:cp .env.example .env # Edit .env with your Alpaca API keys
poetry run qalc backtest --strategy rsi_trailing_stop --symbol AAPL --days 5poetry run python -m qalc backtest --strategy rsi_trailing_stop --symbol AAPL --days 5- Use the included debug configuration to run and debug the CLI.
- Use tasks for install, update, lint, and test workflows.
poetry run qalc backtest --strategy rsi_trailing_stop --symbol TSLA --trail_percent 0.05 --days 10- Register new strategies in
main.pyin theSTRATEGIESdictionary. - Implement your strategy in the
qalc/strategies/directory.
- Lint:
poetry run flake8 qalc - Test:
poetry run pytest
For more, see .github/copilot-instructions.md and the VS Code tasks/debug configs.