my kill switch does more for me than any entry tweak

been running perps for about two years now and the thing i keep coming back to is that basically none of my improvement came from better entries. i've rewritten my entry logic probably nine times. filters, confirmation candles, waiting for the retest, whatever. the equity curve barely noticed. what actually moved the needle was boring plumbing stuff: - hard daily loss cap that flattens everything and blocks new orders until the next day. no override button. i deliberately made it annoying to change so drunk-me at 2am can't argue with it. - sizing off distance to liquidation instead of "feels like a good spot". i pick the invalidation level first, then the size falls out of it. sounds obvious, took me way too long. - every exit order goes in reduce-only. i once had a stop fill on a position that was already closed and ended up short something i never wanted to be short of. that was an educational evening. - reconnect handling. websocket drops way more than people admit. if my feed is stale past a few seconds i want the system to assume it knows nothing rather than act on a price from 30 seconds ago. the degen part of me still wants to size up on the setups that "feel obvious" and honestly i lose more on those than on the mechanical ones. so now the rule is the obvious ones get the same size as everything else. boring, but i sleep. curious what other people's actual guardrails look like at the code/order level, not the mindset level. what's the one check you added after getting burned once?
CryptoKarl
30 posts · 0 followers
+ Follow

Related reading

10 replies

L
LurkerLee· Jun 2026 ago· edited Aug 2026 ago
the stale feed check is the one i keep messing up. How do you tell a dead socket apart from a market that just isn't printing? heartbeat on the connection itself or a timer on last message?
ZenTrader_Ana· Jun 2026 ago· edited Aug 2026 ago
Separate the two questions and it gets easier: the socket being alive is a transport question (ping/pong frames, or the venue's own heartbeat), the data being fresh is a per-stream question. What helped me was logging inter-message gaps per symbol for a few weeks and looking at the actual distribution. A thin alt has a very different tail than a majors book, so one global timeout is either too twitchy or useless. I set the threshold somewhere out past the 99.9th percentile of the observed gaps and treat anything beyond as unknown state. Have you got the gap data logged already, or would you be guessing at the number?
R
RiskFirstRita· Jun 2026 ago· edited Aug 2026 ago
To add to that on the mechanics: don't hang your staleness timer off the trades stream. Trades genuinely stop printing in quiet hours and you'll flag dead sockets that are perfectly fine. Book updates or the venue's own heartbeat channel tick regardless, so I time off those and treat the transport ping/pong as a separate, shorter check. Two timers, two different actions. Transport dead means reconnect, data stale means flatten intent and go read-only.
D
DrawdownDave· Jul 2026 ago
The one I added after paying for it: on every reconnect, the exchange is the truth and my local state is a rumour. Pull positions and open orders fresh, compare to what I think I have, and if they disagree the bot does nothing but shout at me. Lost a good chunk one year because my software was convinced it was flat and the venue disagreed, and I only found out when the funding hit. Stay humble.
C
CoffeeAndCharts· Jul 2026 ago
- price sanity check on every order vs mark, reject if off by more than x% - max notional per symbol, hard coded, not a config field i can nudge - order rejects go to a counter, three in a minute and it halts - daily reset runs before i'm awake, not when i feel like it
SlowSwing_Sam· Jul 2026 ago
A few things I'd add, mostly from the testing angle: 1. Nine entry rewrites is itself a data point. If each rewrite barely moved the curve, the entries were probably never the variance driver — the sizing and the tail losses were. That's normal and it's also the classic path into overfitting the entry. 2. The guardrails you list are the bits a backtest can't price. My sim assumes fills, assumes the socket is up, assumes reduce-only behaves. So I keep a separate log of every live incident that the backtest would never have generated, and that list is what I harden against. 3. Watch out for tuning the daily loss cap on historical data. I did that and picked a number that was optimal in-sample and psychologically useless out of sample. Better to pick a cap you can actually stomach and leave it alone.
Q
QuietVol· Jul 2026 ago
client order ids on everything. deterministic, so a retry after a timeout doesn't open a second position. got double filled once on a flaky connection, never again. also check if your venue does cancel-on-disconnect. free insurance, most people never turn it on.
F
FiveMinFiona· Jul 2026 ago· edited Aug 2026 ago
The sizing point deserves a bit of maths love. If you fix the fraction of equity you're willing to lose on the trade, size is just risk_dollars / distance_to_invalidation, the entry price never enters the formula, which is exactly why entry tweaks don't show up in the curve much. And your "obvious setups get the same size" rule is more principled than it looks: half-Kelly type sizing is very sensitive to overestimating your edge, and the setups that feel obvious are precisely the ones where your edge estimate is most inflated. Overbetting an edge you don't have costs you geometrically, so flattening the size across signals is cheap insurance.
GrandpaGrizzly· Jul 2026 ago
Trading the asian hours the one I added is a slippage guard on market orders — if the book is thinner than X on my side, the order just doesn't go. Got filled through three levels once at 4am and that was enough. Also a hard block on opening anything new in the last 20 min before funding, purely because I kept doing dumb things there.
P
PremarketPete· Jul 2026 ago
The reduce-only one is going straight into my code tonight, I genuinely hadn't thought about a stop firing on a position that's already gone. Dumb question though — for the daily loss cap, is it counting realised only or realised plus open PnL? I built mine on realised and then realised (ha) that I can sit there with a huge unrealised drawdown and the switch never trips. But if I include unrealised then a normal wiggle can flatten me at the worst moment. How do you all handle that?
Sign in to reply →
← All brokers & apis