Case 062Systematic research and dataCore
A backtest on Orlin Minerals gives a Sharpe ratio of 2.1. The price file has one duplicated day and one bad print at ten times the true price that reverts the next day. What does cleaning do to the Sharpe, and how would you catch these errors automatically?
1The situation
A junior researcher shows you a backtest of a simple strategy on Orlin Minerals, a mining stock trading around Rs 100: each day, go short if yesterday's return was positive and long if it was negative, fully invested, closing prices only. Over about six months of daily data the strategy shows a Sharpe ratio of 2.1.
Looking at the price file, you find two problems. Row 21 repeats row 20 exactly, a duplicated day. And on row 42 the close is recorded as about Rs 1,035, ten times the true price, before returning to normal the next day.
2Your task
What happens to the Sharpe ratio when you clean the file, why does one bad print matter so much, and what checks would catch errors like these before anyone sees a backtest?
Quick check
Which error do you expect to have inflated the Sharpe ratio more?
Worked solution
Try it on paper, then open one step at a time.
30-second answerThe answer to give first
Cleaning takes the Sharpe from 2.1 to about 0.6. The bad print gives the strategy two giant winning days: long into the tenfold jump, then short into the fall back. Those two days make about 97% of the raw return. The duplicated day barely moves the number here but can shift every later signal by a day in other pipelines. Catch both automatically with a duplicate-date check and a spike-and-reversal filter before any backtest runs.
Step 1What does the raw file look like?
Plot it before computing anything. A tenfold price that returns to normal the next day is not a market move; it is a data error, usually a misplaced decimal or a wrong instrument code. Think of a bank statement showing Rs 1,00,000 credited on Monday and debited on Tuesday by mistake: your balance is right by Wednesday, but a spending plan built on Monday's balance is not. The duplicated row is quieter: the same close appears twice, so the file shows a day on which nothing happened.
Step 2Why does one bad print create most of the Sharpe ratio?
Walk the strategy through the error. The day before the print Orlin fell, so the strategy is long. The price then jumps tenfold, a log return of about 2.30, and the next day it falls back by the same amount while the strategy, fading the jump, is short: two winning days, each a log return of about 2.3. The clean strategy earns about 10% over the whole six months; the raw file shows about 473%. Two fictional days are about 97% of the raw return. They also raise the volatility, which is why the Sharpe ratio reaches 2.1 and not something far larger.
| Version of the price file | Sharpe ratio |
|---|---|
| Raw: duplicate and bad print | 2.07 |
| Bad print only | 2.08 |
| Duplicate only | 0.51 |
| Cleaned | 0.61 |
Step 3If the duplicate barely mattered, why fix it?
Because its harm depends on the pipeline, not on this backtest. If returns and signals are ever joined by row position instead of by date, one extra row shifts every later signal by a day, and a strategy that looks one day into the future can show a spectacular Sharpe ratio for months. It also inflates the day count used to annualise volatility and hides a real missing day somewhere else, because vendors often duplicate the previous close when a day's data failed to arrive.
Step 4How would you catch both automatically?
Build checks that run before any research code sees the data. Reject duplicate dates and flag runs of identical closes. Flag any day whose return is more than, say, ten times the stock's recent daily volatility and is reversed within one or two days, then compare the price with a second source or the day's traded high and low. Check prices against corporate-action calendars so a genuine split is not flagged as an error. And make every backtest report show its result without its best five days: when 97% of the return sits in two days, that one line tells you to look at the data before the strategy.
Where candidates lose it
The frequent loss is fixing the bad print by deleting the row. That leaves a two-day gap whose return is the true two-day move, which is fine, but it also creates a missing date that a position-based join will mis-align. Replace it with a verified price or mark it missing and handle it explicitly.
The second is trusting the Sharpe ratio because the strategy makes economic sense. Fading daily moves is a plausible idea, which is exactly why a data error that flatters it goes unquestioned.
What the interviewer asks next
- How would you tell a genuine one-day spike, such as a takeover bid, from a bad print?
- The strategy runs on 500 stocks instead of one. How does one bad print affect the portfolio's Sharpe ratio then?
- What would you log so a data error found next year can be traced to every backtest it touched?
Asked at Squarepoint Capital, Quantitative Trading, London, 2026 (Wall Street Oasis): implement some functionalities and make sure that input data is cleaned (duplicates, corrupted data etc...)
Company names and figures are illustrative.
