logo
  • menu
  • Markets
  • ETFs
  • Live
  • Spot
  • Futures
  • Learn
  • Sign In
  • Sign Up
  • Downloads
  • English
  • |
  • USD
  • |
Sign Up
Crypto PricesLearnLatest NewsDownloadsMarketsSpotAnnouncements
Home/
Learn/
Tutorials

How to Backtest a Trading Strategy and Backtesting Example

By Sherry Cantwell
Aug 15, 2022
4.6 
★
★
★
★
★
★
★
★
★
★
 428 User Rating
Share

Backtesting is one of the key components of developing your own charting and trading strategy. It’s done by reconstructing trades that would have happened in the past with a system based on historical data. The results of backtesting should give you a general idea of whETHer a trading strategy is effective or not.

And what we will be teaching today is how to backtest a trading strategy and provide a backtesting example so that you will be able to grasp the concept easily. Let’s dive right into it!

What is Backtesting?

Backtesting is a tool that you (as a trader or investor) can use when exploring new markets and strategies. The main purpose of backtesting is to inform you whETHer your trading ideas are valid.

You use past market data to see how a strategy would have performed. It can then provide some valuable feedback based on data and tell you whETHer your initial idea was valid. If the strategy looks like it has potential, it may also be effective in a live trading environment.

What to Do Before Backtesting

Before we start with the backtesting example, there is somETHing you should determine. You’ll need to establish what kind of trader you are. Are you a discretionary or a systematic trader?

Discretionary trading is decision-based whereby traders use their own judgment for when to enter and exit. It's a relatively loose and open-ended strategy, where most of the decisions are up to the trader's assessment of the conditions at hand. As such, backtesting is less relevant when it comes to discretionary trading since the strategy isn’t strictly defined. This doesn’t mean that you shouldn’t backtest or paper trade at all – it just means that the results may not be as reliable as in the other case.

Systematic trading is more applicable to backtesting. Systematic traders rely on a trading system that defines and tells them exactly when to enter and exit. While they have complete control over what the strategy is, the entry and exit signals are determined by the strategy. Some traders prefer this approach as it can eliminate emotional decisions from trading and provide a reasonable degree of assurance that a trading system is profitable. You could think of a simple systematic strategy as:

- When A and B happen at the same time, enter a trade.

- When X happens after, exit the trade.

Though, it is important to make sure that you have very specific rules in your system for when to enter or exit positions. If the strategy isn’t well-defined, the results will be inconsistent as well. As you might expect, this kind of trading style is more popular with algorithmic trading.

There is backtesting software out in the market that you can buy if you want to do automatic backtesting. You can input your own data, and the software will do the backtesting for you. However, in this example, we’ll go for a manual backtesting strategy. It’ll take a little bit more work, but it’s completely free.

How to Backtest a Trading Strategy

You can look up Google and find a spreadsheet that gives you a general idea of what information a backtesting sheet may contain. Some traders will prefer to use Excel or code it in Python – there aren’t strict rules here. You can add much more data and anything else you may deem useful to it.

Let’s backtest a simple trading strategy on this idea:

We buy one Bitcoin at the first daily close after a golden cross. We consider a golden cross when the 50-day moving average crosses above the 200-day moving average.

We sell one Bitcoin at the first daily close after a death cross. We consider a death cross when the 200-day moving average crosses below the 50-day moving average.

As you can see, we also defined the time frame where the strategy is valid. This means we won’t consider it a trading signal if a golden cross happens on the 4-hour chart.

For the sake of this example, we’ll only look at the time period going back until the start of 2019. However, if you’d like to get more accurate and reliable results, you could go back much further in Bitcoin’s price action.

Now, let’s see what trading signals this system produced for the period:

- Buy @ ~$5,400

- Sell @ ~$9,200

- Buy @ ~$9,600

- Sell @ ~$6,700

- Buy @ ~$9,000

Our first trade would have turned a profit of about $3800, while our second trade resulted in a loss of about $2900. This means our realized PnL is currently $900.

We’re also in an active trade, which, as of December 2020, has about $9000 unrealized profit. If we stick to our initially defined strategy, we’ll close this when the next death cross happens.

Evaluating Backtesting Results

