Backtesting Errors

Backtesting errors are simply a byproduct of the backtester adhering to the backtest inputs. Here is what you need to know about the different backtesting errors.

When running new backtests or modifying existing backtests, you may encounter what appear to be errors. However, the errors are simply a byproduct of the backtester adhering to the backtest inputs, such as capital allocation limits, which may result in situations where no trades are able to open.

For example, this backtest has been created to have minimal starting capital and a high percentage of capital allocation per position.

Screenshot of a backtest's capital allocation inputs

It may appear that the backtest encountered an error. 

Screenshot of a backtest profit and loss graph

Instead, the backtest ran as long as it could with the allocation limits provided. Eventually, the account “blew up” and could no longer enter new positions to test.

Modifying the strategy’s criteria can create a situation where no trades are entered for one scenario.

Screenshot of modified backtest capital allocation inputs

This particular trade setup could not enter any positions because the parameters are very narrow and do not create an opportunity to open a position to backtest. One of the P/L lines disappears, and it may seem the backtest encountered an error. 

Screenshot of backtest profit and loss graph with one capital allocation having a horizontal profit and loss line

However, scrolling down the results page shows that the test did run but was unable to enter any positions based on the blue and green tabs’ capital allocation inputs. The stats are blank.


Screenshot of backtest results page with no results because no positions were entered

In this example, it appears that the green line had an error and stopped running near the end of the backtest, while the other two lines continued to enter positions. 

Screenshot of backtest profit and loss graph with a red arrow highlighting the point where no new positions were entered based on capital allocation inputs

However, looking at the backtest details shows that the green P/L line allocated 5% of capital to each position. As trades continued to lose money and SPY’s price increased, it eventually became impossible for the portfolio to enter new positions based on the backtest’s capital restrictions, so it stopped. 

Screenshot highlighting a backtest's results summary by capital allocation of 5% of capital per position
Was this helpful?


Why do some of my Backtested P/L lines "flatline"?

A flatline usually indicates the Backtest has a lack of available capital to enter new trades. This could be because the account was drawdown and can not afford new positions or the underlying symbols price got too expensive for the account allocation value to afford the position.

Why might my stats fields be empty after running a Backtest?

The Backtest did not complete any trades and therefore has no results to display.