Skip to content
Request a Demo

Overview

AmberLens, Amberdata’s market intelligence solution, provides analysts and investors with the tools they need to make important market judgments across the digital asset space. In this paper, we will leverage the AmberLens Institutional Bitcoin Metrics, to assess the value of each one in trading strategies. To do this, we will use the metrics as signals for trading strategies, backtesting each of them to identify winning strategies. We will then analyze the best and worst-performing backtests to understand how to improve and develop a more effective strategy.

Follow along with our code samples here!

Introduction

The transparency of the digital asset space provides a wealth of information. AmberLens brings this information to the forefront, providing a quick and easy lens to identify the metrics that are driving the market. By utilizing these metrics, traders are given simple heuristics that allow them to make more effective decisions about market cycles, sentiment, and more.

We will evaluate the value of these metrics by running backtests on Bitcoin trading strategies that use AmberLens’ Bitcoin Institutional Metrics. In all of our backtests we start with the same base assumptions: $100k in cash, and a 0.2% trading fee on every trade. All trading starts from January 1st, 2015, and terminates on July 9th, 2024. Furthermore, we will do simple trade strategies only: we will buy out all of our equity if a buy signal is reached, and we will close our position if the sell signal is reached – portfolio management strategies such as buy sizing can often increase the effectiveness of these strategies, but for simplicity, we’ve opted to use the full weight of our portfolio on trades. Additionally, each strategy has two tests: the first with no stop-loss and the second with a 10% stop-loss on each position, to mimic more realistic trading conditions. We will be using backtesting.py to conduct our backtests.

Some key metrics we will explore are equity final, return (%), Sharpe ratio, Sortino ratio, the Calmar ratio, the max and average drawdown, and the expectancy:

  • Equity Final: The final dollar amount after running the strategy.

  • Return (%): The percent growth from the initial $100,000 starting equity.

  • Sharpe Ratio: Measures reward relative to risk. A high, positive Sharpe ratio indicates a strong risk-adjusted performance, and a low, negative Sharpe ratio indicates that the risk-free benchmark would have outperformed the portfolio.

  • Sortino Ratio: A variation of the Sharpe ratio that only considered the downside risk instead of positive risk. Interpretation is the same as the Sharpe ratio, but it does not penalize for positive volatility.

  • Calmar Ratio: The Calmar ratio is similar to the previous two except that the denominator is maximum drawdown, which could be thought of as the fund’s maximum loss from top to bottom over a period of time.

  • Max Drawdown (%): Drawdowns are the percent difference between the peak and trough of an equity curve. The max drawdown is the largest peak to trough percent difference among all drawdowns.

  • Avg Drawdown (%): This is the average peak to trough percent difference among all drawdowns in a backtest.

  • Expectancy (%): This is the percent won times average win size minus percent loss times average loss. In simpler terms, this measures how much you could expect to make on each trade.

Designing a Strategy

Our trading logic for each metric is simple: if there is an inherent strategy (i.e. the metric is
a top or bottom signal), we follow the signal behind that metric. For example, realized cap crossing the market cap is a buy signal, so we will make a buy order using all of our capital (as per our trading strategy). If a metric is only a bottom indicator, then we may add an X% take profit price – closing positions to take profits if the gain is sufficiently high.

In some cases, a metric may not offer an inherent strategy: for example, the address balance buckets which indicate the number of addresses that hold some range of bitcoin do not inherently suggest a top and bottom signal and are more useful for market sentiment analysis. In these cases, we will do light data manipulation to come up with a simple strategy that utilizes these metrics. In some cases, we may also combine metrics to form a top and bottom strategy: for example realized cap crossover and pi cycle top indicator give us a bottom and top signal.

Buy & Hold Buy on first day - Bitcoin Price & Moving Averages 10 day SMA crosses 30 day SMA 30 day SMA crosses 10 day SMA Realized Cap Realized cap is lower than market cap Take profit at 10x position Bitcoin Yardstick Yardstick is below -1 Yardstick is above 2 MVRV MVRV-Z < -1 MVRV-Z > 3 Reserve Risk Reserve risk < 0.001 Reserve risk > 0.003 Pi Cycle Top Buy if you have no position 111 MA and Pi Cycle cross while price is high Realized Price If realized price < market price Take profit at 3x position NUPL If NUPL > 0.5 IfNUPL<0 Monthly Hold Net Position Change If there have been two months of consecutive holds If there have been two months of consecutive drops Puell Multiple If Puell Multiple < 1 If Puell Multiple > 4 Daily Address Activity When daily passive addresses < daily active addresses When daily passive addresses > daily active addresses

