INNER CODE UNIT · JavaScript

nowET

dearvn/tradovate-trading-bot · agents/order-flow/index.js:60

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 ─────────────────────────────────────────────────────────────

function sessionPhase(etDate) {
  const h = etDate.getUTCHours();
  const m = etDate.getUTCMinutes();
  const mins = h * 60 + m;

  if (mins < 9 * 60 + 30)   return 'CLOSED';

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…