So, what do these results show? Our strategy would have turned over a reasonable return, but it doesn’t show anything that outstanding so far. We could realize the currently open trade to drastically increase our realized PnL, but that would defeat the purpose of backtesting. If we don’t stick to the plan, the results won’t be reliable either.

Even though this is a systematic strategy, it’s also worth considering the context. The unprofitable trade from $9600 to $6700 was at the time of the March 2020 COVID-19 crash. Such a black swan event can have an outsized influence on any trading system. This is another reason why it’s worth going back further to see if this loss is an outlier or just a byproduct of the strategy.

In any case, this is how a simple backtesting process may look like. This strategy might have promise if we go back and test it with more data or include other technical indicators to potentially make the signals it produces stronger.

But what else can backtesting results show you?

- Volatility measures: your maximum upside and drawdown.

- Exposure: the amount of capital you need to allocate for the strategy from your entire portfolio.

- Annualized return: the strategy’s percentage return over a year.

- Win-loss ratio: how much of the trades in the system result in a win and how much in a loss.

- Average fill price: the average price of your filled entries and exits in the strategy.

These are just a few examples and not an exhaustive list by any means. What metrics you’d like to track is completely up to you. In any case, the more details you journal about the setups, the more opportunities you’ll have to learn from the results. Some traders are very rigorous in their backtesting, and it may also reflect in their results.

Closing Thoughts

And that is it for how to backtest a trading strategy with a backtesting example included, where we went through the basic process of how to do a manual backtest of a trading strategy. Remember, past performance isn’t a guarantee for future performance.

Market environments change, and you’ll need to adapt to those changes if you’d like to improve your trading. Generally, it’s also useful not to blindly trust the data. Common sense can be a surprisingly useful tool when it comes to evaluating results.

Disclaimer: The information on this page may have been obtained from third parties and does not necessarily reflect the views or opinions of BitKan. This content is provided for general informational purposes only, without any representation or warranty of any kind, nor shall it be construed as financial or investment advice. BitKan shall not be liable for any errors or omissions, or for any outcomes resulting from the use of this information. Investments in digital assets can be risky. Please carefully evaluate the risks of a product and your risk tolerance based on your own financial circumstances. Products mentioned in this article may not be available in your region.

Related Articles

  • What Is Circle Arc Whitepaper? How to Join Circle Arc Testnet?

    What Is Circle Arc Whitepaper? How to Join Circle Arc Testnet?

    The Arc whitepaper serves as the foundational technical blueprint for a next-generation Layer 1 blockchain built by Circle to integrate programmable stablecoins with on-chain financial innovation.
    Sherry Cantwell
    May 13, 2026
  • How to Find Your Bitcoin Wallet Private Key Safely (Without Scams)

    How to Find Your Bitcoin Wallet Private Key Safely (Without Scams)

    Bitcoin private keys are one of the most important parts of cryptocurrency security. This guide explains how private keys work, where to find your own wallet’s private key, and how to protect it from theft or scams.
    Craig Green
    May 11, 2026
  • What is Western Union USDPT? How to use it on Solana?

    What is Western Union USDPT? How to use it on Solana?

    USDPT is a U.S. dollar-backed stablecoin issued by Anchorage Digital Bank and hosted on the Solana network.
    Cornell Rachel
    May 8, 2026

Latest Articles

Crypto Basics

Tutorials

Currencies

Investing

  • What Are Short Liquidations? How Can Traders Prevent Them in Crypto?

    What Are Short Liquidations? How Can Traders Prevent Them in Crypto?

    A short liquidation is a mandatory event within derivatives markets where a cryptocurrency exchange automatically closes a leveraged short position.
    Cornell Rachel
    Jun 22, 2026
  • What Is Rehypothecation Risk in Crypto? How to Protect Yourself

    What Is Rehypothecation Risk in Crypto? How to Protect Yourself

    Rehypothecation is a practice where a lending platform takes collateral pledged by its clients and uses it for its own purposes.
    James Dean
    Jun 17, 2026
  • What Is pERC20? How Does This Ethereum Token Standard Work?

    What Is pERC20? How Does This Ethereum Token Standard Work?

    The pERC-20 framework is an experimental Ethereum Improvement Proposal designed to fundamentally alter how standard tokens operate on public networks,
    Jun 12, 2026
  • What Are Crypto Prediction Markets? A Complete Guide for Beginners

    What Are Crypto Prediction Markets? A Complete Guide for Beginners

    Crypto prediction markets are peer-to-peer decentralized financial platforms where participants trade contracts tied to the outcomes of real-world events, such as elections, sports, or economic data releases.
    Jun 12, 2026
  • What is the MSX X Card? Understanding the New Crypto Card

    What is the MSX X Card? Understanding the New Crypto Card

    The MSX X Card is a financial instrument launched by the MSX Maitong platform that functions as a payment gateway for digital assets
    James Dean
    Jun 8, 2026
