@

What Are Backtesting And Papertrading and How to Use Them in Algorithmic Cryptocurrency Trading

Mon Apr 24 2023

backtesting and papertrading charts

Backtesting can be a great tool for traders and investors who want to optimize their engagement with financial markets. This process involves testing a trading strategy using historical data to determine how profitable it could potentially be. Paper trading on the other hand, tests a strategy by allowing it to run on the market in real time, but using fake “paper” money.

Both approaches have their own set of benefits, and they can be applied to both manual trading as well as algorithmic crypto trading.

How Does Backtesting Work?

A well-conducted backtest can provide assurance that the strategy is viable and can be implemented in a real trading environment.

The underlying premise behind backtesting is that what worked in the past may work in the future. However, this can be challenging to determine, as a trading strategy that was profitable in one market environment may not work in another. Backtesting with a misleading dataset can lead to less than ideal results, making it crucial to find a good sample for the backtesting period that reflects the current market environment.

Before conducting a backtest, traders should determine what they would like to find out, such as what would make the strategy viable and what would falsify their assumptions. Backtesting should also include trading and withdrawal fees, along with any other costs that the strategy may incur. It’s worth noting that backtesting software can be expensive, as access to high-quality market data is vital.

Furthermore, it may not always be possible to backtest your strategy. For instance, if you’re using a crypto trading bot that’s based on one second candlesticks, you may have a hard time finding a backtesting tool that goes so granular.

Backtesting Example

Let’s walk through a simple strategy for Bitcoin. We buy Bitcoin at the first weekly close above the 20-week moving average and sell it at the first weekly close below the 20-week moving average. This strategy produces few signals per year. When tested from 2019, the strategy produced five signals, with a rough benchmark indicating profitability.

Backtesting vs. Paper Trading

Paper trading is the simulation of a strategy in a live trading environment, without risking any funds. This provides traders with an additional step to improve their strategy and get an idea of its performance. However, traders need to be wary of “cherry-picking,” which is selecting only a subset of data to confirm a biased viewpoint.

How does Paper trading work?

Paper trading in most cases “pretends” to place a trade on the exchange, and in turn simply returns the buy price and timestamp. Periodically, an algorithmic trading strategy running in paper trading mode will fetch the current price of the asset it’s paper trading to check the current profit. All aspects of the strategy work like normal, only a trade is never actually placed, but instead paper trading tools just store the data locally. Because of this, you’re not really competing in an exchange order book so real life results might be marginally different.

Closing Thoughts

Before deploying a strategy on the live market, it’s advised that you are as thorough as possible in your testing and this generally means running your strategy through backtesting and paper trading when possible. Æsir offers free paper trading mode so you can build and test on your crypto trading bots on our platform before deploying them to the live market.

@SIR

©DEM Group 2024