"My 12-Day War with Ghost Orders - A Crypto Bot Horror Story"
So I've been building a trading bot. How hard can it be, right?
Day 1: Bot works! Opens trades, sets Stop Loss and Take Profit. I'm basically a genius.
Day 2: Wait... why are there 6 orders for 1 position? And why are there orders for coins I don't even hold anymore? 👻
Days 3-11: Debugging montage
"It's the error handling!" - Nope
"It's the spam filter!" - Nope
"It's the registry sync!" - Nope
"Maybe if I just..." - Definitely nope
Day 12: Finally contact Binance support. Their response:
"Sir, STOP_MARKET and TAKE_PROFIT_MARKET are Algo Orders. They need different API endpoints to cancel."
Me: 😐
So for 12 days I was calling futures_cancel_all_open_orders() like an idiot while the ALGO orders just sat there laughing at me.
But wait, there's more!
While debugging, I didn't notice my bot had been DEAD for 5 days. Just... not running. Meanwhile, mystery trades appeared in my testnet account. Still don't know who did those. Ghosts? Hackers? My cat? 🐱
Lessons learned:
RTFM (Read The F***ing Manual) - Algo Orders ≠ Normal Orders
Set up a watchdog that texts you when your bot dies
Binance Testnet will humble you
Now excuse me while I mass delete orders on binance. Still have 6 of them up there... somewhere!
Currently mass mass mass mass mass mass