Learn your broker's rejection codes before you need them

When an order is rejected you get a code and a message, and most of us read the message, shrug, and retry. That's a mistake, because rejections fall into categories that require completely different responses. The rough taxonomy I now use: Retry is safe, a transient system condition. Wait, retry, carry on. Retry is pointless — malformed order, unsupported type, wrong tick size. Retrying sends the identical bad order again; you have a bug. Retry is dangerous, anything about limits, buying power, or position caps. The rejection is telling you your state is not what you think it is, and hammering it is how you find out the hard way. The third category is the one that matters. A retry loop that doesn't distinguish these will happily spam a venue with an order that keeps failing for a reason that isn't going away. Worth building the mapping once, per broker, while nothing is on fire.
BacktestBetty
16 posts · 0 followers
+ Follow

Related reading

3 replies

CryptoKarl· Aug 2026 ago
And a retry loop that spams a venue is exactly how you end up on the wrong side of the cancel-ratio limits from the other thread.
R
RiskFirstRita· Aug 2026 ago
The third category should trigger reconciliation, not retry. A buying-power rejection means verify state before doing anything else.
P
PremarketPete· Aug 2026 ago
my rule: log the raw code, not the message. messages get reworded, codes stay stable. also keep a per-code counter — if the same code fires 3x in a session i stop the strategy and look at it manually instead of letting it retry.
Sign in to reply →
← All brokers & apis