All AI news
📈 Hands-on test

We Built a Crypto Trading Bot with AI: Two Years of Backtest Results and a Testnet Run (2026)

A non-programmer built a Python crypto trading bot with Claude, then tested it on two years of Binance data and Testnet play money. Honest results, risks and lessons. Not financial advice.

Updated October 28, 2026 · 6 min read ·

We may earn a commission if you sign up through links on this page, at no extra cost to you. Learn more.

Key takeaways
  • With Claude, we built a Python bot that trades BTC, ETH, SOL and BNB on Binance Testnet, risking 1% per trade.
  • On two years of 4-hour data it made +6.67% over 207 trades while buy-and-hold lost 23%, but only 30% of trades won and most profit came from ETH.
  • On about four years of daily candles: 77 trades, +10.79%, max drawdown -1.71%.
  • The AI caught a subtle bug that could skip trading signals; backtests do not guarantee future results and this is not financial advice.

Can someone who is not a professional programmer build a working crypto trading bot just by describing it to an AI? We tried. Over a few chat sessions with Claude, Rachid Amesrouy built a Python bot that trades four cryptocurrencies on Binance, limits the loss on every trade, and runs on an ordinary Windows PC. Then we tested it on two years of real price data and connected it to Binance's Testnet, where it trades with play money. Here is what the AI built, what went wrong, and what the numbers really say.

Important: this is an educational experiment about building software with AI, not financial advice. We traded only with fake Testnet money. Past results (backtests) do not predict future results, crypto is extremely volatile, and most automated trading strategies lose money in real markets. Check that crypto trading is legal where you live. This site also uses Claude to help build its pages.

What we asked for

The first question was simple: "Can you build a program that buys and sells automatically and enters trades with a small loss margin?" Before writing any code, the AI was blunt: no program can guarantee profits, a very tight stop-loss is not always better because normal price noise keeps hitting it, and most people who start automated trading lose money at first. It recommended starting with crypto on Binance Testnet, because the API is free and you can test with fake money, and avoiding leverage entirely.

What the AI built

The bug the AI found by itself

On the first live day, the bot printed three connection timeouts in 40 minutes. They were harmless (Testnet servers are slower than the real exchange), but reviewing the code because of them, the AI found a real flaw: if a timeout happened exactly when a 4-hour candle closed, the bot marked that candle as "processed" without finishing its checks. It could miss a buy signal, or fail to raise the stop on an open trade, and those candles come only six times a day.

The fix: a candle is now marked as processed only after every request succeeds; the bot waits up to 30 seconds instead of 10; and it asks for the balance only when a trade opens or closes. The AI then tested the fix on a simulated exchange that deliberately failed 30% of requests, and the bot kept running without missing trades. It also replaced long technical error messages with a clear note: "temporary connection loss, retrying in a minute, no need to worry".

Backtest results: two years on 4-hour candles

We ran the strategy on real Binance price history from November 30, 2024 to October 28, 2026, with $1,000 per coin ($4,000 total), 1% risk per trade and a 0.1% fee on every buy and sell.

ResultValue
Number of trades207
Winning trades30.4%
Net profit+$266.88 (+6.67%)
Profit factor1.22
Maximum drawdown-9.26%
Buy and hold, same period-23.10%
Chart of portfolio value from late 2024 to October 2026: the trading bot ends at 4,267 dollars while buy and hold of the four coins ends at 3,076 dollars
Portfolio value: the bot (blue) moved slowly and ended at $4,267; holding the four coins (orange) swung between $2,200 and $5,500 and ended at $3,076.

The chart also shows something the summary hides: after peaking in October 2025, the bot slowly lost money for about ten months, drifting back to its starting $4,000, before a few big trades in August 2026 pushed it up again. Sitting through ten months of small losses is the hardest part of running a strategy like this.

By coin

CoinTradesWinnersBot returnBuy and holdMax drawdown
BTC5131.4%+2.15%-15.54%-6.97%
ETH5121.6%+18.49%-36.15%-10.91%
SOL5034.0%+2.25%-56.79%-10.10%
BNB5534.5%+3.80%+16.06%-11.21%
Bar chart of return by coin: the bot made +2.2 percent on BTC, +18.5 percent on ETH, +2.2 percent on SOL and +3.8 percent on BNB, against buy and hold of -15.5, -36.2, -56.8 and +16.1 percent
Return by coin: the bot (blue) stayed positive on all four; buy and hold (orange) only won on BNB.

The pattern is typical of trend-following strategies: it loses most of the time (about 7 trades out of 10), but each loss is small (the worst was about -$13, close to the 1% risk limit), while a few big winners pay for everything. The best trade was ETH in August 2026: +28% in eleven days, +$148.

A second test: daily candles

Running the same strategy on daily candles over about four years (1,500 days) gave fewer but better trades: 77 trades, +$431.78 (+10.79%), a profit factor of 2.11 and a maximum drawdown of only -1.71%.

How to read these numbers honestly

The live test on Testnet

The bot runs on a Windows PC, connected to Binance Testnet with $10,000 of play money. Breakout signals on 4-hour candles are rare, and as of October 28, 2026 the account was still at $10,000 with no open trades. A trend-following bot can wait days or weeks for a setup, which is normal and a lesson in itself: these bots are slow and patient, not money machines. We will update this article with the live trades.

What we learned about building with AI

Related: Claude Code vs OpenAI Codex for building software with AI agents, and what Claude can do.

Frequently asked questions

Can AI build a crypto trading bot?

Yes. In our experiment, Claude wrote a working Python bot with risk limits, backtests and reports. You still need to run, monitor and understand it.

Did the AI trading bot make money?

In a two-year backtest on 4-hour candles it made +6.67% after fees, with a 30% win rate. That is a backtest with fake money, not a guarantee, and slippage was not included.

What is Binance Testnet?

A practice version of Binance where you trade with play money through the same API, so you can test a bot without risking real funds.

Is it safe to run a trading bot with real money?

Any real-money trading can lose money, and most automated strategies do. Test on historical data and Testnet first, avoid leverage, and only risk what you can afford to lose. This is not financial advice.

Tools mentioned in this guide

🤖 Assistants & ResearchFree plan✓ Tested

Claude

An AI assistant for writing, research, files and small apps.

Best for: writing, research and everyday office work