Price data is usually provided adjusted for splits/dividends. On2020-01-15, you see:
Adjusted price: $100
This reflects a 2-for-1 split on 2020-06-01
The trap: If your strategy on 2020-01-15 uses "100"incalculationsexpectingittomean"shareprice,"you′reimplicitlyusingpost−splitinformation.The∗∗unadjusted∗∗pricewas200.
Correct usage: Always use adjusted prices for returns, unadjusted for absolute price levels (like "buy stocks under $10").
| Action | Effect | Adjustment |
|-----|------------|
| Split n:1 | Shares multiply by n | Divide all prior prices by n |
| Dividend D | Cash paid out | Subtract D from prior prices |
| Merger | Ticker changes | Link histories with correct ratio |
| Spinoff | New entity created | Split parent value proportionally |
Derivation of dividend adjustment:
Day before dividend: stock worth P, includes D cash value.
P=Pbusiness+D
Day after (ex-dividend): cash is gone, business remains:
Pex=PbusinessP−D
The price "drops" by D, but shareholder value is preserved (stock + cash = constant). Adjusted series must show no drop:
Imagine you're testing whether your new skateboard trick works by watching videos of only the kids who succeeded and made it to the X Games. All the videos of kids who tried and failed aren't in your collection because they gave up skating. If you learn the trick based only on success videos, you'll think it's way easier than it really is—you never saw the broken arms and quit attempts.
Clean historical data is like getting videos of everyone who tried the trick, including the failures. In stock backtesting:
Dirty data = only companies that survived (the X Games winners)
Clean data = all companies including the bankruptcies (everyone who tried)
Also, some videos are edited after the fact—maybe they cut out the part where the kid fell first. That's look-ahead bias: the video shows info that wasn't obvious when it was filmed. Clean data means seeing everything exactly as it happened, with no edited-in future knowledge.
5.3.01-Learn-about-the-efficient-market-hypothesis – Point-in-time data tests true EMH
6.4.01-Identify-overfitting-in-strategy-parameters – Dirty data creates false parameter optima
#flashcards/stock-market
What is survivorship bias in historical data? :: When your dataset contains only securities that survived to the present, excluding delisted/bankrupt companies, creating an upward-biased performance record because failures are invisible.
Why does survivorship bias inflate backtest returns?
Because it removes all the losing trades from bankruptcies/delistings (typically -80% to -100% losses), leaving only the winners. With ~6% annual delistings and losers at -80%, this adds ~5.5% fake annual return.
What is look-ahead bias?
Using information a backtest that wasn't available at the historical decision time—like restated financials, future index memberships, or adjusted prices used incorrectly for price-level rules.
How should you use adjusted vs. unadjusted prices?
Use adjusted prices for return calculations (they account for splits/dividends), but unadjusted prices for absolute price rules (like "buy stocks under $10") to avoid look-ahead bias from future corporate actions.
What is point-in-time data?
Historical data that reflects information exactly as it was known on a specific date, not as restated later—critical for fundamentals which are often revised years after initial filing.
Why does missing data forward-fill create bias?
A missing price might mean the stock was halted or illiquid—you couldn't have traded there. Forward-filling assumes you exited at a price that didn't exist, especially dangerous during crises when quotes vanish for days.
What four checks validate OHLC data integrity?
1) Low≤ Open and Close ≤ High, 2) High ≥ Low, 3) Price changes must have volume > 0, 4) No duplicate timestamps. Violations indicate corrupted data.
How do you adjust prices backward for a dividend?
Multiply all prior prices by (P - D)/P where P is the price before dividend and D is the dividend amount, preserving the proportional return while removing the cash drop.
What's the difference between Tier 1 and Tier 2 data sources?
Tier 1 (Bloomberg, Refinitiv) are 20k+/yearprofessionalterminalswithfullpoint−in−timeanddelistingcoverage.Tier2(Norgate,Sharadar)are300-800/year backtest-focused vendors with survivorship-free data but less asset class coverage.
Why must corporate action adjustments be applied in reverse chronological order?
Because each adjustment factor depends on the post-action price. Starting from today and working backward, you multiply by each factor (splits, dividends) to reconstruct what historical prices "should be" in today's share structure.
Clean historical data sourcing matlab hai ke apke backtest ke results reliable aur realistic ho. Jab aap purana stock data download karte ho free sources se jaise Yahoo Finance, toh usme bohot sari hidden problems hotiain. Sabse badi problem hai survivorship bias—iska matlab ke aapke dataset mein sirf woh companies hain jo aj bhi zinda hain, joh bankrupt hui ya delist hui woh gayab ho gayi. Toh aapka backtest dikhata hai sirf winners ka data, aur har saal ke 6-8% losers ko ignore kar deta hai. Result? Aapko lagta hai strategy 40% return de rahi hai, lekin reality mein woh 10% bhi nahi degi kyunki aapne sare failures ko count hi nahi kiya.
Dusri badi problem hai corporate actions jaise stock splits aur dividends. Jab Apple ne 7-for-1 split kiya 2014 mein, toh agar aapka data properly adjusted nahi hai, toh chart pe dikhega ki pricek din mein 85% crash ho gayi—lekin woh crash thi hi nahi, bas shares multiply ho gaye. Adjusted prices use karne ka sahi tarika hai returns calculate karne ke liye, lekin agar aap "buy stocks under $10" jaisa rule laga rahe ho toh unadjusted price use karna padega, warna future ka information already apke backtest mein aa jayega (look-ahead bias).
Professional traders Bloomberg ya Refinitiv jaise expensive sources use karte hain (24,000/year)kyunkiwohpoint−in−timedatadetehain—matlabexactlywohinformationjousdinavailablethi,badmeinrevisekigayinahi.IndividualtraderskeliyeNorgateDatayaSharadarjaiseaffordableoptionshain(300-800/year) jo survivorship-free data aur accurate corporate actions provide karte hain.Agar aap free data use kar rahe ho, toh manually validate karna padega—delisted stocks ki list alag se download karo, OHLC integrity check karo (Low <= Open, Close <= High), aur har bade corporate action ko verify karo company ke investor relations website se.
Bottom line: Dirty data pe backtest karna matlab apne ap ko fool karna. Thoda paisa lagao quality data pe, ya fir free data ko thoroughly clean karo, warna apki strategy real trading mein fail hogi aur aapko samajh nahi ayega kyun.