Risk-Free Rate in Backtests: How We Handle Cash Returns on BackAlpha
Published June 15, 2025
When simulating a trading strategy, it's important to consider not just what happens when you buy stocks — but also what happens when you don't. On BackAlpha, we incorporate a risk-free rate to simulate interest earned on idle cash. This allows for more accurate modeling when your strategy is partially or fully in cash.
What Is the Risk-Free Rate?
The risk-free rate is the theoretical return you'd get on cash with zero risk. In real life, this is typically approximated by short-term government bonds or cash sweep programs at brokerages. On BackAlpha, we use practical estimates based on real-world brokerage data — such as the cash sweep program offered by Robinhood, which currently pays around 4% annually for uninvested cash.
Why Does It Matter?
Many trading strategies don't keep your capital fully invested at all times. For example, a crossover strategy may hold cash between buy and sell signals. If that cash earns interest, the performance of the strategy improves — especially in high-rate environments.
Ignoring the return on idle cash would understate performance and misrepresent real-world behavior. Including the risk-free rate gives a fairer view of how capital grows, even when not actively in the market.
How BackAlpha Applies the Risk-Free Rate
In our crossover strategies, cash positions automatically accrue interest based on the selected risk-free rate. You can specify this value directly when running a simulation using the built-in form. For example, setting a risk-free rate of 4% will apply 4% annual interest to any uninvested cash throughout the backtest.
- Interest compounds daily while capital is in cash
- The rate can be adjusted interactively using the form
- Higher rates have larger impact on strategies with longer cash periods
Try it yourself by exploring a Golden Cross simulation with 4% risk-free rate — or use the form to set your own assumptions and see how cash returns shape your performance over time.