Building an algorithmic trading bot is a journey of constant humbling. When I wrote my V2 rule (EMA crossovers, RSI, and a 24h momentum check), I thought I had found a solid edge.
To keep myself honest, I decided to backtest it on 3 years of 1-hour candles for BTC and ETH (~26,298 candles per coin) using the public Binance API. I tested a 5% Take Profit (TP) and a 1% Stop Loss (SL) with a realistic 0.78% exchange fee per side (1.56% round-trip).
I compared my strategy against the ultimate reality check: a random baseline (entering blindly every 4 hours).
The results were a disaster.
📉 The "Before": My Rule vs. Randomness
Coin and Method Trades Hits TP Hits SL Exits at 24h Avg Net (after fees)
BTC, v2 rule 1,146 4.6% 60.1% 35.3% -1.60%
BTC, entering blindly 6,485 4.3% 58.3% 37.3% -1.53%
ETH, v2 rule 1,292 7.8% 73.5% 18.7% -1.65%
ETH, entering blindly 6,485 7.7% 68.9% 23.3% -1.56%
My algorithm didn't just lose money; it was statistically worse than a coin flip. The reason? A fixed 1% Stop Loss is too tight. For ETH, 73.5% of the trades hit the SL before the market could ever move 5% in my favor. The normal market noise was kicking me out of the trade.
🛠️ The "Fix": The Momentum Exit (The Trap)
I thought I could solve this. If I'm getting stopped out by noise, I should just exit dynamically. I rewrote the exit logic: "If the MACD histogram turns negative or the price drops below the EMA200, exit the trade immediately at the close."
I ran the backtest again. It got worse.
Here is the data with the new dynamic momentum exit:
Coin Method Trades Hits TP Hits SL Momentum Exit Avg Net (Fees)
BTC V2 + Momentum 1,146 1.0% 9.1% 89.9% -1.54%
BTC Random + Momentum 6,485 1.0% 10.4% 87.6% -1.53%
ETH V2 + Momentum 1,292 1.5% 20.9% 77.6% -1.63%
ETH Random + Momentum 6,485 1.6% 19.7% 78.1% -1.54%
🧐 The Autopsy: Why did the dynamic exit fail?
Look at the Momentum Exit column. The bot is exiting almost 90% of BTC trades this way. But here is the killer stat: 68.7% of those exits happen in the FIRST HOUR.
Here is what is actually happening:
- The bot detects a signal and buys.
- One hour later, a tiny red candle appears, or the MACD dips slightly. The bot panics and sells.
- The trade lasts an average of 2.5 hours.
- Because the trade closes so fast, the price barely moves (0.1% or 0.2%).
- But the 1.56% round-trip fee is guaranteed.
I wasn't trading. I was just feeding the exchange fees. The math is brutal: to break even with a 5% TP and 1% SL, I needed a 42.7% win rate. I achieved 4.6%.
💡 Key Takeaways for Algo-Traders
Building this bot taught me three harsh lessons:
- Timeframes matter: At the 1-hour level, market noise and fees will destroy you. You need higher timeframes (4H or 1D) where price movements are large enough to justify the commission.
- Random Baselines are brutal: If your indicator can't beat entering at random, it has no edge.
- Never underestimate fees: A 0.78% fee per side is a mountain to climb if your average trade duration is 2 hours.
🚀 What's Next?
These results proved that traditional indicators (MACD, RSI) and dynamic exits aren't enough on their own.
In my next iteration (V3), I am throwing out the fixed time exits and adding an AI Gatekeeper (using Groq/Claude). Before executing any buy order, the AI will read the recent price action and the confluence score to block bad trades and hold the position longer.
This is an educational project in paper-trading mode. No real money is being risked, and this is not financial advice.
Have you ever backtested a strategy and realized fees ruined it? Let me know in the comments!
🔗 You can check out the full educational course, the Python code, and the manual here: https://botsenalescriptointeligente.netlify.app