Miner Supply Spent When miner supply spent < 0.5 When miner supply spent > 2 Miner Position Index When MPI < -1 WhenMPI>5 Percent of Supply in Profit 30dayMAis<45% 30dayMA>80% New Address Momentum 30dayMA>365dayMA 30dayMA<365dayMA Liquid vs Illiquid Supply Liquid relative growth < -0.05 Liquid relative growth > 0.1 BTC Hold Waves When 1+ year Hold wave % is <40% When 1+ year Hold wave % >50% BTC Balance Buckets: # of Addresses numWhales < -1000 numWhales > 1000 BTC Balance Buckets: Supply Held Change in whale supply > 2000 Change in whale supply < -2000 Realized Cap + Pi Cycle Top Realized cap is lower than market cap 111 MA and Pi Cycle cross

The table above shows a summary of our backtested trading strategies, with the full code available on GitHub. Some strategies were enriched by doing some basic manipulation in order to get a more informative metric. For example, in the BTC balance buckets, numWhales is the number of BTC addresses that hold more than 1 BTC. Whether this is a definition of a whale or not is not the important focus, we are simply choosing to bucket all users with more than 1 BTC to see how their movement impacts the market. Another example of an enriched metric is in liquid and illiquid supply, where we trade on liquid relative growth. Liquid relative growth is the percent growth of liquid BTC relative to the amount of liquid BTC in the month prior. This allows us to better capture changes in liquidity and overall trend of loss or growth in liquid BTC, which is known to impact price.

Strategy Case Studies

In this section, we will explore a few of the strategies we backtested to analyze and understand the strengths and weaknesses of each one. Each strategy will be accompanied by four graphs: an equity curve graph showing change in equity over time, a Profit / Loss graph showing whether trades were in profit or loss, a price chart with trades made overlayed on historical BTC prices, and a volume chart showing trading volume over time. The price chart with trades includes red and green dashed lines, which indicate whether that trade ended in a loss (red) or profit (green). The equity curve chart also shows the max drawdown period.

Buy and Hold & SMA Cross

Amberdata Buy and Hold backtesting performance

Buy and Hold backtesting performance

We start our backtesting analysis with our baseline strategies. The first one, Buy and Hold, should be a very familiar strategy. Here there is only one trade, which is buying on the first day, and holding until the last day. This strategy performs markedly well, outperforming more than half of the other proposed strategies. With a strong return of 20,051%, it is relatively hard to beat buy and hold’s strategy, which makes it a good baseline to compare against others. Of course, its Sharpe ratio is relatively low with a value of 0.53 since Bitcoin is a highly volatile asset, which strongly penalizes risk. The Sortino ratio, which only looks at the downside risk, is much higher since from the first trade most of the risk is in the positive direction.

Simple Moving Average (SMA) Cross with 10% stop-loss backtesting performance.

Simple Moving Average (SMA) Cross with 10% stop-loss backtesting performance.

The next baseline we will analyze is the Simple Moving Average (SMA) Cross, a widely used and effective strategy that uses two moving averages (MAs) to determine buy and sell signals. For our backtest, we used a 10-day and 30-day MA. While these two periods were chosen because they are standard, it is common practice to do a grid search for the optimal period for each MA. Coincidentally, 10 and 30 is relatively performant, with SMA Cross serving as a strong baseline with a return of 14,984% and a stronger risk adjusted ratio than Buy and Hold in all three ratios (Sharpe, Sortino, and Calmar). When we add stop-loss to Buy and Hold, our strategy improves significantly with a return of 27,099%, which outperforms Buy and Hold.

Given the simplicity of these two trading strategies, it is important that any other strategy we test is able to outperform the returns on these baselines.

NUPL

Net Unrealized Profit Loss (NUPL) backtesting performance

Net Unrealized Profit Loss (NUPL) backtesting performance

Net Unrealized Profit Loss (NUPL) backtesting performance with 10% stop-loss

Net Unrealized Profit Loss (NUPL) backtesting performance with 10% stop-loss

