Running QSTrader Backtests Across a Raspberry Pi SLURM Cluster
Summary
The article walks through installing QSTrader on secondary Raspberry Pi nodes managed by SLURM, then checking the setup by running its 60/40 equity and bond example across the cluster. It describes installing Python build dependencies, creating a virtual environment on each selected node, and installing QSTrader into those environments. Shared storage holds the strategy script and price files, while SLURM commands distribute setup and execution.
To support headless parallel runs, the example replaces graphical tearsheet output with JSON statistics and adds each node's hostname to the output filename. The article then explains how to load and inspect the resulting statistics, including equity curves, cumulative returns, and drawdowns, with optional plots where a graphical environment is available. The example uses historical SPY and AGG data through October 2022 and reports a 4,960-row equity series ending above its initial value. This is an installation and workflow demonstration, not evidence that the strategy is profitable or that the cluster approach improves backtest validity; the series intends to apply the setup to parameter sweeps later.
Key ideas
- SLURM can run setup commands and backtest jobs across designated Raspberry Pi nodes.
- A virtual environment on each worker node provides a consistent QSTrader installation.
- Shared storage lets the nodes access common strategy code and historical market data.
- JSON statistics and hostname-specific output files support headless runs and distinguish node results.
- The example validates execution of a 60/40 backtest but does not establish strategy performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.