Skip to content

Vendor Setup

This document explains how to configure Yahoo Finance and Alpha Vantage as market data sources for CRITERION.


  • Cost: Free
  • API Key: Not required
  • Rate Limits: CRITERION enforces approximately 48 requests per hour by default (configurable).

Configuration example (YAML):

data_source:
source_type: yahoo
source_params:
requests_per_hour: 48 # optional, default 48

Notes:

  • Data is split-adjusted and dividend-adjusted.
  • Historical data only; suitable for daily backtesting.
  • No API key or registration required.

  • Cost: Free tier available
  • API Key: Required
  • Rate Limits: Free tier: 5 calls per minute, 500 calls per day (CRITERION defaults match these).

Setup:

  1. Register at Alpha Vantage and obtain an API key.
  2. Prefer storing the key in an environment variable and passing it via config (e.g. from env) rather than hardcoding.

Configuration example (YAML):

data_source:
source_type: alphavantage
source_params:
api_key: ${ALPHAVANTAGE_API_KEY} # required
requests_per_minute: 5 # optional, default 5
requests_per_day: 500 # optional, default 500

Notes:

  • Data is split-adjusted only (no dividend adjustment in daily series).
  • Daily data; suitable for daily backtesting.

CRITERION strictly enforces rate limits. Rate limiting is preemptive: the limit is checked before each network request. If the limit would be exceeded, a DataSourceError is raised and no request is made. There are no automatic retries on rate limit errors.

  • Plan backtests and data usage to stay within limits.
  • Use the cache (Stage 16.2) to avoid repeated requests for the same data.

IssueSuggestions
Rate limit exceededWait for the sliding window to reset; reduce request rate; use cache.
SOURCE_UNREACHABLECheck network connectivity; verify the service is up; for Alpha Vantage, verify API key.
MISSING_DATAVerify the symbol is valid; check the date range; note that some symbols have limited history.