CME evening session: first entry at 5:45 PM CT, not 5:05
Tradovate moves each account's cash record to the new trade date on its own schedule, an idle one perhaps not until it trades, and the bot holds any account still on the old day until 5:45. Opening at 5:05 fired the ready accounts alone (TopstepX, the early rollers) while the rest, released at 5:45, waited an hour or more for them to go flat. A 5:45 open puts every account in the first batch and skips the open's widest spreads. The day's 0–180 minute delay still comes on top: first entries land 5:45–8:45 PM. Every-day firms keep their own 5:05 PM end of the roll guard; the equity hours open is unchanged. The draw's session progress now starts at 5:45. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ff97a59b49
commit
db0ad99a76
@@ -135,8 +135,9 @@ function centralMinutes(now: Date): { day: string; minutes: number } {
|
||||
|
||||
/**
|
||||
* How far through the trading session `now` is: 0 at the open, 1 at the last
|
||||
* entry. full_cme runs 17:05 → 14:55 CT the next day; equity_hours 8:35 →
|
||||
* 14:55. null outside the session.
|
||||
* entry. full_cme runs 17:45 → 14:55 CT the next day (trading-logic's
|
||||
* CME_EVENING_OPEN_MIN — no imports here); equity_hours 8:35 → 14:55. null
|
||||
* outside the session.
|
||||
*/
|
||||
export function sessionProgress(now: Date, mode: string): number | null {
|
||||
const { day, minutes } = centralMinutes(now);
|
||||
@@ -144,8 +145,8 @@ export function sessionProgress(now: Date, mode: string): number | null {
|
||||
if (day === 'Sat' || day === 'Sun' || minutes < 515 || minutes > 895) return null;
|
||||
return (minutes - 515) / (895 - 515);
|
||||
}
|
||||
const open = 17 * 60 + 5;
|
||||
const length = 24 * 60 - open + 14 * 60 + 55; // 21h50m
|
||||
const open = 17 * 60 + 45;
|
||||
const length = 24 * 60 - open + 14 * 60 + 55; // 21h10m
|
||||
const since = (minutes - open + 1440) % 1440;
|
||||
if (since > length) return null;
|
||||
if (day === 'Sat' || (day === 'Fri' && minutes > 895) || (day === 'Sun' && minutes < open)) return null;
|
||||
|
||||
+19
-5
@@ -1553,11 +1553,25 @@ function centralClock(now: Date): { day: string; minutes: number; resetMinutes:
|
||||
return { day: get('weekday'), minutes, resetMinutes };
|
||||
}
|
||||
|
||||
/**
|
||||
* The CME evening session's first entry, in Central minutes: 5:45 PM, 45
|
||||
* minutes after the 5 PM roll. Tradovate moves each account's cash record to
|
||||
* the new trade date on its own schedule — an idle one perhaps not until it
|
||||
* trades — and the bot holds any account still on the old day until 5:45
|
||||
* (tradovate-class ROLL_WINDOW_END_MIN). Opening then puts every account in
|
||||
* the first batch, instead of the ready ones firing alone and the rest
|
||||
* waiting for them to go flat, and skips the open's widest spreads.
|
||||
*/
|
||||
export const CME_EVENING_OPEN_MIN = 17 * 60 + 45;
|
||||
/** Every-day firms' roll guard ends here (plus the day's delay): they have
|
||||
* no Tradovate roll to wait for. */
|
||||
const EVERY_DAY_OPEN_MIN = 17 * 60 + 5;
|
||||
|
||||
/**
|
||||
* Whether no new trade may open right now.
|
||||
*
|
||||
* CME firms follow the trading_hours setting:
|
||||
* "full_cme" — Sun 5:05 PM – Fri 2:55 PM Central (5 min buffer on each side)
|
||||
* "full_cme" — Sun 5:45 PM – Fri 2:55 PM Central (see CME_EVENING_OPEN_MIN)
|
||||
* "equity_hours" — 8:35 AM – 2:55 PM Central, Mon–Fri (5 min buffer on each side)
|
||||
* with the open pushed back by the day's 0–180 minute delay.
|
||||
*
|
||||
@@ -1569,11 +1583,11 @@ function centralClock(now: Date): { day: string; minutes: number; resetMinutes:
|
||||
*/
|
||||
export function isNoTradeTime(now: Date, o: { everyDay: boolean; mode: string; jitterMin: number }): boolean {
|
||||
const { day, minutes, resetMinutes } = centralClock(now);
|
||||
const cmeOpen = 17 * 60 + 5 + o.jitterMin;
|
||||
const cmeOpen = CME_EVENING_OPEN_MIN + o.jitterMin;
|
||||
|
||||
if (o.everyDay) {
|
||||
const guardStart = Math.min(resetMinutes, 17 * 60) - ROLL_GUARD_MIN;
|
||||
return minutes >= guardStart && minutes < cmeOpen;
|
||||
return minutes >= guardStart && minutes < EVERY_DAY_OPEN_MIN + o.jitterMin;
|
||||
}
|
||||
|
||||
if (o.mode === 'equity_hours') {
|
||||
@@ -1583,12 +1597,12 @@ export function isNoTradeTime(now: Date, o: { everyDay: boolean; mode: string; j
|
||||
return minutes < open || minutes >= close;
|
||||
}
|
||||
|
||||
// Full CME: Sun 5:00 PM – Fri 4:00 PM Central with 5 min buffer.
|
||||
// Full CME: Sun 5:45 PM (plus the delay) – Fri 2:55 PM Central.
|
||||
if (day === 'Sat') return true;
|
||||
if (day === 'Sun') return minutes < cmeOpen;
|
||||
const cmeClose = 14 * 60 + 55;
|
||||
if (day === 'Fri' && minutes >= cmeClose) return true;
|
||||
// Mon–Thu: block 2:55 PM – 5:05 PM Central (early stop + daily halt + buffer).
|
||||
// Mon–Thu: block 2:55 PM – 5:45 PM Central (early stop, daily halt, Tradovate's roll).
|
||||
return minutes >= cmeClose && minutes < cmeOpen;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user