Create a deterministic price series
Start with synthetic data so everyone gets the same result and there are no API keys, missing dates, corporate actions, or data-vendor assumptions.
import pandas as pd
prices = pd.Series(
[100, 101, 99, 103, 105, 102, 106, 109],
index=pd.date_range("2026-01-01", periods=8, freq="D"),
name="close",
)
returns = prices.pct_change().fillna(0.0)Checkpoint
- • The series contains eight ordered timestamps.
- • The first return is zero and later returns use adjacent closes.