While this next strategy performs well, it fails to beat our baselines. The Net unrealized profit / loss (NUPL) strategy has a return of 2,360%, and a Sharpe ratio of 0.7. In our NUPL strategy, we buy when NUPL is less than -1, and sell when NUPL is greater than 3. NUPL can act as a measure of market confidence, and so when NUPL is subjectively low, indicating that most of the market is at a loss, we can consider the market to be at a discount. Likewise, if NUPL is high, then our metric indicates that most of the market is in profit, and so we should cash out our position.

If we look at the graph above, we can actually see that trading on NUPL does actually have good trades: every trade performed has a positive return. However, our sell condition is too aggressive and we attempt to take profit before Bitcoin has hit its peak. Therefore, we see a return that is much lower than SMA Cross and Buy and Hold. Things get even worse when we add stop-loss, as NUPL does not have a strong bottom indicator, it causes the strategy to sell too early before we can claim our gains. In a realistic trading scenario however, this is the most likely outcome as traders would not want to take on too much risk of a falling price of BTC. Not all is lost, of course, as we could improve this backtest by tuning our sell condition on NUPL, or possibly using a different top signal. This is a strategy that offers many different avenues to improvement, and is worth exploring further.

Puell Multiple

Amberdata Puell Multiple backtesting performance

Puell Multiple backtesting performance

The Puell Multiple (PM), a metric created by David Puell, measures daily coin issuance over the 365 day MA of coin issuance. For our trading strategy, we buy when the PM is less than 1, and we sell when the PM is greater than 4, as a PM less than 1 indicates that miners are at a loss, while a PM of 4 indicates that miners are outperforming the market. Given the nature of this strategy, we only end up with two trades, but both trades perform well. This strategy yields a return of 28,279% only slightly beating out SMA Cross’s 27,009% return. This is a good indication of how a simple, easy to use metric can provide valuable timing information with regards to market cycles. However, the Puell multiple does not do well at predicting market bottoms, so our threshold for selling ends up being too high and it fails to claim gains at market peaks.

Amberdata Puell Multiple with 10% stop-loss on each position

Puell Multiple with 10% stop-loss on each position

Things worsen significantly once we introduce stop loss. Because the PM entered on the downward slope of a market cycle, stop loss kicked in and closed positions as the price slid down 20% over the course of 2017. This is not unreasonable of course, since it is normal to protect one’s position in the market. However, this results in a large drop in return from around 28,000% without stop-loss to roughly 23,000% with stop loss, meaning our stop loss version fails to beat out SMACross’s return of 27,000%. Stop-loss is important in strategies to prevent overfitting: in retrospect, it is obvious that we should hold through the 2017 downward cycle, but at the time, it was not clear whether BTC would recover or not and taking a 10% loss on your BTC portfolio is unpalatable for most traders.

To improve this strategy, we can work on improving our sell signal via tuning. The current sell signal is not aggressive enough in predicting peaks, and so we can run a grid search in order to optimize for return. This can tune our sell parameter to a lower number so that we are able to capture the top of market cycles and claim our gains. The buy signal is also too early, and could potentially be tuned to be lower so that it enters at a lower part of the market cycle.

MVRV-Z

MVRV-Z backtesting performance

MVRV-Z backtesting performance

MVRV-Z backtesting performance with 10% stop-loss

MVRV-Z backtesting performance with 10% stop-loss

The MVRV-Z is the Z-score of the ratio of market value to realized value, where high values of MVRV indicate market tops and low values of MVRV indicate market bottoms. For our trading strategy, we will buy when MVRV is less than -1, and buy when MVRV is greater than 3.

Similar to the Puell Multiple, we have a relatively low number of trades, but it still produces great results with a high return of 185,842%, blowing our baselines out of the water. It is easy to see why as well: by looking at the graph above, we can see that our strategy does an amazing job of finding market lows, and predicting market tops. Adding stop-loss does markedly lower our return at 156,263%, nearly 30,000% less in return, but is still much better than our baselines and is more realistic in a live trading scenario. This strategy can also be greatly improved upon by adding order sizing and other market orders such as shorts. Shorting will allow us to take advantage of our knowledge of market tops by giving us an option to gain when we know the market will go down.

Download the full report here as this is just the subset of the report which also includes Realized Cap, Results, Future Work, and more!

Pulling Signal from the Noise: Trading AmberLens' Institutional Bitcoin Metrics

Amberdata Blog

View All Posts