INNER CODE UNIT · JavaScript
dstStart
dearvn/tradovate-trading-bot · agents/order-flow/index.js:53
const dstStart = nthSundayUTC(y, 2, 2); // March (month 2)
dstStart.setUTCHours(7); // 02:00 ET = 07:00 UTC
const dstEnd = nthSundayUTC(y, 10, 1); // November (month 10), 1st Sunday
dstEnd.setUTCHours(6); // 02:00 ET = 06:00 UTC
return now >= dstStart && now < dstEnd ? -4 : -5;
}
function nowET() {
const now = new Date();
const off = etOffsetHours(now);
return new Date(now.getTime() + off * 3_600_000);
}
function etDateStr(et) {
return `${et.getUTCFullYear()}-${String(et.getUTCMonth() + 1).padStart(2, '0')}-${String(et.getUTCDate()).padStart(2, '0')}`;
}
// ── Session phase ─────────────────────────────────────────────────────────────