time window skeleton - what about half days and the dead zone?

read the time-windowed skeleton piece in the strategy library. it's basically what i already do by hand, so no argument there. two things bug me though. one. the forced flat is hardcoded to a clock time. fine 95% of the year. then you get an early close and your "before the close" exit sits there doing nothing while the bell goes. i have been burned by that exact thing back when i ran a manual book. anyone handling that in code, or do you just switch the bot off on those days and accept it. two. entry window closes at 1430, flat at 1545. that's over an hour where you can only bleed. no new entries, just sitting in whatever you already have. my instinct is the exit rules should tighten inside that gap - smaller stop, shorter hold time, something. otherwise you're running an afternoon strategy with morning parameters and calling it risk management. or is that overfitting and i should just shorten the whole thing. thoughts. also does HhmmSs follow exchange time or wherever the machine thinks it is. matters more than people realise twice a year.
G
GapHunterMike
17 posts · 0 followers
+ Follow

Related reading

6 replies

N
NightOwl_Yuki· May 2026 ago
crypto side i obviously don't have a close to be flat before, but i still window everything - my stuff only works in the asian hours quiet and falls apart when us equities wake up and everyone starts moving in sympathy. so the shape holds even without a bell, you're just fencing off behaviour not a session imo.
P
PremarketPete· May 2026 ago
on your point two, before changing anything: - log entry timestamp on every fill for a month - bucket the results by hour - look at the ones that entered before 1430 and were still open past 1500 specifically if that bucket is the loser then tighten the gap rules. if it's flat, you're just adding parameters. i did this and found my problem wasn't the afternoon at all, it was the first ten minutes.
ZenTrader_Ana· Jun 2026 ago
that hour after the entry window closes is the one that gets me emotionally more than anything. nothing to do but watch, and watching a position you can't add to does strange things to your patience. i've noticed the urge to "fix" something in that window is usually just discomfort with sitting still. do you find you fiddle more in the dead zone or is that just me
BacktestBetty· Jun 2026 ago
few things on the half day problem, in order of how i'd do it: 1. don't hardcode a clock at all if you can avoid it. store a session end for each date and express the flat as end minus X minutes. then a short day just works. 2. if you can't do that, a hardcoded list of early close dates is ugly but it's only a handful of rows a year and it's honest. 3. on the tightening idea - agreeing with pete but adding the warning. you'll have maybe a few dozen trades in that late bucket over a year. that is nowhere near enough to fit a separate stop to. if you tighten, tighten by a round number you'd have picked in advance, not the number the curve likes.
F
FiveMinFiona· Jul 2026 ago
on your last question - i wouldn't assume either way, i'd test it. put a marker order or a log line at a known time and see what the machine records against exchange time, then repeat after a clock change. cheaper than finding out live in march.
DataDrivenDee· Jul 2026 ago
the half day thing bothers me because there's almost nothing to test against - a couple of occurrences a year, so any rule you write for them is untested by definition. which to me argues for the boring safe version (flat earlier than you need to be) rather than anything clever.
Sign in to reply →
← All strategies & backtesting