DEV Community

TildAlice
TildAlice

Posted on • Originally published at tildalice.io

My ML Crypto Trading Bot Lost Money: 2 Hard Lessons

I spent a few weekends building a machine-learning crypto trading bot, ran it live on real money for a few weeks, and lost money. Then I shelved it.

This is the honest post-mortem. And the punchline is uncomfortable: the machine learning was the least important part of the whole thing. The two lessons that actually decided whether I made or lost money had nothing to do with XGBoost. They were about transaction fees and a server with 1GB of RAM.

If you're about to build your own trading bot, I'd rather you learn these from my P&L than your own.

What I built

The setup was reasonable on paper:

  • Per-coin ML models. For each coin, the bot trained both an XGBoost and a RandomForest classifier and kept whichever scored better. The label was a simple "will the price be higher N candles from now."
  • A trend filter. It only bought when the short-term trend was up — current price above the 20-period moving average, and MA5 > MA20. The idea: don't fight the tape.
  • Asymmetric confidence thresholds. Buy when the model was ≥55% confident, sell only at ≥65%. I wanted it slower to panic-sell than to buy.
  • Multi-coin. Up to 5 positions at once, picked by a scanner that scored the top coins by trading volume.
  • Retraining every 2 hours so the models could "adapt."
  • It ran as a systemd service on an Oracle Cloud free-tier box (ARM, 1GB RAM), with a Telegram bot for /start, /stop, /status.

Continue reading the full article on TildAlice

Top comments (0)