Skip to content
strategies6 min read

I built a futures trading bot. The honest first month.

Part 1 of building a Binance futures bot in public. The strategy, the bugs that cost real money, and a first month that started down 13%. No fake P&L.

Crypto candlestick chart on a dark monitor, the kind of price action a futures bot trades

Affiliate disclosure: This post may contain affiliate links. If you sign up through a link on this page I may earn a commission at no extra cost to you. This does not affect my ratings. Learn more.

I lost about 13% of a small live account in the first four days of running my own trading bot. Real money, real Binance futures, real losses. This is the start of me documenting the whole thing in public, the good and the ugly, because every "I built a trading bot" post I've ever read quietly skips the part where it loses money.

So here's the deal. I'm running a Python bot on Binance futures with my own capital. Not a demo. Not a backtest screenshot. I'll post the real numbers as percentages (you don't need my bank balance, and I'd rather not paint a target on it), the strategy in actual detail, and every bug that cost me. If it eventually fails, I'll write that too.

What the bot actually does

The strategy is a trend-following ensemble on the 4-hour timeframe. Two rules vote per symbol:

  • UT Bot (an ATR trailing-stop flip, key 2, ATR-10)
  • EMA 20/50 crossover

They net into one signal per symbol. Both agree, full-size position. One agrees, half size. They disagree, stand flat. On top of that sits an ADX regime filter: only trade when ADX is above 25 (genuinely trending), stand completely flat when it drops below 20 (chop). That "do nothing in sideways markets" rule is the whole edge, honestly. Pure trend-following bleeds to death in chop, and mean-reversion gets murdered in leveraged crypto. Detecting the regime and sitting out beats both.

Exits are an ATR bracket (stop at 3x ATR, take-profit at 6x) or a signal flip. Risk is sized per trade off an equal slice of the wallet, currently around 7.5% risk per slot. The live book is three coins: ETH, NEAR, SOL.

The point of the bot isn't to be clever. It's to be disciplined and unemotional at 3am when I'd otherwise panic-close a good trade. That's the only edge retail actually has.

The first four days were brutal

I went live and immediately took four losing trades in a row. Down about 13% in four days.

Here's the honest breakdown of why, because only some of it was bad luck:

The strategy has roughly a 30-40% win rate. It makes money because winners are about twice the size of losers, not because losses are rare. Four losses in the first five trades is uncommon but well within normal, the math says a streak like that happens maybe one in five times for this kind of system. So part of it was just variance, and the discipline test was not touching anything while it happened. I didn't. That was the right call.

But part of it was my own code biting me, and that part I earned.

The bugs that cost real money

This is the stuff nobody writes up, so here's where the money actually went.

The sizing footgun. My first version sized each position off the current available balance at the moment it placed the order. Sounds fine until you have multiple symbols trading in the same cycle: the first symbol grabbed a huge chunk of margin, and the next symbol saw a tiny leftover balance and either over-sized and got rejected, or under-sized to almost nothing. One trade got 15x the risk it should have. That single bug cost me roughly an extra 6% of drawdown versus what proper sizing would have done. The fix was to snapshot the total wallet at the start of each cycle and pre-allocate an equal slice per symbol, so every trade sizes off its own slice, not the shared pool.

The exchange changed its API under me. My stop-loss and take-profit orders started failing outright with a "order type not supported" error. Turns out Binance had migrated stop-market and take-profit-market orders to a separate "algo order" endpoint, and the old endpoint just rejects them now. My bot would open a position, fail to attach the bracket, then correctly roll back and close the position, so no money lost there, but no trades either until I rewrote that path.

The stale-price bug. After fixing the endpoint, entries still failed with "order would immediately trigger." The cause was subtle and kind of beautiful: I was computing the stop-loss price from the candle's closing price, but the bot actually enters a couple minutes after the candle closes, at the live price. By then the market had moved, so a stop based on the old price was now on the wrong side of the current price, and the exchange rejected it instantly. Fix: anchor the stop and take-profit to the live mark price at order time, not the stale candle.

None of these show up in a backtest. A backtest fills instantly at a clean price with infinite margin. Live trading is where you find out which of your assumptions were lies.

Where it stands now

After the fixes, the account clawed back. It's recovered to roughly 6-7% below where I started, up nicely off the bottom but still red overall. And here's the honest framing: that number means almost nothing yet. Four to ten trades is noise. This kind of system needs 30-plus trades and ideally six months before the live results say anything trustworthy. It trades about once a week per symbol, so this is going to be a slow story.

I want to be blunt about expectations, because this is where most bot content lies to you. The backtest for this strategy shows numbers like +35% a year. I do not expect to make 35% a year. Backtests don't model funding fees, they use optimistic fills, and the recent market regime is mediocre for trend-following. A realistic central expectation is more like low-double-digit annual returns, with wide variance, great in strongly trending years, flat-to-negative in chop. Anyone selling you a bot that "makes 50% a year" is either lying or hasn't had a bad month yet.

If you want the boring tools that actually work for most people instead of building your own, I've reviewed the exchange-native bots like the Bybit built-in suite, which is where I'd point a beginner before writing a line of Python.

That's part one. The bot is live, it's down a few percent, and I've already paid a tax in real money to learn things a backtest would never have taught me. Next entry I'll get into why I almost certainly fooled myself on the 1-hour version of this strategy before moving to 4-hour, which is the most useful mistake in the whole project.

Follow along on the journey page. I'll post the real numbers as they come, whichever direction they go.

Share:X / TwitterReddit
Hung Phu
Hung Phu
DCA BotsGrid BotsPythonCrypto FuturesBacktesting

Python algo trader since 2019. I build and test trading bots with real capital on Bybit and Binance. AlgoGrade is my lab notebook.

Related posts