Report daily session-open delay to the master dashboard
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
906275cc33
commit
346c356222
+10
-4
@@ -138,6 +138,14 @@ function openJitterMinutes(centralDay: string): number {
|
||||
return jitter;
|
||||
}
|
||||
|
||||
/** Today's session-open delay in minutes, for reporting to the master. */
|
||||
export function todaysSessionOpenDelay(): number {
|
||||
const centralDay = new Intl.DateTimeFormat('en-CA', {
|
||||
timeZone: 'America/Chicago',
|
||||
}).format(new Date());
|
||||
return openJitterMinutes(centralDay);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when trading is not allowed based on the trading_hours setting.
|
||||
*
|
||||
@@ -162,10 +170,7 @@ function isInNoTradeWindow(): boolean {
|
||||
timeZone: 'America/Chicago',
|
||||
}).format(now); // "Sun", "Mon", ... "Sat"
|
||||
const timeMinutes = hour * 60 + minute; // minutes since midnight
|
||||
const centralDay = new Intl.DateTimeFormat('en-CA', {
|
||||
timeZone: 'America/Chicago',
|
||||
}).format(now); // "2026-09-06"
|
||||
const jitter = openJitterMinutes(centralDay);
|
||||
const jitter = todaysSessionOpenDelay();
|
||||
|
||||
const mode = getSetting('trading_hours') ?? 'full_cme';
|
||||
|
||||
@@ -727,5 +732,6 @@ export function getSchedulerStatus() {
|
||||
lastRun: state.lastRun,
|
||||
intervalSeconds: parseInt(getSetting('tick_interval_seconds') ?? '60', 10),
|
||||
stopAfterAll: state.stopAfterAll,
|
||||
sessionOpenDelayMin: todaysSessionOpenDelay(),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user