Welcome! This repository contains a snapshot of an old version of our production backtesting system.
Important: Some parts have been intentionally modified to include flaws and issues for you to discover and address. This is not production-ready code - it's a realistic test environment.
A Python-based backtesting framework for trading strategies using real market data. It uses:
- NautilusTrader for backtesting engine https://nautilustrader.io/docs/
- Databento data format (pre-cached sample included)
- Real ES futures data from December 2023
- Python 3.11 or 3.12 only
- No API keys needed (sample data included)
# Create virtual environment
python -m venv .venv
source .venv/Scripts/activate
# Install dependencies
pip install -e .
# Install Jupyter (for running the quickstart)
pip install jupyterlabjupyter lab examples/example-01-importing-data-and-using-the-backtester/quickstart.ipynbRun all cells sequentially. The notebook uses pre-cached data in sample_data/ - no fetching required.
We want to see how you approach working with an unfamiliar codebase and handle ambiguous requirements - just like real work.
These are explicitly suggested areas to explore:
- Testing: Add unit tests (current coverage is minimal)
- Documentation: Improve docstrings add more examples here
- Code Organization: Refactor for better structure
- Visualization: Doesn't stream backtest result as backtest is running
Hidden Issues (Discovery Required)
Some things are intentionally broken or suboptimal, but not obviously so:
- Play with the backtester and observe its behavior
- Run backtests with different parameters
- Look at the output data and visualizations
- Some bugs may only appear in specific scenarios
This is intentional - part of the assessment is discovering issues on your own.
- Recommended: 2-4 hours
- Focus: Quality over quantity
- Document: Your thought process (commits, comments, notes)
We're looking for:
- Code Quality: Clean, readable, well-tested code
- Problem Solving: How you identify and fix issues
- Handling Ambiguity: Working without complete specifications
- Communication: Clear commits, comments, documentation
- Judgment: Prioritization and decision-making
Use Python 3.11 or 3.12 only. Check with: python --version
The sample data should be in sample_data/. If missing, check that git cloned properly.
This is expected because you the assessment doesn't require fetching new data.
If you run into this error, simply avoid using databento to fetch data by using the provided data in sample_data/.
If you're experimenting with data fetching:
- The assessment doesn't require fetching new data
- Set the environment variable if you have your own key:
export DATABENTO_API_KEY="your-key"
Install in your virtual environment: pip install jupyterlab
Make sure you:
- Activated your virtual environment
- Ran
pip install -r requirements.txt - Ran
pip install -e .
If you encounter issues with the assessment setup (not the intentional bugs!), reach out to your contact andrew.yin@squarekettle.com.
Good luck! 🚀