Reading a backtest
What a backtest is
A backtest runs one ladder over past prices: one ticker, one set of settings, its own starting cash and capital cap. You choose a date range, and Rungfolio replays each session in it, night by night, as a practice account's nightly job would have. It fills the orders, checks the safety net, plans the next session's orders under the cap, and records the account at each close.
It runs in your browser, on the same engine code that runs practice nights, and the same settings and prices always give the same result. The run makes some assumptions that a practice account doesn't, and every result is hypothetical: it comes from a model, not from real trades.
The eight numbers
The results open with eight numbers. They're shown for every run, however it turned out.
- Return: how the account's value changed over the run, from its starting cash to its value at the last close, as a percentage of the starting cash. Open lots count at that close, so the return includes what they would gain or lose if sold.
- Buy-and-hold: what the same starting cash would have returned in the ticker alone, bought at the first session's open and held to the last close. More on it below.
- Maximum drawdown: the largest fall in the account's value from an earlier peak, as a percentage of that peak (maximum drawdown). It's the worst stretch along the way, not where the run ended.
- Peak capital in use: what the open lots cost (capital in use) at the close where that cost was the largest share of the account's value, beside the cap that day. The cap is a share of the account's value, so it moves as the value does (the capital cap), and the peak isn't always the close with the most dollars in use.
- Realized profit and loss: what the lots that sold made, less what they cost (realized profit and loss).
- Lots open at the end: the lots still held at the last close, and what they would gain or lose if sold there (unrealized profit and loss).
- Days paused: the sessions on which the safety net held buying: the moving-average pause or the price floor. A paused ladder's sells keep working (what a pause does).
- Cycles: how many times a rung bought and then sold (rung cycles), in all and rung by rung.
Each number has a "why?" that opens its article.
The charts
- Account value beside buy-and-hold: the account's value at each close as a solid line, and buy-and-hold's as a dashed one, over the same days.
- Capital in use against the cap: what the open lots cost at each close, against the cap, drawn as a dashed level that steps when the cap changes.
- The price chart: the ticker's daily closes, with each buy marked by an arrow up under its day and each sell by an arrow down above it. Days on which buying was paused are shaded.
Under the charts, the trades list every lot, as the Journal does: when it was bought and sold, at what prices, and what it made.
A saved run keeps its numbers and its daily values, so opening it shows the eight numbers and the first two charts at once. It doesn't keep its trades: run it again to see its price chart and lots.
Why buy-and-hold is always there
A ladder's return means little on its own. A ladder on a ticker that doubled will probably show a gain, and one on a ticker that halved will probably show a loss, whatever the settings. Buy-and-hold over the same days answers the question that matters: did the ladder do better or worse than simply holding the ticker?
So every result shows it, whether the ladder came out ahead or not. Read the two together, along with the risks each took:
- The returns: a ladder that trailed buy-and-hold in a rising market may still have taken much less risk. One that beat it in a falling market may still have lost money.
- The drawdowns: buy-and-hold has its own maximum drawdown, shown beside the run's. A ladder keeps part of its account in cash, so its fall from a peak is often smaller. On a leveraged fund, holding can fall a long way.
- The money at work: buy-and-hold puts nearly all its cash in the ticker on the first day. A ladder buys only while its open lots stay under its cap, and usually has much less in them. Return on capital used shows how the money that was at work did.
- What neither counts: neither side is paid dividends, and cash earns no interest. On a fund that pays dividends, holding would really have returned about its dividend yield more each year, and a ladder's idle cash would have earned interest (the assumptions).
Four numbers that are always shown
Maximum drawdown, peak capital in use, days paused and lots open at the end are shown for every run, beside the return. Each says something a return can hide:
- A good return can come with a deep drawdown along the way, which would have been hard to sit through.
- A run that reached its cap often had money that couldn't buy more when the price fell further.
- Many days paused mean the safety net spent much of the range holding buying. The result depends on when those pauses happened.
- Lots open at the end are a bet still running. Their result counts at the last close, so had the range ended a week earlier or later, at a different price, the return would differ.
Comparing runs
Save the runs you want to compare, then tick two to four of them in the saved runs under the Backtest form, and choose Compare. It shows:
- A chart of their returns: each run's value as a return from its own starting cash, so runs of different sizes line up, and each run's buy-and-hold dashed in the same color.
- A table, a column per run: what each ran on, its settings and its eight numbers, each number with its "why?". A row the runs' terms or settings differ in is marked Differs, and its settings are written in full, so two that differ never read the same. A run whose start moved to where its ticker's minute bars begin shows the range it ran, with the start it asked for beside it, and is compared by the sessions it ran.
Runs over different tickers, date ranges, bar sizes or engine versions can be compared, and the page says so: they don't measure the same thing, so read their differences with care.
One run is one window
A backtest shows how one set of settings did over one stretch of the past. Settings chosen because they did well in one window often do worse in the next. Fitting the past explains why, and how to check a result over other windows and other tickers.