World Economic

Global trade, energy transition, financial regulation, multinational corporations, and macroeconomic trends.

We built a bitcoin trading bot and it’s pretty good

4 min read

The beauty of AI is that it allows you to test all sorts of trading strategies with ease and then create bots that do the trading for you, without any knowledge of coding.

A major problem is one that all bot developers face – the uncertainty that a bot extensively tested on historical data, and sometimes tweaked to optimise results, will play out the same way in future.

There are two other critical issues that can impact results:

Costs, including taxes, vary significantly depending on the jurisdiction and exchange being used; and
Bots usually assume perfect order fills.

That said, we decided to test a number of strategies using bitcoin (BTC) and Ethereum (ETH).

Why just these two?

Because they are volatile, liquid and popular among traders. In a future article, we will look at bots for trading AI stocks. We want to keep things simple, so we used Grok Bot for the analysis and bot development.

Read:
Can AI improve your trading performance?
It turns out AI trading bots behave just like humans …
Recent advancements in artificial intelligence models

Here’s what we found:

The best strategy in terms of overall returns from 1 August 2018 was holding a combination of BTC and ETH in a 70/30 ratio, rebalanced quarterly.

That came out with a total return of 1 011% over the period, equivalent to 34.3% annually. Not bad.

But there were some horrible drawdowns along the way, which is to be expected in crypto.

ADVERTISEMENT

CONTINUE READING BELOW

Traders who wince at 20 or 25% drawdowns on the stock market will find this extremely uncomfortable.

Source: The author

The next-best strategy was to switch between BTC and ETH depending on which was trading above its 200-day moving average.

This delivered an overall return of 1 004%, or 34.2% annually, but also came with some gut-wrenching drawdowns.

Instructions to the bot

Here are the rules used to determine when to switch between BTC and ETH (the bot checks once a week, on Monday morning):

Only one of the two – BTC or ETH – is above its 200-day average: hold that coin;
Both are above their 200-day moving average: hold whichever has gained more over the past 90 days; and
Neither is above its 200-day moving average: sell and sit in cash (USDT, a dollar stablecoin). This happened about 41% of the time.

Holding cash rather than coins during bear trends was critical to boosting performance.

Here’s a chart of the top performer:

Source: The author

Traditional fund managers will be put off by the large drawdowns in crypto, though the old hands are inured to this. It’s certainly not for everyone.

ADVERTISEMENT:

CONTINUE READING BELOW

You could have made 975% had you bought all your BTC in one go on 1 August 2018, but that is unrealistic as it assumes near-perfect market timing.

Rand (or dollar) cost averaging

What about rand-cost averaging, or more properly, dollar-cost averaging (DCA)?

This is where you buy a regular amount of BTC or ETH each week or month, regardless of whether the market is rising or falling.

In this case, we bought weekly. Because we buy and hold using this strategy, it is highly favourable from a tax perspective.

Here, you would have made 381% overall, which is impressive, and DCA is a simple strategy to employ.

We tried tweaking the DCA strategy by buying only when the Fear and Greed index was in ‘Extreme Fear’, but this didn’t help our performance much.

You can keep an eye on the Crypto Fear and Greed index here.

Source: Binance

The Gaussian channel strategy

Then we tried rerunning a strategy we previously tested in 2025 and reported on here.

ADVERTISEMENT:

CONTINUE READING BELOW

It’s called the Gaussian channel trading strategy, which was developed by Michael Automates, who kindly shared his code here.

In essence, the Gaussian channel creates a channel around a moving average to help the trader identify trends. It is a long-only strategy that wins about 28% of the time, with most trades ending in small losses that act as a kind of insurance premium. A few big trades pay for everything.

From 1 January 2018, after 0.15% fees, it made 2 955% (against 500% if you simply bought and held BTC), and its worst drop was 36% against 81% for holding.

That’s pretty impressive, and it validates and betters the results we reported from this strategy more than a year ago.

So this was one strategy that clearly beats all the others we tested.

But there are a few caveats: remove its single best trade, October 2020 to April 2021 (387%), and the total gain falls to about 527%, roughly the same as holding. Remove the best five and it’s slightly negative.

Source: The author

The other caveat is that its future success depends on BTC continuing to have a few major bull runs.

It fails miserably if used for shorting. The advantage of the Gaussian channel strategy is that it gets us out of bear markets quickly, so the drawdowns are less horrendous.

As always, none of this is advice, but perhaps it inspires readers to test some strategies of their own.

#built #bitcoin #trading #bot #pretty #good

Leave a Reply

Your email address will not be published.