feat: add isolated historical replay calibration
This commit is contained in:
@@ -20,7 +20,9 @@ function httpGet(url) {
|
||||
}
|
||||
|
||||
async function history(symbol) {
|
||||
const url = `https://query1.finance.yahoo.com/v8/finance/chart/${encodeURIComponent(symbol)}?range=10y&interval=1d`;
|
||||
// GDELT backfills predate the normal rolling quote window. Use an explicit
|
||||
// point-in-time range so replay outcomes do not silently become unresolvable.
|
||||
const url = `https://query1.finance.yahoo.com/v8/finance/chart/${encodeURIComponent(symbol)}?period1=946684800&period2=${Math.floor(Date.now() / 1000)}&interval=1d`;
|
||||
const body = JSON.parse(await httpGet(url));
|
||||
const result = body?.chart?.result?.[0];
|
||||
if (!result) return [];
|
||||
|
||||
Reference in New Issue
Block a user