Thanks for your interest in the QuantJourney Backtester. Contributions are welcome — especially new example strategies, bug fixes, and documentation improvements.
Open a pull request on GitHub. A maintainer reviews every pull request and decides how to integrate it. A change may be merged as-is, adapted first, or re-applied through the QuantJourney source of truth and the pull request closed as integrated. Either way you will get a response, and accepted work is credited. Please don't be surprised if your change lands in a slightly different form — the maintainer curates how each contribution is included.
Small, focused pull requests are reviewed fastest: one strategy, or one fix, per pull request.
- New example strategies — the easiest and most valued contribution. A good example is small, self-contained, and teaches one idea clearly.
- Bug fixes — with a short description of the incorrect behavior and, where possible, a test that fails before the fix.
- Documentation — clarifications, typos, better explanations.
- Ideas and feedback — open an issue; not every contribution needs code.
On GitHub, click Fork (top right) to create your own copy.
git clone https://github.com/<your-username>/quantjourney-bt.git
cd quantjourney-bt
git remote add upstream https://github.com/QuantJourneyOrg/quantjourney-bt.gitgit checkout main
git pull upstream maingit checkout -b feat/short-descriptionUse a short, descriptive name, e.g. feat/example-bollinger-squeeze or
fix/limit-fill-rounding.
Use the reviewed lockfile (do not install into system/Homebrew Python):
uv sync --frozen --extra dev --extra data --extra wf --extra typecheckFor a new strategy, follow the conventions in Adding an example strategy below.
uv run --no-sync pytest -q
uv run --no-sync ruff check .
uv run --no-sync ruff format --check .
uv run --no-sync python tools/check_mypy_baseline.py
# for a new strategy, confirm it imports cleanly:
./strategy.sh <your_strategy_name> --checkEverything should pass before you open a pull request.
Do not update quality/mypy-baseline.json merely to make CI green; a
maintainer must review the complete diagnostic change.
git add .
git commit -m "Add Bollinger squeeze example strategy"Write a clear, present-tense message describing what the change does.
git push origin feat/short-descriptionGo to your fork on GitHub — it will offer to Compare & pull request against
QuantJourneyOrg/quantjourney-bt. Open it, and in the description include:
- what the change does and why,
- for a strategy: the idea in one or two sentences and the universe used,
- confirmation that
pytest,ruff, and (for strategies)--checkpass.
A maintainer will review and may ask for adjustments or adapt the change during integration. Push more commits to the same branch to update the pull request.
Example strategies follow a simple convention so they stay consistent and discoverable:
- File name:
example_<mode>_<NN>_<name>.py, where<mode>isweights,orders, orwf(walk-forward / optimization), and<NN>is the next number in that series. - License header + docstring: start with the short license header used by the
other files, then a docstring describing Mode, the idea, the universe, and
(for order or intraday strategies) the order type / granularity — match the
style of the existing files in
strategies/. - Structure: subclass
Backtesterand implement_compute_signalsand_compute_weights(weight mode) or_compute_orders(order mode). - Keep it runnable: it should pass
./strategy.sh <name> --check(an import-only check, no credentials or data call). - Add it to the catalog: a one-line row in
strategies/README.md.
Prefer widely available symbols so the example runs against common data, and keep the universe small enough to read the resulting report.
-
pytest -qpasses. -
ruff check .is clean. -
ruff format --check .and the reviewed mypy baseline gate pass. - New strategies pass
./strategy.sh <name> --check. - Docstrings follow the existing style.
- No credentials, API keys, tokens, or private paths are included.
- The change is focused and described in the pull request.
Example strategies are research templates, not production trading systems. If an example simplifies an assumption (borrow cost, financing, liquidity, market impact), state it in the docstring so the assumption is documented, not hidden — this is the core value of the project.
Be respectful and constructive. Assume good faith, keep discussion technical, and help newcomers. Behavior that harasses or demeans others is not welcome.
By contributing, you agree that your contributions are licensed under the project's Apache License 2.0.