AI Trading Bots: Pitfalls, Profit Erosion and a Solution

Dimas Solorio
Coinmonks
4 min readAug 31, 2022

--

AI trading bots pitfalls metaphor: The Four Horsemen of the Apocalypse
Four Horsemen of the Apocalypse, an 1887 painting by Viktor Vasnetsov.

Conventional or AI trading bots almost always don’t deliver the returns expected from backtesting and advertising in real crypto trading. And, this applies whether you develop the trading bots by yourself or use a paid solution. The Medium blogger _gk attributes this to the ‘4 Horsemen of Profit Erosion’. We’ll discuss what this means and how SmithBot, the leading AI trading bot for crypto, avoids these harmful effects.

Most traders developing a crypto trading bot try different strategies with different parameters, until it generates profits in backtesting. Sometimes, this process is supported by some sort of machine learning. The same setup, however, will not generate profits over the long run in real-life trading in most cases. Unfortunately, many providers of commercial trading bots use the same naive approach.

Common Pitfalls in Trading Bots Development

  1. Exchange spread (and slippage)
    (market) orders at an exchange execute at a price that is always worse than the mid-point price. Because of spread and limited liquidity, your average execution price will differ, sometimes significantly. Most traders are testing their algos on easily obtainable historical OHLCV candlestick data. But, it contains only a few price points within a time interval and the real price of execution is unknown.
  2. Gap-effects
    occur when two neighboring candles in a candlestick diagram have no overlap. This is caused by time resolution of the diagram and can, in fact, occur at any scale. The algorithm generates the order entry or exit signal at the end of each candle. Only then is the data available for analysis as we cannot use information from the future. But by then the actual price has already moved a lot and your execution price is much worse than predicted.
  3. Trailing stop-loss opaqueness
    in short: backtesting stop-loss accurately in historical candlestick diagrams is impossible. This order type will trigger on an exchange when the real-time data crosses a certain moving threshold. Such a trigger might be missed or a trigger might be activated when it actually wouldn’t, due to the incomplete time-series data in candlesticks. The gap in results between backtesting and real-trading grows huge in such cases.
  4. Exchange fees
    Most exchanges charge a small commission on every order which will reduce your profits. This becomes especially noticeable when you do high-frequency trading with many trade with small nominal profits. The fees are accumulating quickly with the number of orders. Most strategies and their backtesting praised on social media do not account for fees and appear therefore miraculously profitable.

Divergence between backtesting results and live trading will always exist. No backtest is perfectly accurate.

Solutions to the AI Trading Bots Backtesting Problem

So, how does the leading AI crypto trading bot avoid these common pitfalls? SmithBot is one the very few trading bot providers that doesn’t work on OHLCV candle stick data. Its huge competitive advantage is partially owed to the fact that they collected years of sub-second resolution spread data for all important trading pairs and high-resolution order book data, many Terabytes in fact. This enables an absolutely precise backtesting simulation completely avoiding the first 3 of the pitfalls.

In addition, SmithBot includes the fees in every simulated order and a statistical model estimates the slippage depending on the trading volume and exchange liquidity. SmithBot informed that they were running many tests to confirm their simulation models by doing forward live-trading for an extended period of time and then backtesting the same period afterwards. If both trials show the same results within very small margins, it is proving that they indeed solved the complexity of accurate backtesting. The 4 Horseman are defeated!

SmithBot uses yet another lever to maximize the agreement between backtesting and live-trading: low-frequency trading. Preferring fewer trades with higher average profits severely limits the negative impact of trading fees and slippage on the overall profitability.

Finally, after thorough training and backtesting, SmithBot deploys each AI trading bot only after undergoing strict live testing. This highest level of quality control ensures that they only offer the best crypto trading bots with the highest chances of succeeding making sustainable profits in the long-term average.

Conclusion

Many pitfalls originating from subtle flaws in backtesting ruin the real-life profits of most crypto trading bots. The substantial difference between the real-time data used by the exchanges and the candlestick data used by traders is often the root cause of it. This has a large impact when determining the price of an order or the trigger of trailing stop-loss and take-profit orders.

The solution is obviously to use the same kind of time-series data to run your strategy as the exchanges use. However, the exchanges usually do not provide historical high-resolution spread and order book data. Therefore, leading crypto trading bot developers need to spend years to collect this high-quality data before they can start training and testing their AI trading bots.

Also read,

New to trading? Try crypto trading bots or copy trading

--

--