Skip to content

"Vibe-Trading: Your Personal Trading Agent"

docs(readme): correct the Data Sources section and guard what drifted

Haozhe Wua44ed6e807e6
diff --git a/README.md b/README.md
index 45cc0093e..5a7cf9116 100644
--- a/README.md
+++ b/README.md
@@ -433,7 +433,7 @@ the wall-clock activity watchdog.
## 📡 Data Sources & Smart Fallback
-One `get_market_data` call, **23 free market-data sources** (plus the optional **QVeris** premium marketplace). Set `source: "auto"` — the loader picks by symbol, then walks a per-market chain ordered by **IP-ban risk**: never-banned public sources first, throttled / key-gated ones last. Zero config, no single point of failure.
+One `get_market_data` call, **27 market-data sources**, one of them the optional **QVeris** premium marketplace. Set `source: "auto"` — the loader picks by symbol, then walks a per-market chain ordered by **IP-ban risk**: never-banned public sources first, throttled / key-gated ones last. Zero config, no single point of failure.
| Source | Markets | Auth | Role |
|--------|---------|------|------|
@@ -447,6 +447,7 @@ One `get_market_data` call, **23 free market-data sources** (plus the optional *
| `longbridge` | US / HK | App Key + App Secret + Access Token | optional historical OHLCV source; install the optional SDK |
| `finnhub` · `alphavantage` · `tiingo` · `fmp` | US | key | optional providers |
| `qveris` | global multi-asset | key · credits | **premium marketplace** — 63+ providers via one key (explicit-only, never in auto fallback) |
+| `nobitex` · `wallex` | crypto (Iranian Toman pairs) | none | public UDF endpoints; **explicit-only** — the only Toman-quoted sources, so they never join the crypto chain where a USD-quoted series could stand in for one |
| `okx` · `ccxt` · `binance` | crypto | none | OKX + 100+ exchanges + Binance historical / USD-M perps |
| `futu` | HK / A | OpenD | optional local FutuOpenD |
| `mt5` | forex / metals | MT5 terminal | MetaTrader 5 (Exness-style) forex / metal bars, 1m–1D |
@@ -1865,7 +1866,7 @@ Vibe-Trading/
│ │ └── providers/ # LLM provider abstraction
│ │
│ └── backtest/ # Backtest engines
-│ ├── engines/ # 8 engines + composite cross-market engine + options_portfolio
+│ ├── engines/ # 9 engines + composite cross-market engine + options_portfolio
│ ├── loaders/ # 27 sources: tushare, okx, nobitex, wallex, binance, yfinance, akshare, baostock, tencent, mootdx, ccxt, futu, pykrx, local, eastmoney, sina, stooq, yahoo, finnhub, alphavantage, tiingo, fmp, longbridge, mt5, qveris, india_broker, tickerall
│ │ ├── base.py # DataLoader Protocol
│ │ └── registry.py # Registry + auto-fallback chains
diff --git a/README_ar.md b/README_ar.md
index 8917920f3..28d495e51 100644
--- a/README_ar.md
+++ b/README_ar.md
@@ -396,7 +396,7 @@ vibe-trading connector install /tmp/my-broker
## 📡 مصادر البيانات والتراجع الذكي
-استدعاء واحد لـ `get_market_data`، **23 مصدر بيانات سوقية مجانية** (إضافة إلى سوق مدفوع اختياري **QVeris**). اضبط `source: "auto"` — يختار المُحمّل حسب الرمز، ثم يسير عبر سلسلة لكل سوق مرتبة بحسب **خطر حظر عنوان IP**: المصادر العامة التي لا تُحظر أبداً أولاً، والمصادر المُقيّدة أو المحمية بمفتاح أخيراً. بلا أي إعداد، ولا نقطة فشل واحدة.
+استدعاء واحد لـ `get_market_data`، **27 مصدر بيانات سوقية**، أحدها سوق **QVeris** المدفوع الاختياري (إضافة إلى سوق مدفوع اختياري **QVeris**). اضبط `source: "auto"` — يختار المُحمّل حسب الرمز، ثم يسير عبر سلسلة لكل سوق مرتبة بحسب **خطر حظر عنوان IP**: المصادر العامة التي لا تُحظر أبداً أولاً، والمصادر المُقيّدة أو المحمية بمفتاح أخيراً. بلا أي إعداد، ولا نقطة فشل واحدة.
| Source | Markets | Auth | Role |
|--------|---------|------|------|
@@ -410,9 +410,11 @@ vibe-trading connector install /tmp/my-broker
| `longbridge` | US / HK | App Key + App Secret + Access Token | مصدر OHLCV تاريخي اختياري؛ ثبّت الـ SDK الاختياري |
| `finnhub` · `alphavantage` · `tiingo` · `fmp` | US | key | optional providers |
| `qveris` | أصول عالمية متعددة | key · credits | **سوق مدفوع** — 63+ مزوداً بمفتاح واحد (اختيار صريح فقط، خارج التراجع التلقائي) |
+| `nobitex` · `wallex` | العملات المشفّرة (أزواج بالتومان الإيراني) | لا شيء | نقاط نهاية UDF عامة، **بالاختيار الصريح فقط** — فهما المصدران الوحيدان المسعّران بالتومان، ولذلك لا ينضمان أبدًا إلى سلسلة العملات المشفّرة حيث قد تحل محلهما سلسلة مسعّرة بالدولار |
| `okx` · `ccxt` · `binance` | crypto | none | OKX + 100+ exchanges + Binance historical / USD-M perps |
| `futu` | HK / A | OpenD | optional local FutuOpenD |
| `mt5` | الفوركس / المعادن | طرفية MT5 | طرفية MetaTrader 5 محلية اختيارية (Windows) — تغذية وسيطك الفعلية كما هي، مع حلّ لواحق الرموز بأسلوب Exness تلقائياً |
+| `tickerall` | الفوركس / المعادن | مفتاح + حساب (للقراءة فقط) | تغذية MT5 لنفس الوسيط لكن **مستضافة** — دون طرفية محلية وعلى أي نظام تشغيل (بالاختيار الصريح فقط، ولا تدخل سلسلة auto أبدًا) |
| `pykrx` | كوريا (KRX: KOSPI/KOSDAQ) | لا شيء | أشرطة يومية لـ KOSPI / KOSDAQ لرموز `.KS` / `.KQ` (إضافة `krx` اختيارية) |
| `india_broker` | الهند (NSE/BSE) | تسجيل دخول الوسيط | قراءة فقط لأشرطة Zerodha / Shoonya / Dhan لرموز `.NS` / `.BO` (ذيل سلسلة التراجع) |
| `local` | any | none | your own CSV / Parquet / DuckDB via `local:` prefix |
@@ -1662,7 +1664,7 @@ Vibe-Trading/
│ │ └── providers/ # LLM provider abstraction
│ │
│ └── backtest/ # Backtest engines
-│ ├── engines/ # 8 engines + composite cross-market engine + options_portfolio
+│ ├── engines/ # 9 engines + composite cross-market engine + options_portfolio
│ ├── loaders/ # 27 sources: tushare, okx, nobitex, wallex, binance, yfinance, akshare, baostock, tencent, mootdx, ccxt, futu, pykrx, local, eastmoney, sina, stooq, yahoo, finnhub, alphavantage, tiingo, fmp, longbridge, mt5, qveris, india_broker, tickerall
│ │ ├── base.py # DataLoader Protocol
│ │ └── registry.py # Registry + auto-fallback chains
diff --git a/README_es.md b/README_es.md
index bb4909b57..ee562b598 100644
--- a/README_es.md
+++ b/README_es.md
@@ -395,7 +395,7 @@ La mayoría de las ejecuciones siguen la misma ruta de evidencia: enrutar la sol
## 📡 Fuentes de Datos y Fallback Inteligente
-Una sola llamada `get_market_data`, **23 fuentes de datos de mercado gratuitas** (además del mercado premium opcional **QVeris**). Establece `source: "auto"`: el cargador elige según el símbolo y luego recorre una cadena por mercado ordenada por **riesgo de bloqueo de IP**: primero las fuentes públicas que nunca se bloquean, al final las limitadas o que requieren clave. Cero configuración, sin punto único de fallo.
+Una sola llamada `get_market_data`, **27 fuentes de datos de mercado**, una de ellas el mercado premium opcional **QVeris** (además del mercado premium opcional **QVeris**). Establece `source: "auto"`: el cargador elige según el símbolo y luego recorre una cadena por mercado ordenada por **riesgo de bloqueo de IP**: primero las fuentes públicas que nunca se bloquean, al final las limitadas o que requieren clave. Cero configuración, sin punto único de fallo.
| Fuente | Mercados | Autenticación | Rol |
|--------|---------|------|------|
@@ -409,9 +409,11 @@ Una sola llamada `get_market_data`, **23 fuentes de datos de mercado gratuitas**
| `longbridge` | EE. UU. / HK | App Key + App Secret + Access Token | fuente OHLCV histórica opcional; instala el SDK opcional |
| `finnhub` · `alphavantage` · `tiingo` · `fmp` | EE. UU. | clave | proveedores opcionales |
| `qveris` | multiactivo global | clave · créditos | **mercado premium** — 63+ proveedores mediante una sola clave (solo explícito, nunca en el fallback automático) |
+| `nobitex` · `wallex` | cripto (pares cotizados en tomán iraní) | ninguna | endpoints UDF públicos, **solo por selección explícita**: son las únicas fuentes cotizadas en tomán, así que nunca entran en la cadena de cripto, donde una serie cotizada en USD podría suplantarlas |
| `okx` · `ccxt` · `binance` | cripto | ninguna | OKX + 100+ exchanges + históricos de Binance / perpetuos USD-M |
| `futu` | HK / A | OpenD | FutuOpenD local opcional |
| `mt5` | forex / metales | terminal MT5 | barras de forex/metales de MetaTrader 5 (estilo Exness), 1m–1D |
+| `tickerall` | forex / metales | clave + cuenta (solo lectura) | el mismo feed MT5 del bróker, **alojado**: sin terminal local y en cualquier sistema operativo (solo por selección explícita, nunca en el respaldo automático) |
| `pykrx` | Corea (KRX: KOSPI/KOSDAQ) | ninguna | barras diarias de KOSPI / KOSDAQ para `.KS` / `.KQ` (extra opcional `krx`) |
| `india_broker` | India (NSE/BSE) | login de broker | barras de solo lectura de Zerodha / Shoonya / Dhan para `.NS` / `.BO` (al final de la cadena de fallback) |
| `local` | cualquiera | ninguna | tu propio CSV / Parquet / DuckDB mediante el prefijo `local:` |
@@ -1750,7 +1752,7 @@ Vibe-Trading/
│ │ └── providers/ # Abstracción de proveedores LLM
│ │
│ └── backtest/ # Motores de backtest
-│ ├── engines/ # 8 motores + motor compuesto multi-mercado + options_portfolio
+│ ├── engines/ # 9 motores + motor compuesto multi-mercado + options_portfolio
│ ├── loaders/ # 27 fuentes: tushare, okx, nobitex, wallex, binance, yfinance, akshare, baostock, tencent, mootdx, ccxt, futu, pykrx, local, eastmoney, sina, stooq, yahoo, finnhub, alphavantage, tiingo, fmp, longbridge, mt5, qveris, india_broker, tickerall
│ │ ├── base.py # Protocolo DataLoader
│ │ └── registry.py # Registro + cadenas de fallback automáticas
diff --git a/README_ja.md b/README_ja.md
index 88b227621..fb6a9e816 100644
--- a/README_ja.md
+++ b/README_ja.md
@@ -396,7 +396,7 @@ vibe-trading connector install /tmp/my-broker
## 📡 データソースとスマートフォールバック
-1 回の `get_market_data` 呼び出しで **23 の無料マーケットデータソース**(およびオプションの有料マーケットプレイス **QVeris**)にアクセスできます。`source: "auto"` を指定すれば、loader が銘柄に応じてソースを選び、**IP 規制リスク**の順に並んだ市場別チェーンをたどります。規制を受けない公開ソースを先に、スロットリングや key を要するソースを最後に試します。設定不要、単一障害点なし。
+1 回の `get_market_data` 呼び出しで **27 のマーケットデータソース**(うち **QVeris** はオプションの有料マーケットプレイス)にアクセスできます。`source: "auto"` を指定すれば、loader が銘柄に応じてソースを選び、**IP 規制リスク**の順に並んだ市場別チェーンをたどります。規制を受けない公開ソースを先に、スロットリングや key を要するソースを最後に試します。設定不要、単一障害点なし。
| Source | Markets | Auth | Role |
|--------|---------|------|------|
@@ -410,9 +410,11 @@ vibe-trading connector install /tmp/my-broker
| `longbridge` | US / HK | App Key + App Secret + Access Token | optional historical OHLCV source; install the optional SDK |
| `finnhub` · `alphavantage` · `tiingo` · `fmp` | US | key | optional providers |
| `qveris` | グローバル・マルチアセット | key · credits | **プレミアムマーケットプレイス** — 1つの key で 63+ providers(明示指定のみ、auto フォールバック対象外) |
+| `nobitex` · `wallex` | 暗号資産(イラン・トマン建てペア) | なし | 公開 UDF エンドポイント。**明示指定のみ** — トマン建ての唯一の供給元であり、USD 建て系列が代役になりうる crypto チェーンには決して加わりません |
| `okx` · `ccxt` · `binance` | crypto | none | OKX + 100+ exchanges + Binance historical / USD-M perps |
| `futu` | HK / A | OpenD | optional local FutuOpenD |
| `mt5` | forex / metals | MT5 terminal | MetaTrader 5 (Exness-style) forex / metal bars, 1m–1D |
+| `tickerall` | forex / metals | key + アカウント(読み取り専用) | 同じブローカーの MT5 フィードを**ホスト型**で — ローカル端末不要、OS を問わない(明示指定のみ、auto フォールバックには決して入らない) |
| `pykrx` | 韓国(KRX:KOSPI/KOSDAQ) | 不要 | `.KS` / `.KQ` の KOSPI / KOSDAQ 日足(任意の `krx` extra) |
| `india_broker` | インド(NSE/BSE) | ブローカーログイン | `.NS` / `.BO` 向けの読み取り専用 Zerodha / Shoonya / Dhan bars(フォールバックチェーン末尾) |
| `local` | any | none | your own CSV / Parquet / DuckDB via `local:` prefix |
@@ -1670,7 +1672,7 @@ Vibe-Trading/
│ │ └── providers/ # LLM プロバイダー抽象化
│ │
│ └── backtest/ # バックテストエンジン
-│ ├── engines/ # 8 エンジン + クロスマーケット composite engine + options_portfolio
+│ ├── engines/ # 9 エンジン + クロスマーケット composite engine + options_portfolio
│ ├── loaders/ # 27 ソース: tushare、okx、nobitex、wallex、binance、yfinance、akshare、baostock、tencent、mootdx、ccxt、futu、pykrx、local、eastmoney、sina、stooq、yahoo、finnhub、alphavantage、tiingo、fmp、longbridge、mt5、qveris、india_broker、tickerall
│ │ ├── base.py # DataLoader Protocol
│ │ └── registry.py # Registry + 自動フォールバックチェーン
diff --git a/README_ko.md b/README_ko.md
index cc6062692..9a7f6d2e5 100644
--- a/README_ko.md
+++ b/README_ko.md
@@ -396,7 +396,7 @@ vibe-trading connector install /tmp/my-broker
## 📡 데이터 소스 & 스마트 폴백
-`get_market_data` 한 번의 호출, **23개 무료 시장 데이터 소스**(선택형 유료 마켓플레이스 **QVeris** 별도). `source: "auto"`로 설정하면 로더가 심볼에 따라 소스를 고르고, 시장별 체인을 **IP 차단 위험** 순으로 따라갑니다: 절대 차단되지 않는 공개 소스를 먼저, 속도 제한 / 키 기반 소스를 마지막에 둡니다. 설정 불필요, 단일 장애 지점 없음.
+`get_market_data` 한 번의 호출, **27개 시장 데이터 소스**(그중 **QVeris**는 선택형 유료 마켓플레이스). `source: "auto"`로 설정하면 로더가 심볼에 따라 소스를 고르고, 시장별 체인을 **IP 차단 위험** 순으로 따라갑니다: 절대 차단되지 않는 공개 소스를 먼저, 속도 제한 / 키 기반 소스를 마지막에 둡니다. 설정 불필요, 단일 장애 지점 없음.
| Source | Markets | Auth | Role |
|--------|---------|------|------|
@@ -410,9 +410,11 @@ vibe-trading connector install /tmp/my-broker
| `longbridge` | US / HK | App Key + App Secret + Access Token | optional historical OHLCV source; install the optional SDK |
| `finnhub` · `alphavantage` · `tiingo` · `fmp` | US | key | optional providers |
| `qveris` | 글로벌 멀티에셋 | key · credits | **프리미엄 마켓플레이스** — key 하나로 63+ providers (명시 지정 전용, auto 폴백 제외) |
+| `nobitex` · `wallex` | 크립토(이란 토만 표시 페어) | 없음 | 공개 UDF 엔드포인트, **명시 지정 전용** — 토만 표시 소스는 이 둘뿐이라, USD 표시 시세가 대신 들어올 수 있는 crypto 체인에는 절대 합류하지 않습니다 |
| `okx` · `ccxt` · `binance` | crypto | none | OKX + 100+ exchanges + Binance historical / USD-M perps |
| `futu` | HK / A | OpenD | optional local FutuOpenD |
| `mt5` | forex / metals | MT5 terminal | MetaTrader 5 (Exness-style) forex / metal bars, 1m–1D |
+| `tickerall` | forex / metals | key + 계정(읽기 전용) | 동일 브로커의 MT5 피드를 **호스팅형**으로 — 로컬 터미널 불필요, OS 무관(명시 지정 전용, auto 폴백에는 절대 들어가지 않음) |
| `pykrx` | 한국 (KRX: KOSPI/KOSDAQ) | 없음 | `.KS` / `.KQ`용 KOSPI / KOSDAQ 일봉 (선택적 `krx` extra) |
| `india_broker` | 인도 (NSE/BSE) | 브로커 로그인 | `.NS` / `.BO`용 읽기 전용 Zerodha / Shoonya / Dhan 봉 (폴백 체인 말단) |
| `local` | any | none | your own CSV / Parquet / DuckDB via `local:` prefix |
@@ -1667,7 +1669,7 @@ Vibe-Trading/
│ │ └── providers/ # LLM provider abstraction
│ │
│ └── backtest/ # Backtest engines
-│ ├── engines/ # 8 engines + composite cross-market engine + options_portfolio
+│ ├── engines/ # 9 engines + composite cross-market engine + options_portfolio
│ ├── loaders/ # 27 sources: tushare, okx, nobitex, wallex, binance, yfinance, akshare, baostock, tencent, mootdx, ccxt, futu, pykrx, local, eastmoney, sina, stooq, yahoo, finnhub, alphavantage, tiingo, fmp, longbridge, mt5, qveris, india_broker, tickerall
│ │ ├── base.py # DataLoader Protocol
│ │ └── registry.py # Registry + auto-fallback chains
diff --git a/README_zh.md b/README_zh.md
index 539282174..5e03ceda3 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -411,7 +411,7 @@ vibe-trading connector install /tmp/my-broker
## 📡 数据源与智能 Fallback
-一次 `get_market_data` 调用,**23 个免费行情数据源**(另有可选付费市场 **QVeris**)。设 `source: "auto"`——loader 按符号自动选源,再沿按 **被封 IP 风险** 排序的同市场链向下走(永不封的公开源在前,限速 / 需 key 的在后)。零配置,无单点故障。
+一次 `get_market_data` 调用,**27 个行情数据源**(其中 **QVeris** 是可选的付费市场)。设 `source: "auto"`——loader 按符号自动选源,再沿按 **被封 IP 风险** 排序的同市场链向下走(永不封的公开源在前,限速 / 需 key 的在后)。零配置,无单点故障。
| Source | Markets | Auth | Role |
|--------|---------|------|------|
@@ -425,9 +425,11 @@ vibe-trading connector install /tmp/my-broker
| `longbridge` | 美股 / 港股 | App Key + App Secret + Access Token | 可选历史 OHLCV 数据源;需安装可选 SDK |
| `finnhub` · `alphavantage` · `tiingo` · `fmp` | US | key | optional providers |
| `qveris` | 全球多资产 | key · credits | **付费市场** — 一把 key 通 63+ 家(仅显式选用,绝不进 auto 链) |
+| `nobitex` · `wallex` | 加密(伊朗托曼计价对) | 无 | 公开 UDF 端点;**仅显式选用** —— 它们是唯二以托曼计价的源,绝不进 crypto 链,以免用 USDT 计价的序列冒名顶替 |
| `okx` · `ccxt` · `binance` | crypto | none | OKX + 100+ exchanges + Binance 历史 / USD-M 永续 |
| `futu` | HK / A | OpenD | optional local FutuOpenD |
| `mt5` | 外汇 / 贵金属 | MT5 终端 | MetaTrader 5(Exness 风格)外汇 / 贵金属行情,1m–1D |
+| `tickerall` | 外汇 / 贵金属 | key + 账户(只读) | 同一家券商的 MT5 数据源,**托管** —— 无需本地终端,任意操作系统(仅显式选用,绝不进 auto 链) |
| `pykrx` | 韩国(KRX:KOSPI/KOSDAQ) | 无 | `.KS` / `.KQ` 的 KOSPI / KOSDAQ 日线(可选 `krx` extra) |
| `india_broker` | 印度(NSE/BSE) | 券商登录 | 只读 Zerodha / Shoonya / Dhan bars,服务 `.NS` / `.BO`(fallback 链尾) |
| `local` | any | none | your own CSV / Parquet / DuckDB via `local:` prefix |
@@ -1665,7 +1667,7 @@ Vibe-Trading/
│ │ └── providers/ # LLM provider 抽象层
│ │
│ └── backtest/ # 回测引擎
-│ ├── engines/ # 8 个引擎 + 跨市场 composite 引擎 + options_portfolio
+│ ├── engines/ # 9 个引擎 + 跨市场 composite 引擎 + options_portfolio
│ ├── loaders/ # 27 个数据源:tushare、okx、nobitex、wallex、binance、yfinance、akshare、baostock、tencent、mootdx、ccxt、futu、pykrx、local、eastmoney、sina、stooq、yahoo、finnhub、alphavantage、tiingo、fmp、longbridge、mt5、qveris、india_broker、tickerall
│ │ ├── base.py # DataLoader Protocol
│ │ └── registry.py # Registry + 自动 fallback 链路
diff --git a/agent/tests/test_readme_counts.py b/agent/tests/test_readme_counts.py
index 3f056b5e5..277392d07 100644
--- a/agent/tests/test_readme_counts.py
+++ b/agent/tests/test_readme_counts.py
@@ -597,3 +597,82 @@ def test_readme_loader_tree_line_matches_the_registry(readme: str) -> None:
f"{readme}: tree line says {match.group('count')} sources, "
f"the registry has {len(registered)}"
)
+
+# ---------------------------------------------------------------------------
+# The Data Sources section and the engines tree line
+#
+# `test_readme_loader_tree_line_matches_the_registry` guarded the loaders line
+# of the repo tree, and only that line. The prose two hundred lines above it
+# and the table directly beneath were left unguarded, so they drifted exactly
+# as far as nothing was checking: the intro claimed "23 free market-data
+# sources" against a registry of 27, contradicting the tree line in the same
+# file, and `nobitex` / `wallex` never reached the table at all. The engines
+# tree line said 8 where the code shipped 9 plus the composite, while the
+# feature badge — which is checked — said 10.
+#
+# Anchors are code literals (`source: "auto"`, `engines/`, a backticked
+# source name) so they survive translation, per this file's founding
+# constraint.
+# ---------------------------------------------------------------------------
+
+_SOURCE_INTRO_ANCHOR = 'source: "auto"'
+_ENGINE_TREE_RE = re.compile(r"^│\s+├── engines/\s+#\s+(?P<count>\d+)\s", re.M)
+
+
+def _source_intro_line(text: str) -> str:
+ """Return the Data Sources intro paragraph.
+
+ ``source: "auto"`` appears twice — the intro and a later usage example —
+ and the intro is the first. Anchoring on the literal rather than the
+ heading keeps this locale-independent.
+ """
+ hits = [line for line in text.splitlines() if _SOURCE_INTRO_ANCHOR in line]
+ assert hits, "no Data Sources intro line"
+ return hits[0]
+
+
[email protected]("readme", READMES)
+def test_data_sources_prose_states_the_real_source_count(readme: str) -> None:
+ """The headline source count must be the registry's, in every language."""
+ from backtest.loaders.registry import LOADER_REGISTRY, _ensure_registered
+
+ _ensure_registered()
+ line = _source_intro_line(_read(readme))
+ bold = " ".join(re.findall(r"\*\*(.+?)\*\*", line))
+ assert str(len(LOADER_REGISTRY)) in _numbers(bold), (
+ f"{readme}: the Data Sources intro states "
+ f"{sorted(_numbers(bold))} where the registry has {len(LOADER_REGISTRY)}"
+ )
+
+
[email protected]("readme", READMES)
+def test_every_registered_source_appears_in_the_data_sources_table(readme: str) -> None:
+ """A source the loader can serve but the table never names is invisible.
+
+ The reader picks a source from this table; one that ships without a row
+ is shipped to nobody. Checked against the registry rather than against
+ the other READMEs, so all six being uniformly wrong still fails.
+ """
+ from backtest.loaders.registry import LOADER_REGISTRY, _ensure_registered
+
+ _ensure_registered()
+ rows = [l for l in _read(readme).splitlines() if l.startswith("| `")]
+ table = " ".join(rows)
+ missing = sorted(n for n in LOADER_REGISTRY if f"`{n}`" not in table)
+ assert not missing, f"{readme}: sources missing from the Data Sources table: {missing}"
+
+
[email protected]("readme", READMES)
+def test_repo_tree_states_the_real_engine_count(readme: str) -> None:
+ """The engines tree line names the composite engine separately.
+
+ `_engine_count()` counts every market engine including `composite`, and
+ the tree line reads "N engines + composite ... + options_portfolio", so
+ the number it carries is one less than that count.
+ """
+ match = _ENGINE_TREE_RE.search(_read(readme))
+ assert match, f"{readme}: no engines tree line"
+ assert int(match.group("count")) == _engine_count() - 1, (
+ f"{readme}: engines tree line says {match.group('count')}, "
+ f"the code ships {_engine_count() - 1} plus the composite engine"
+ )