Level 1 · 90–100 h

Financial data, markets and analysis

How the market works on the inside and how its data is obtained, cleaned and stored without bias: from orders and costs to a personal data lake.

Fig. — Survivorship bias: the same index with and without the companies that disappeared (schematic)
02/08
Prerequisite
Basic Python, high-school statistics
Profile
Programmer without finance, or trader with some Python

How markets work

  • 1.1.1 Participants: retail, institutional, market makers, HFT, brokers, clearing houses; exchanges, MTFs, dark pools, OTC.
  • 1.1.2 Sessions, auctions, holidays and calendars (exchange_calendars, pandas_market_calendars).
  • 1.1.3 Order book: bid/ask, spread, depth, L1, L2 and L3 levels.
  • 1.1.4 Order types: market, limit, stop, stop-limit, trailing, MOC/LOC, IOC/FOK, iceberg, bracket/OCO.
  • 1.1.5 Costs (commissions, spread, impact, slippage, financing); settlement (T+1 in the US, T+2 in Europe), leverage and margin.

Asset classes

  • 1.2.1 Equities: capital increases, splits, dividends, corporate actions, indices.
  • 1.2.2 ETFs: physical or synthetic replication, creation and redemption, tracking error, leveraged and inverse, UCITS versus US (PRIIPs/KID).
  • 1.2.3 Futures: specifications (multiplier, tick, expiries), margin, mark-to-market, roll, contango and backwardation.
  • 1.2.4 Forex: pairs, pips, lots, spot versus forwards and FX futures, swaps and rollover, CFDs and ESMA limits.
  • 1.2.5 Options: calls and puts, premium, intrinsic and extrinsic value, American and European, chains.
  • 1.2.6 Crypto: spot, perpetuals, dated futures, funding rate, stablecoins, DEX and CEX, custody.
  • 1.2.7 Fixed income and rates (macro context and interest rate futures); CFDs and leveraged retail products in the EU.

Market data sources

  • 1.3.1 Types: EOD, intraday (bars), tick, quotes, L2/L3 book, reference data.
  • 1.3.2 Free or educational: yfinance (unofficial; rate limits), Stooq, FRED (macro), SEC EDGAR, Banco de España and ECB, CNMV.
  • 1.3.3 Retail and prosumer APIs: Massive (formerly Polygon.io; equities plans at 0,0, 29, 79and79 and 199 a month, with real time only on Advanced), Alpaca Data, Tiingo, EODHD, Alpha Vantage, Twelve Data, Financial Modeling Prep.
  • 1.3.4 Professional: Databento (CME since 2010, all US exchanges, OPRA; historical pay-per-use and real time by plan), Nasdaq Data Link, LSEG/Refinitiv, Bloomberg (background), ICE.
  • 1.3.5 Crypto: exchange APIs via ccxt, Kaiko, CoinGecko and CoinMarketCap, Glassnode and on-chain data.
  • 1.3.6 Brokers as a source: IBKR (ib_async), MetaTrader 5, OANDA.
  • 1.3.7 Licences, terms of use, redistribution, “professional” versus “non-professional” data.
  • 1.3.8 How to choose a provider: coverage, historical depth, survivorship-bias-free universes, corporate action adjustments, cost.

Financial data engineering

  • 1.4.1 Downloading via REST and websockets; pagination, rate limits, retries with backoff.
  • 1.4.2 Cleaning: missing values, outliers, bad ticks, duplicates, gaps; time zone alignment.
  • 1.4.3 Split and dividend adjustments; adjusted versus unadjusted prices.
  • 1.4.4 Survivorship-bias-free universes; delisted tickers; symbol changes (point-in-time).
  • 1.4.5 Bar construction: time, tick, volume, dollar, imbalance bars.
  • 1.4.6 Continuous futures series: back-adjusted, ratio-adjusted, by volume or open interest.
  • 1.4.7 Storage: CSV versus Parquet; partitioning; DuckDB; PostgreSQL and TimescaleDB; ArcticDB.
  • 1.4.8 A reproducible pipeline for download, validation and incremental update, with data quality tests.

Fundamental and macro data

  • 1.5.1 Financial statements, ratios, XBRL and SEC EDGAR; publication date versus period date, to avoid look-ahead.
  • 1.5.2 Macro data (FRED, ECB, INE), economic calendars, analyst estimates and transcripts (a bridge to NLP).

Financial exploratory analysis

  • 1.6.1 Returns, volatility (historical, EWMA), rolling correlations, drawdown and time under water.
  • 1.6.2 Stylised facts: fat tails, volatility clustering, weak autocorrelation, leverage effect.
  • 1.6.3 Seasonality: day of the week, month, turn of the month, intraday sessions.

Programmed technical analysis

  • 1.7.1 Moving averages (SMA, EMA, KAMA), MACD, RSI, stochastic, Bollinger, ATR, ADX, Donchian, Keltner; OBV, VWAP, volume profile.
  • 1.7.2 Own implementation versus TA-Lib or pandas-ta; validating results.
  • 1.7.3 Candlestick patterns and support and resistance: how to code them and why many are not robust.
  • 1.7.4 Multi-timeframe without look-ahead.

Research on this site to practise this level

Practice

  1. Python for Trading Course - Part 1: Market Data with OpenBBResearch-0014 · 10 min
  2. Limit Order Book - Aggregated Market LiquidityResearch-0008 · 11 min
  3. Big Data Management. 1 - Introduction to Big Data for Trading with ArcticDBResearch-0019 · 15 min
  4. Big Data Management 3 - Building a Datalake on the Nasdaq with ArcticDB.Research-0021 · 5 min
  5. Seasonality in Python. Searching for Intraday PatternsResearch-0024 · 9 min