Engineering Learnings
Engineering Learnings collects post-incident write-ups from running an autonomous trading system in production — each one covering a specific failure, why it happened, and the change that fixed it.
16 articles in this category.
Measuring Missed Exit Profits
Quantify exit strategy performance by tracking Maximum Favorable Excursion (MFE) and Maximum Adverse Excursion (MAE) against realized profit and stop.
Detecting Market Regime Changes
We detect market regime changes using a dual-clock system: a daily Hidden Markov Model for broad market classification and an intraday efficiency ratio…
Securely Storing User Broker API Keys
A data-driven approach to securing user broker API keys, detailing a production incident and the implemented safeguards.
Market Data Pipeline Resilience
Building a reliable market data pipeline requires an async-first design with layered fallbacks and rigorous testing for cache coherency and data integrity.
Bot Found Trades, Never Executed Them
A trading bot failed to execute trades due to differing margin calculations between its scanning and execution stages.
Shared Database Schema Migrations: The Cross-Service Gap
Adding a database column in a shared schema requires careful deployment ordering across all consuming services to prevent UndefinedColumnErrors.
CREATE INDEX CONCURRENTLY Fails in Transactions
Postgres's implicit transaction handling breaks CREATE INDEX CONCURRENTLY in multi-statement migration files. Learn how to split your migrations for.
ib_insync Crashes: uvloop and nest_asyncio Conflict
A sync convenience method in ib_insync's SDK reached for nest_asyncio, which cannot patch uvloop, leading to file descriptor leaks and crashes.
Position Sizing: The Smallest Candidate Wins
Automated trading systems should use the minimum position size derived from risk-based, ATR-based, and half-Kelly methods to mitigate individual model…
Automating Small Accounts: The Fractional Share Imperative
Automating day trading for accounts under $1,000 requires enabling fractional shares and adjusting risk parameters. Standard sizing formulas fail…
PDT Rule Compliance for Automated Trading
Automated trading bots comply with the PDT rule by enforcing a pre-trade check on day trade counts within a rolling five-day window, preventing violations.
Bot Stopped Trading: The Silent Failure
A trading bot can stop trading without errors due to a clean exit code, bypassing failure detection and restarts.
Confidence Alone Doesn't Guarantee Accuracy
Selective prediction based on confidence thresholds failed to improve out-of-sample directional accuracy in our automated trading system.
LLM Backtests: The Two Faces of Lookahead Bias
LLM backtests are unreliable due to two forms of lookahead bias: one fixable with timestamps, the other baked into model weights.
Multi-Agent LLMs: The Illusion of Independent Opinions
Running multiple personas through a single LLM architecture leads to correlated errors, not independent insights. We learned this the hard way.
Broker Stops: Your Bot's Real Safety Net
A trading bot's in-memory stop loss is a false sense of security. Learn why broker-side stops are essential and how to implement them correctly.
Move from research to a watchlist
Use an article to frame the question, then inspect signal entry, stop, target, and reasoning for tickers you choose.
Frequently asked questions
What is in the Engineering Learnings category?
Post-incident write-ups from running an autonomous trading system in production. Each article covers one specific failure — a stop that never reached the broker, a process that exited cleanly and was never restarted, a migration that could not run inside a transaction — along with why it happened and the change that fixed it. They are systems articles, not strategy articles, and they contain no performance or profitability claims.
Who are these articles written for?
Engineers who build or operate automated trading systems, and technically-minded traders who want to understand what actually breaks in one. They assume familiarity with APIs, databases and asynchronous code, and they describe mechanisms in enough detail that you could implement the equivalent fix in a different stack.
Are these real incidents?
Yes. Each article is generated from an internal root-cause analysis, audit or production incident, and the factual claims in it are drawn from that record rather than written from scratch. Numbers, failure modes and fixes describe what happened in our own system.
What is the most common cause of trading bot failures?
In our experience it is rarely the strategy. It is the operational layer around it: state held in application memory that does not survive a restart, two stages of one pipeline computing the same value differently, a dependency that behaves differently under the production event loop, and monitoring that reports green because it is watching the wrong process. Each of those has its own article here.
Do these articles tell me whether the trading strategies make money?
No, and deliberately so. These are engineering write-ups about correctness and reliability, not performance reports. They contain no win rates, returns or profitability claims. Tradewink publishes tracked signal outcomes separately, with the rolling window and methodology stated, because performance data and engineering data answer different questions and should not be blended.
Other categories
AI & Automation
How AI and automation are applied to trading: model routing, signal generation, broker APIs, and the limits of each.
Trading Strategies
Strategy breakdowns with entry rules, exit rules, and the conditions under which each approach stops working.
Risk Management
Position sizing, stop placement, portfolio heat, and drawdown management for discretionary and automated trading.
Market Analysis
Market structure, breadth, sector rotation, and the data behind what moves price.
Options Trading
Options mechanics, Greeks, implied volatility, and strategy selection explained without the jargon wall.
Getting Started
Orientation for new traders: accounts, order types, paper trading, and the mistakes that cost the most early on.
Save a signal preview for later
Get a concise AI signal example in your inbox, then build a watchlist when you are ready. No spam, unsubscribe anytime.