Methodology

What keeps a run honest.

A backtest is a claim about the past, and most of the ways it goes wrong are quiet ones. The curve still climbs, nothing errors, and the mistake is visible only to whoever built it. These are the rules Vaquero holds a run to, the mechanism behind each one, and the test that would catch it failing.

01The rule

One rule, applied strictly.

A fact may be used at a decision only if it was already true before that decision. Not on the same day. Before it.

In the code that is a strict comparison, and the missing character is not a detail. With the looser one an instrument becomes selectable on the very session its first bar prints, which is knowledge the decision could not have had, and the run still returns a perfectly plausible curve. Nothing errors. Nothing looks wrong. The test that guards it flips exactly that character and prints the instant it lets through.

The snapshot a strategy is handed follows the same rule: history through the last bar that closed, and no further. It cannot see the price it is about to be filled at.

02Point in time

Dated by the day it was published.

A company's figures are stored under the day the filing became public. Never under the day the period ended.

That distinction carries most of the weight on this page. A quarter closes in September, the report appears in November, and the figure is then restated for years afterwards: for Apple alone, 1,917 annual figures appear in more than one filing. Keying on the period end would hand an October decision a number that did not exist until November, and would then silently upgrade it every time the company revised it. So there is no fallback to a later revision anywhere in the read path. If nothing had been published by the decision date, the strategy gets nothing.

Revised macro series are read the same way. Ask for US real GDP as it stood on 15 April 2020 and the series ends at the fourth quarter of 2019, because the first-quarter figure was not published until 29 April. The version that exists today is not quietly substituted in.

03Identity

A company is its filer, not its ticker.

Ticker symbols are leased, not owned. Our own register of reuse found 1,439 symbols that have sat on more than one filer. A record keyed on the symbol splices two different companies together at the point one of them handed the letters over, and nothing in the price series shows the seam.

So the record is keyed on the filer identity the regulator assigns, and the map that resolved each symbol is stored beside the data. Where that map has a limit of its own, the limit is written down with it rather than left for someone to discover later.

04Coverage

Nothing is discarded quietly.

Every record a collector refuses is counted, and the reason is kept with the count: no filer we could identify, no publication date, a period outside the window, a figure we do not read.

A dropped row that nobody counted is how a dataset comes to look complete. Counting them turns coverage into something a reader can look at rather than something a curve implies.

The same principle runs forward into the window a run is allowed. US company fundamentals begin where electronic filing began, phased in from 2009. A strategy that reads a balance sheet and starts in 2005 does not get a curve with that condition switched off for the first six years. It gets a refusal that names the window.

05Costs

Assumed against the book, never for it.

Some costs can be measured and some have to be assumed. Both are charged, and the assumption is deliberately set wider than anything we have measured, so the error runs against the strategy.

Impact is priced off volatility and participation rather than off the spread, on the empirical law measured in the literature. Pricing it off the spread hides a trap: the size a book is allowed to take falls out of the same expression, so widening the spread to be careful about cost widens the size cap at the same time and the caution reverses sign. The participation ceiling is set at the top of the range where the law has actually been measured, because past that point charging it would be extrapolation wearing a citation.

Funding is charged at the settlements that were observed, one by one, against the position that was open at that moment. Settlements genuinely get skipped, and the engine does not lay a regular grid over the window and invent the missing ones.

06Overfitting

The return history travels with the result.

Each result keeps its execution assumptions with the sample length, skewness, and kurtosis measured from its own return history. A Sharpe ratio read on its own is a point estimate. Those three say how short the sample behind it was, and how lopsided and heavy-tailed the returns in it were.

They go into the Probabilistic Sharpe Ratio of Bailey and López de Prado, read against a zero benchmark. It asks how likely it is that the Sharpe on screen reflects something real rather than a short, lopsided, fat-tailed record flattering itself, and the moments it uses are measured from that result's own weekly returns rather than assumed. The figure is computed per result and printed beside the Sharpe.

The difference shows up most on short samples. The same Sharpe from two years of skewed, fat-tailed weekly returns and from ten years of well-behaved ones is not the same evidence, and a result that has thrown its moments away cannot be re-examined later. Keeping them is what makes the number checkable rather than quotable.

07Survivorship

Subtracted, and printed at full size.

The candidate list a cross-section is drawn from is made of instruments that exist today. A cross-section drawn from survivors is one with the failures taken out of it, and every ranking rule measured on it comes out flattered.

Half of that is fixable and it is fixed: an instrument is kept out of the window before it existed, by the same strictly-earlier rule everything else obeys. The other half is the names nobody collected before they disappeared, and no amount of care recovers those. So it comes off the grade as a deduction and the result prints how large the deduction was. The bias becomes a number you can argue with instead of a line at the bottom of a post.

08The test

The guard is tested by breaking it.

A guard that has never failed has never been tested. So the suite is written the other way round: a fix counts as working only when putting the old code back makes the suite fail.

When one comparison was deliberately widened by a single character, 425 decision points were exposed early and the final equity moved. Had the number not moved, the guard was decoration and we would have been protecting nothing.

The suite has grown past eighty separate look-ahead checks, and it has to pass on the machine that actually runs the backtests, not only on a developer's laptop. A local sample is smaller and newer than the real record, and checks that passed locally have failed against the full one.

09Reproducibility

Every run keeps its own terms.

The execution settings a run was made under travel with its result, and the specification that produced it is stored beside them. A curve can therefore be re-read months later on the terms it was made under rather than on today's, and the same specification over the same window returns the same numbers.

That is the last of it, and the reason for all of the above. A result nobody can reproduce is an anecdote with a chart attached.

Bring the idea. We will test it.

Research and backtesting infrastructure. No strategy recommendations, no trade signals, no order execution.

Vaquero is a research and education service, not investment advice. We recommend no buying or selling, publish no trading signals, and guarantee no return.