algorithmic-trading · Lesson 4

The Data That Feeds Algorithms

Why the numbers going in decide an algorithm's fate — garbage in, garbage out — and the quiet data errors that wreck systems before they ever place a trade.

6 min readBeginnerSean ShaReviewed by Sean ShaUpdated: July 2026
The Data That Feeds Algorithms — illustration of a friendly home kitchen with a person carefully inspecting fresh produce at a pr

Educational purposes only. This content does not constitute investment advice. Read our disclaimer

StockCram is not a broker-dealer, investment adviser, or financial institution. All content is for educational and informational purposes only and should not be construed as personalized investment advice. Consult a qualified financial professional before making investment decisions. Past performance does not guarantee future results.

TL;DR

A trading algorithm is only as good as the data you feed it. Every decision downstream inherits any error in the inputs — garbage in, garbage out. Systems eat three main kinds of data: market data (prices, volume, spreads), fundamental data (earnings, revenue), and alternative data (satellite images, web traffic, sentiment). The quiet killers are data-quality problems — survivorship bias, look-ahead errors, bad ticks, and un-adjusted splits — that make a strategy look better on paper than it ever was in reality. Cleaning and checking data is unglamorous work, but it's where most of the real effort, and most of the failures, actually live.

Garbage In, Garbage Out

In the last lesson we turned a strategy into precise rules. But those rules never touch the market directly — they touch data about the market. And there's a catch worth sitting with: a trading system is only as good as the numbers you feed it. Every clever rule, every risk check, every backtest sits on top of the data, and inherits every flaw in it. Feed the machine a wrong price and it doesn't know the price is wrong — it just trades on it, confidently, at the speed of a computer.

Garbage in, garbage out: market, fundamental, and alternative data feed a trading algorithm that trades on it blindly, so every input flaw flows through — and quiet errors like survivorship and look-ahead bias flatter a strategy.
A trading system is only as good as the data it eats. Because an algorithm can't tell a wrong number from a right one, every input flaw flows to the output — and the quiet errors are the ones that flatter a strategy.

Programmers have a name for this: garbage in, garbage out. It means a system's output can never be more trustworthy than its input. A calculator given the wrong numbers still adds them perfectly — and hands you a perfectly wrong answer. Most beginners obsess over the strategy and treat the data as a given. Professionals do the opposite: they assume the data is dirty until proven clean.

The One-Sentence Version

An algorithm doesn't see the market — it sees a spreadsheet of numbers someone collected about the market. If those numbers are wrong, delayed, or misleading, no amount of clever code can save it.

The Three Kinds of Data Algorithms Eat

Almost everything a trading system consumes falls into one of three buckets. The first is market data — the prices a stock trades at, how much volume changes hands, and the bid-ask spread between the best buy and sell offers. This is the heartbeat of any system: it's what tells the algorithm what things cost right now.

The second is fundamental data — the health of the actual business behind the stock: quarterly earnings, revenue, debt on the balance sheet. This is the raw material of fundamentals, and it changes slowly, a few times a year, rather than every second. The third is alternative data — creative, indirect signals that aren't about markets at all: satellite photos counting cars in a retailer's parking lots, website-traffic counts, anonymized credit-card spending panels, or the tone of news headlines. The idea is to glimpse how a business is doing before the official numbers come out.

Each kind of data has a personality — a typical example, and a typical way it quietly goes wrong. The whole menu on one plate:

Data typeExampleCommon gotcha
Market dataA stock's price and trading volume, tick by tickBad ticks — a stray price that never truly traded, plus gaps and timezone mix-ups
Fundamental dataQuarterly earnings, revenue, debt on the balance sheetPoint-in-time errors — using a figure that was later restated, so it wasn't really known yet
Alternative dataSatellite photos of parking lots, web traffic, card-spending panelsExpensive, noisy, and often far less predictive than it's sold to be
Corporate actionsStock splits, dividends, ticker changesUn-adjusted history makes a 2-for-1 split look like an overnight 50% crash

The data an algorithm eats — and the quiet way each kind tends to be wrong. The gotcha column is where systems actually fail.

Notice that last column. None of these gotchas announce themselves — there's no error message. The data looks perfectly reasonable; it's just subtly wrong in a way that flatters your strategy. Those quiet errors are worth their own section, because they're the ones that fool even careful people.

When Good-Looking Data Lies

The most dangerous data errors aren't the obvious ones. A price of −$5 gets caught instantly. The killers are the errors that leave the numbers looking sensible while quietly tilting the whole picture in your favor. Three show up again and again.

Survivorship bias is the sneakiest. Imagine you download today's list of 500 big companies and test a strategy on their last 20 years of prices. Sounds fair — but that list only contains the companies that survived. Every business that went bankrupt or got delisted has silently vanished from your data. You've accidentally tested a strategy on a universe of guaranteed winners, and it looks brilliant. In one illustrative example, a strategy might show a tidy 12% a year on the survivors and barely break even once the failed companies are added back. The failures were the whole point, and they're gone.

