60k live trades taught me how not to build a trading bot. rebuilding it in public. market microstructure · execution · node/ts · go

Joined November 2023
While building the first version of my bot, I spent a lot of time reading Reddit, forums and algo trading communities. I noticed a pattern. Beginners obsess over strategy. Win rate. Entries. Indicators. Backtests. Almost nobody talks about where the bot actually runs. For short-term trading, putting your server in the wrong place can add enough latency to completely change your fills - and kill an edge that looked great on paper. A good strategy with bad execution is a different strategy.
16
Before coding a couple of new bots, I decided to trade their strategies manually on OKX first. You know, just to make sure they actually make sense. What could possibly go wrong?
30
Ran my bot for 6 weeks. 60k trades. Closed P&L: green. I was pretty happy with that number. Then I marked every open position to market. ⬇️
1
35
The picture changed completely. The problem wasn't necessarily the strategy. It was the measurement. Winners closed automatically. Losers could stay open. So my closed-trade history wasn't a sample of my strategy's outcomes. It was a sample of the outcomes my exit logic had chosen to finalize. I wasn't measuring my strategy. I was measuring my exit logic.
1
29
High win rate. Smooth closed-P&L curve. Thousands of small green trades. Even a random entry signal can look surprisingly good when winners are realized and losers are allowed to sit. The fix isn't clever. Mark-to-market has to be the primary P&L metric. And every position needs to resolve within the horizon the signal actually lives on. If your alpha decays in seconds, a position that's still open six hours later isn't your alpha anymore. I'm rebuilding the measurement layer before touching the signal. Next I'll post what the honest equity curve looks like.
4
This made me rethink how I look at order flow. It's easy to treat volume and trades as inputs. But if part of that flow is actually feedback - one event increasing the probability of the next - then you're not just measuring activity. You're measuring how close the market is to a cascade.
Standard risk models make 5 assumptions about order flow. Here's what the research actually shows...
52
5 years holding. 5 years waiting for “the next bull run.” But who said there had to be one? Crypto isn't a baby market anymore. The easy money gets arbitraged away. The obvious cycles stop being obvious. The market never promised you another bull run.
2
38
92% win rate. Sounds like a great trading bot. Until you realize most of the losing positions were never closed. My biggest bug wasn't in the code. It was in the metric I trusted.
🤖 Made with AI
1
62
When I started building a trading bot, I obsessed over indicators, patterns and signals. I barely thought about funding. Even less about fees. Turns out those boring costs can kill a great strategy. And when you're trading short-term market microstructure, a few bps can be the entire edge.
1
60
Building a trading bot is 20% strategy and 80% discovering new ways software can lose your money 🫠
1
50
I thought my trading bot had an exit strategy. It didn't. It had a take-profit and a liquidation condition. After ~61k live trades, that difference left most of the portfolio stuck in positions. And somehow, the bot still showed a 92% win rate.
1
53
The rebuild starts with exits, state and testing. deterministic event replay exchange/local state reconciliation tests around every money-moving path explicit forced-exit logic different passive/aggressive exit models
1
17
I'm also experimenting with inventory-aware approaches inspired by Avellaneda–Stoikov. The goal isn't a higher win rate. It's making realized and mark-to-market PnL tell the same story.
16