Data Methodology

Last updated: May 2026 · Version 1.0

AfriTerminal is a data aggregation and display platform, not a regulated financial services provider. Nothing on this platform constitutes investment advice. This document is provided for transparency and auditability purposes.

1. Overview

AfriTerminal aggregates publicly available financial data from multiple sources and presents it in a unified interface for African capital markets professionals. All data is sourced from official exchange feeds, government publications, and reputable public APIs. No proprietary or licensed data is used without permission.

Data is retrieved by automated Python scrapers running as GitHub Actions workflows. Outputs are committed as static JSON and CSV files served via GitHub Pages. There is no real-time streaming infrastructure — all data represents end-of-day or intra-day snapshots with the delays noted in the table below.

2. Data Sources

Data type Source Refresh Delay Limitation
NGX equity prices NGX Group (doclib.ngxgroup.com) Up to 16× per weekday ~30 min Daily change% only; no intraday tick data
NGX corporate filings NGX Group SharePoint API Daily 09:30 WAT Same-day AI summary may misinterpret; always verify the original PDF
FX rates open.er-api.com Daily End-of-day Reference rate only; not interbank or CBN official rate
Macro indicators IMF World Economic Outlook, CBN, NBS Monthly / quarterly 1–7 days post-publication Revisions not auto-captured; historical data may lag
Sovereign bond yields DMO Nigeria, World Government Bonds, public sources Daily Same-day Indicative yields; not tradeable quotes
Global equity indices Yahoo Finance (scraper) Daily ~15 min Subject to Yahoo Finance terms of service; not real-time
NGX market flows NGX Group monthly investor activity report Monthly ~30 days post-period Aggregated totals only; not security-specific
BRVM / GSE / NSE / EGX Official exchange websites (public feeds) Daily End-of-day Partial coverage; fewer stocks than NGX
AfriTerminal Sector Indices Computed from NGX prices (sector_indices.py) and Yahoo Finance (global_indices.py) Daily post-market Same-day Phase 1A: equal-weighted. Free-float adjustment deferred to Phase 2A post-NGX data partnership

3. AI Market Intelligence

AI-generated narratives are produced by Claude Haiku (Anthropic) running in GitHub Actions daily at approximately 16:30 WAT. The model is given a structured prompt containing only data drawn from the files listed in Section 2 — it is explicitly prohibited from inventing figures, extrapolating from training data, or making buy/sell/hold recommendations.

Hard rules enforced in every generation: no invented figures; no buy/sell/hold signals; every number must trace to a named data file; disclaimer on every output. These rules are enforced at the prompt level.

Each narrative includes a data_sources field listing which files the model cited. Where available, an invalidation_condition field describes what specific data or event would change the narrative's conclusion.

AI outputs are refreshed on weekdays only. The timestamp shown on the INTELLIGENCE tab reflects the actual generation time. If a generation run fails, the previous day's output is shown with its age clearly labelled.

4. Anomaly Detection

The ⚡ anomaly flag on stock rows identifies statistically unusual price moves. The method is a rolling z-score:

  • Compute daily % changes from the last 30 trading days of price history.
  • Calculate mean and standard deviation of those changes.
  • Compute z-score for today's move: z = (today_change − mean) / std.
  • Flag as anomaly if |z| > 2 AND |today_change| > 2%.
  • Stocks with standard deviation < 0.3% (illiquid — price barely moves) are excluded from z-score scoring.

The z-score, mean, and standard deviation are surfaced on the per-stock anomaly card inside the dashboard. This flag does not imply directional prediction — it indicates the move is statistically unusual relative to recent history. Minimum 11 days of price history required before any stock can receive a flag.

5. Market Context Signals

The Bayesian Context card shown on individual stock detail views is computed by bayesian_signals.py. The method uses a Naive Bayes composite score:

  • Base rate: fraction of the last 30 trading days that were positive for this stock (Laplace-smoothed).
  • Filing factor: multiplier if a recent filing (last 7 days) is present (1.1–1.4 depending on type).
  • FX factor: Pearson correlation of NGN/USD daily changes vs stock daily changes, scaled by today's NGN move.
  • Global factor: same method using S&P 500 daily changes.
  • Breadth factor: advance/decline ratio over last 5 days (1.05 if bullish, 0.97 if bearish).

Composite score = base_rate × filing × FX × global × breadth × 100. Scores above 50 reflect more historical up-days than down-days; below 50, the reverse.

A Benjamini-Hochberg FDR correction at q=0.10 is applied across all scored stocks to identify which scores are statistically distinguishable from noise. Stocks not meeting the FDR threshold are labelled "Not FDR-significant."

The signals system requires a minimum of 30 days of NGX price history per stock to produce meaningful output. During the accumulation period (before July 2026), confidence is labelled LOW and scores should be treated as early estimates only. Not investment advice.

6. AfriTerminal Sector Indices

AfriTerminal publishes two families of proprietary sector indices, Phase 1A (launched May 2026):

  • NGX Sector Indices (ATBI-NG, ATCI-NG, ATOI-NG, ATTI-NG, ATCGI-NG, ATII-NG, ATAGI-NG): 7 equal-weighted sector indices across NGX-listed equities. Base level: 1,000 on launch date.
  • Global Sector Benchmarks (ATGBI, ATGMI, ATGEI, ATGTI, ATGCI, ATGII, ATGAI): 7 market-cap weighted indices tracking the same sectors' largest global companies via Yahoo Finance.

Index level formula: Level(t) = Level(t−1) × Σ(weight_i × Price_i(t) / Price_i(t−1)). Weight constraints: maximum 35% per single constituent; minimum 2%; top-3 combined maximum 65%. Applied iteratively (up to 10 passes).

Phase 1A uses equal weighting for NGX indices because reliable free-float adjusted market capitalisation data is not yet available via the public NGX feed. Market-cap weighting with free-float adjustment is planned for Phase 2A, subject to an NGX data partnership.

7. Data Retention

  • NGX price history: rolling 1,095 days (3 years)
  • FX history: rolling 90 days
  • Sector index history: rolling 1,095 days
  • Market intelligence outputs: current run only (no archive)

8. Limitations

  • Coverage: Nigeria (NGX), Ghana (GSE), Kenya (NSE), South Africa (JSE), Egypt (EGX), BRVM West Africa. Other African markets are not yet covered.
  • NGX price history is accumulating daily from May 2026. Features requiring 30+ days of history (Bayesian signals, full z-score coverage) activate progressively.
  • No real-time data. All prices are delayed by at least 15–30 minutes. Do not use for intraday trading decisions.
  • AI narratives may contain errors. Always verify figures against primary sources before acting on them.
  • Yahoo Finance data is subject to Yahoo's terms of service. AfriTerminal uses it via server-side scrapers only, not from browser requests.

Contact

For methodology questions, data corrections, or institutional access enquiries:

info@afriterminal.com