Python for Market Data, lesson 9
Plotting to think
The few charts that catch most data problems.
You can build a backtest from a table of prices.
Part 1. Find what's wrong
A year of daily prices for one simulated stock, with four problems hidden in it, planted the way they turn up in real files. Pick a chart and tap where something's wrong.
None of the four made pandas complain. Every number was a valid price and every date a real date. You found them because a picture shows shapes a column of numbers hides: a cliff, a spike, a flat stretch, a gap.
Stock split
When a company splits its shares, say 4 for 1, every share becomes four and the price per share drops to a quarter. Nothing of value changed. Data vendors provide split-adjusted prices that scale the history to match; research uses those, or the returns show a crash that never happened.
Your turn
A stock's return is +900% one day and −90% the next, and the price ends up back where it was. Most likely:
Part 2. Checks you can print
Keep going with Pro
You've done the first part. Pro opens the rest of this lesson, and every other one.
- Checks you can print
- The charts, in code
- The same thing, for real
Python for Market Data overviewSpotted a mistake? Tell us.