View more data 

Content

BTCBTC(BTC)
$0
--(Last 24h)
SpotFutures

Top

View more
  1. 1How To Sign Up For A BitKan Account (Web)?
  2. 2When Is Bitcoin Halving 2024? What Does Bitcoin Halving Do?
  3. 3What is Etherscan Used For and How to Find Token Decimal on Etherscan
  4. 4What is USDC used for? Why is USDC used?

Top Gainers

View more
Audiera
AudieraBEAT

$2.6812

+58.35%
Solstice
SolsticeSLX

$0.2903

+48.80%
Heima
HeimaHEI

$0.1229

+37.63%
Gravity
GravityG

$0.003470

+34.50%
BNB Attestation Service
BNB Attestation ServiceBAS

$0.0343

+23.77%

Top Trending

View more
Audiera
AudieraBEAT

$2.6729

+57.86%
Monero
MoneroXMR

$325.080

+1.09%
Alephium
AlephiumALPH

$0.0669

+18.86%
Yooldo Games
Yooldo GamesESPORTS

$0.0369

+17.52%
LAB
LABLAB

$16.1231

-4.48%

Recently added

View more
Arcium
ArciumARX

$0.3007

-15.01%
Ambire AdEx
Ambire AdExADX

$0.0554

-0.54%
Re
ReRE

$0.7343

-10.94%
o1 exchange
o1 exchangeO

$0.5489

-6.81%
SpaceX
SpaceXSPCXB

$156.530

+5.28%

Latest News

View more
  1. 1Uniswap Soars 22% as Altcoins Rally While Bitcoin Stalls
  2. 2HYPE Surges 6%: Suspected Insider Whale Nabs $34M in Gains
  3. 3SpaceX Prices Record $75B IPO at $135, Hits $1.8T Valuation
  4. 4Stablecoin Secondary Market Rules Pit Banks Against Crypto
  5. 5Bitcoin and Gold Tumble Amid Rising Inflation and Rate Bets
About Us
  • About BitKan
  • Contact Us
  • Announcements
  • VIP Program
  • BitKan Ambassador
  • Institutional Services
Products
  • Spot
  • Futures
  • Crypto Prices
  • Learn
  • News
  • Markets
  • How to Buy Crypto
  • BTC to USD Calculator
  • Reward
Help
  • Help Center
  • Email Us
  • Live Chat
  • Download APP
  • Listing Application
  • Buy Bitcoin
  • Buy Ethereum
  • Buy Dogecoin
  • Buy Altcoins
Terms
  • Terms of Use
  • Privacy Policy
  • Trading Rules
  • Fee
K-Site
English
About Us
+
  • About BitKan
  • Contact Us
  • Announcements
  • VIP Program
  • BitKan Ambassador
  • Institutional Services
Products
+
  • Spot
  • Futures
  • Crypto Prices
  • Learn
  • News
  • Markets
  • How to Buy Crypto
  • BTC to USD Calculator
  • Reward
Help
+
  • Help Center
  • Email Us
  • Live Chat
  • Download APP
  • Listing Application
  • Buy Bitcoin
  • Buy Ethereum
  • Buy Dogecoin
  • Buy Altcoins
Terms
+
  • Terms of Use
  • Privacy Policy
  • Trading Rules
  • Fee
K-Site
+
  • Twitter
  • Facebook
  • Telegram
  • YouTube
  • Instagram
  • Medium
  • Linkedin
@2012-2026 BITKAN.com