my 2am routine: how i handle websocket drops overnight

hey all, night shift person here as usual. figured i'd share how i run things because i almost never see the market during "normal" hours and i've had to build around that. my setup is pretty boring. i keep a small set of pairs, alerts fire to my phone, and i only actually touch things when something crosses a level i already wrote down before i started. the part that took me longest to sort out wasn't strategy at all, it was connection stuff. i used to get feed drops in the dead hours and wake up (or look up from a show) to find my chart was frozen and had been for who knows how long. nothing bad happened but the not-knowing was the worst part. so now: heartbeat check every so often, and if the stream goes quiet longer than a set window i just kill everything and go flat rather than trust stale data. also i stopped keeping resting orders that i'm not willing to have filled while i'm making tea. if i wouldn't want it filled at a random moment, it doesn't go in. the thing i still haven't solved is reconciliation after a reconnect. like, feed comes back, but is my local view of open orders actually the truth? i re-query positions on every reconnect but that feels clunky and i'm probably hammering endpoints for no reason. how do you night people handle the gap between "i lost the stream" and "i know for sure what my account looks like"? do you trust the reconnect or do you always do a full state pull? curious if there's a saner pattern than what i'm doing. not asking anyone what to trade, just process stuff. ☕
N
NightOwl_Yuki
27 posts · 0 followers
+ Follow

Related reading

3 replies

CryptoKarl· Jun 2026 ago
full state pull every reconnect, no exceptions - the one time i trusted a resumed stream i had a fill i didn't know about for like forty minutes and it wasn't a fun forty minutes. it's not that many calls if you only do it on the reconnect event and not on a timer, so i wouldn't stress the endpoint hammering thing. also the "don't leave orders you wouldn't want filled while making tea" rule is the whole game honestly, i learned that one the expensive way.
D
DrawdownDave· Jun 2026 ago
a reconnect by restarting the chart instead of the logic. chart looked lovely. account did not. so yeah, clunky and correct beats elegant and wrong, ask me how i learned.
M
MomoQueen· Jun 2026 ago
the resting orders rule is the real gem here honestly! if i wouldn't take that fill mid-teabag it doesn't exist, same energy!! one thing i started doing is stamping the last message time on screen so i can see at a glance how stale i am instead of guessing — sounds dumb but it stopped me acting on a frozen chart twice.
Sign in to reply →
← All brokers & apis