trading-app/scripts/check-universe.mts
David 27a358038a
Some checks failed
Tick / tick (push) Failing after 1s
Cagnotte V1: IA news-driven trading sim, sandbox, PEA tracking, PWA
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 19:06:17 +01:00

18 lines
739 B
TypeScript

// Vérifie que chaque action surveillée a bien un cours, en euros ou en dollars.
// Usage : pnpm tsx scripts/check-universe.mts
import YahooFinance from "yahoo-finance2";
import { UNIVERSE } from "../src/lib/universe";
const yf = new YahooFinance({ suppressNotices: ["yahooSurvey"] });
const rows = await yf.quote(UNIVERSE.map((s) => s.symbol));
const found = new Map(rows.map((r) => [r.symbol, r]));
let bad = 0;
for (const s of UNIVERSE) {
const r = found.get(s.symbol);
if (!r || r.regularMarketPrice == null || !["EUR", "USD"].includes(r.currency ?? "")) {
bad++;
console.log("PROBLEME", s.symbol, s.name, r?.currency, r?.regularMarketPrice);
}
}
console.log(`${UNIVERSE.length - bad}/${UNIVERSE.length} actions OK`);