Lesson 1Train/test split for time series: fixed holdout, rolling/walk-forward validation, expanding window — implementation details and code patternsLearn how to design time-aware train, validation, and test splits for equity series, adapted for local trading patterns. We compare fixed holdout, rolling, and expanding windows, and show implementation templates that avoid look-ahead and leakage to keep forecasts reliable.
Fixed chronological holdout designRolling window backtest workflowExpanding window evaluation schemeAvoiding look-ahead and leakageCode patterns for time series splitsLesson 2Time zones, market holidays, early closes, and how to align trading daysMaster practical handling of time zones, sessions, and trading calendars, considering Gambian business days. We cover mapping exchange times to UTC, dealing with holidays and early closes, and aligning bars across assets and benchmarks for smooth operations.
Exchange time vs UTC alignmentHoliday and weekend calendarsEarly close and half-day handlingSynchronizing multi-asset seriesDaylight saving time edge casesLesson 3Selecting sample period and lookback length to balance stationarity and regime coverage (3+ years considerations)Choose sample periods and lookback windows that balance stationarity with regime diversity, tailored to African market dynamics. We discuss minimum history, rolling windows over 3+ years, and avoiding peeking into future regimes to maintain forecast integrity.
Defining in-sample and out-of-sampleMinimum history for featuresRolling vs expanding lookbacksRegime shifts and structural breaksStability checks over 3+ yearsLesson 4Public data sources and APIs: Yahoo Finance, Stooq, IEX, Quandl, Alpha Vantage — endpoints, rate limits, and metadataSurvey major public equity data APIs and their constraints, accessible from Gambia. You will learn typical endpoints, symbol formats, rate limits, and metadata quirks, plus patterns for robust downloading, retries, and caching to handle internet variability.
Yahoo Finance and Stooq usageIEX Cloud and Alpha Vantage APIsQuandl and other premium sourcesRate limits, retries, and backoffMetadata, symbols, and survivorshipLesson 5Resampling intraday vs daily series: pitfalls when using daily OHLCV for short horizonsUnderstand how resampling intraday data to daily bars affects short-horizon forecasts in emerging markets. We examine OHLCV aggregation rules, microstructure noise, and how daily bars can hide gaps, jumps, and execution constraints common in less liquid markets.
Intraday to daily aggregation rulesVolume and VWAP based resamplingImpact on volatility and gapsMicrostructure noise and bid-ask bounceChoosing bar size for horizonLesson 6Outlier detection and correction: price spikes, zero volume days, bad ticksLearn to detect and correct outliers such as price spikes, zero-volume days, and bad ticks, vital for volatile African exchanges. We cover rule-based and statistical filters, and how aggressive cleaning can distort true risk and returns if not done carefully.
Identifying obvious bad ticksZero volume and stale price checksRange and z-score based filtersCross-checking with reference feedsDocumenting and logging editsLesson 7Required raw fields: open, high, low, close, adjusted close, volume, corporate actions; handling splits/dividendsReview the essential raw fields for equity forecasting and how corporate actions alter them, relevant to Gambian companies. You will learn to use adjusted prices, reconcile volume and splits, and build consistent total-return series for modeling local stocks.
Required OHLCV and adjusted closeSplit and reverse split handlingDividend and distribution adjustmentsBuilding total-return price seriesValidating vendor adjustment qualityLesson 8Choosing liquid US equities and justification for horizon selection (1, 5, 10-day)Define a liquid US equity universe suitable for short-horizon forecasts, with insights for Gambian traders. We set liquidity and price filters, discuss survivorship bias, and justify common horizons such as 1, 5, and 10 trading days for practical use.
Liquidity and price screening rulesAverage daily dollar volume filtersHandling delistings and mergersRationale for 1, 5, 10-day horizonsTurnover and transaction cost impactLesson 9Missing data strategies: forward/backward fill, interpolation, removal rules and their implications for model biasExplore methods for handling missing prices and volumes in equity data, common in regional feeds. We compare forward and backward fill, interpolation, and row removal, highlighting how each choice can bias returns and volatility estimates in forecasts.
Diagnosing missingness patternsForward and backward fill rulesInterpolation for prices and volumeRow deletion and survivorship biasImpact on returns and volatilityLesson 10Constructing index and benchmark series (SPY, QQQ): synchronization and corporate-close alignmentLearn to construct and align benchmark index series such as SPY or QQQ, adaptable to local indices. We discuss data sources, dividend adjustments, and how to synchronize benchmark closes with your equity universe for fair comparison in trading.
Selecting benchmark ETFs and indicesPrice vs total-return benchmarksAligning benchmark and stock calendarsHandling benchmark corporate actionsUsing benchmarks in model evaluation