Dados B3Guides › Look-ahead-free backtesting

Guide · Backtesting & multiples

Look-ahead-free backtesting: why the Dec-31 P/E lies

There's a silent error in almost every backtest of Brazilian stocks. It throws no exception, shows up on no chart — it just inflates the result and makes a mediocre strategy look brilliant. It's called look-ahead bias.

The error

You want to test "buy low-P/E stocks". You take earnings from the 2023 annual report and divide the Dec 31, 2023 price by them. Looks right. It isn't.

A company's annual report for a fiscal year ending Dec 31 does not exist publicly on Dec 31. It's published months later — typically February–March of the next year. Using the Dec-31 price with those earnings means using a quote the market had before it knew the number. It's time travel: the backtest "knows" a result nobody knew that day.

Why it fools so many. Companies about to report great earnings tend to have already risen by the disclosure date. Pairing the good earnings with the cheap price from months earlier captures exactly that move — a return no real investor could have captured, because the information didn't exist. The backtest shines; the live strategy disappoints.

The right way: point-in-time

The multiple must use the price of the first trading session on or after the date the report became public — not the fiscal-year close. That way the P/E reflects what you could have paid, with the information that actually existed.

A real case measured in our database — WEG's 2025 annual report:

Dec 31, 2025fiscal year-end. The year's profit already "happened", but nobody knows it yet.
Feb 25, 2026the regulator (CVM) receives the statement. Only now is the number public.
Feb 26, 2026first session on/after publication → this is the price Dados B3 uses for the 2025 P/E.

That's nearly two months of gap. Multiply it across hundreds of companies and 16 years, and look-ahead bias becomes the difference between an honest backtest and an illusion.

How Dados B3 does it

Every multiple (annual P/E, P/B, EV/EBITDA; quarterly trailing P/E) uses the price of the first session on/after dt_receb — the real date the regulator received the filing, recorded on the document's own cover. Nothing is paired with the period close. And the share count is the snapshot in force on that date, not at fiscal year-end — so a stock split in between doesn't silently break the market cap.

Create a free key

Why it matters to you