Look-ahead bias — sometimes called a point-in-time problem — means using a number the algorithm couldn't actually have known yet. A company reports earnings, then revises them two months later. If your data quietly stores the revised figure on the original date, your backtest is peeking at the answer key. It'll look like your system brilliantly predicted the news, when really it just read tomorrow's newspaper. Third are the plumbing errors: gaps, bad ticks, and adjustment mistakes — a missing day, a stray price, or a stock split that wasn't accounted for, which can make a normal $100 stock look like it crashed to $50 overnight.

Why these are so dangerous

Every one of these errors makes a strategy look better than it really is. That's what makes them lethal — a broken system that looked worse would get thrown away, but one that looks great on flawed data gets funded, launched, and then loses money in the real world where the survivors weren't guaranteed and the earnings weren't known in advance.

Clean, Fast Data Is Expensive

A lot of the advantage big trading firms have has nothing to do with a smarter idea. It comes down to better data. Cleaner history that's already corrected for splits and survivorship. Faster feeds that arrive milliseconds sooner. Exotic alternative datasets that cost more per year than a house. When two firms run a similar strategy, the one with cleaner, fresher, more complete data tends to win, not because it's more brilliant, but because it's working from a more honest picture of reality.

This is why data is a real budget line, not an afterthought. Historically, serious firms have spent enormous sums buying, cleaning, and storing data — and hiring people whose entire job is making sure the numbers can be trusted. For a beginner, the lesson isn't to go buy expensive feeds; it's to be humble about the free data you can get, and honest about its limits.

Where the Real Work Actually Lives

Nobody dreams of becoming a trader so they can spend their days fixing timezone stamps and hunting down a missing dividend. But that unglamorous cleaning and checking is where much of the real work — and most of the quiet failures — actually live. The exciting part, the strategy, is often the easy part. Making sure the data behind it is trustworthy is the hard, tedious, essential part almost everyone underestimates.

This ties directly into what's next. In the following lesson we'll cover backtesting — testing a strategy on historical data to see how it would have behaved. But a backtest is only ever as trustworthy as the data behind it. If survivorship bias or look-ahead errors are hiding in your history, your backtest will hand you a confident, beautiful, and completely fictional result. Good data isn't a boring prerequisite to the interesting work — it is the interesting work, in disguise.

Educational use only

Educational content only. StockCram isn't a broker or adviser, and we have no affiliation with any institution or tool we mention. Nothing here is a recommendation to trade in any particular way.

Key Takeaways

  • Garbage in, garbage out - A system can never be more trustworthy than its data. An algorithm trades on the numbers it's given without knowing whether they're right — so every input error flows straight through to the output.
  • Three kinds of data - Systems eat market data (prices, volume, spreads), fundamental data (earnings, revenue, debt), and alternative data (satellite images, web traffic, sentiment). Each has its own typical way of being wrong.
  • The quiet errors flatter you - Survivorship bias, look-ahead bias, and bad ticks all make a strategy look better than it really was. Because they hide a rosier picture, they're far more dangerous than obvious errors.
  • Better data is often the real edge - Much of a big firm's advantage is cleaner, faster, more complete data — not a smarter idea. Cleaning and validating data is unglamorous, but it's where most of the real work and most failures live.

Continue Learning

Frequently Asked Questions

Mostly three kinds. Market data is prices, trading volume, and the bid-ask spread — the heartbeat of what things cost right now. Fundamental data is the health of the underlying business: earnings, revenue, and debt, which change only a few times a year. Alternative data is indirect, creative signals like satellite images of parking lots, website traffic, or credit-card spending panels, used to glimpse how a business is doing before official numbers appear.

It's testing a strategy only on the companies that survived to today, because the ones that went bankrupt or got delisted quietly dropped out of your dataset. That accidentally tests your idea on a universe of guaranteed winners, so it looks far better than reality. Adding the failed companies back in often erases most of the apparent performance — the failures were the whole point.

Look-ahead bias means using a number the algorithm couldn't actually have known at that moment. A common case is earnings that get revised weeks later: if your data stores the revised figure on the original date, a backtest peeks at the answer key and looks like it predicted the news. Point-in-time data avoids this by recording only what was truly known on each date.

Because a system's output can never be more trustworthy than its input. An algorithm doesn't know when a price is wrong or delayed — it just trades on it, confidently and fast. A single bad number flows straight through every clever rule and risk check. That's why professionals assume their data is dirty until proven clean, rather than trusting it by default.

Often, yes, and that's frequently the real edge — not a smarter idea. Larger firms tend to have cleaner history already corrected for splits and survivorship, faster feeds that arrive sooner, and exotic alternative datasets that cost a fortune. Working from a more honest, complete picture of reality tends to beat a clever strategy running on messy, incomplete data.

Share