We analyze the altcoin’s relative performance against Bitcoin by using the time-based candlestick data with Python, SQL, Pandas and matplotlib.

Note: this is not investment advice. Past performance is no guarantee of future results. Always do your own research.

Introduction

The change in the price of Bitcoin is the main driving force behind the change in the price of altcoins. When the price of Bitcoin rises, the majority of altcoins tend to follow the price change. The same is true when the price of Bitcoin falls. Due to this dependence, the overall crypto market is determined by the price of Bitcoin, both in the short term (1m candlesticks, 5m candlesticks) and in the long-term (1d candles, 1w candles).

Given that we cannot establish the probability of the Bitcoin price going neither up nor down at the next point in time, we can say that at any point in time we have a 50% chance of going up and a 50% chance of going down in the immediate future. We ask the following: if the Bitcoin price does go up at the next point in time, will the altcoins follow in the same direction, and if they do follow, how much will they follow relative to the price change of Bitcoin.

The dataset

To answer these questions, we develop a simple candlestick scraping script in Python. The script collects 1-minute candlesticks and has the following structure:

1m candlestick dataset

The dataset is sampled at 1-minute intervals and contains the opening price, the highest achieved price, the lowest achieved price, the closing price, the trading volume, and the coin symbol.

Modeling

Instead of modeling the actual cryptocurrency price, we model the relative percentage change of the price from each candle onto the next one. If the price in the next candle increases, we calculate the percentage of that increase and place it on a line plot using matplotlib.

This way we can compare the relative percentage change of the price between Bitcoin and any altcoin on a linear y-axis. This allows us to compare the performance of altcoins against Bitcoin even if their absolute prices are orders of magnitude apart, such as in the case below, where the price of Bitcoin is compared to the price of Apecoin.

Comparison of Bitcoin and Apecoin price percentage change

By plotting both series on the same chart, we can visualize four distinct characteristic behaviors that will provide insight into the relative performance of an altcoin against Bitcoin.

  • Undercompensation on high – Bitcoin price increases and the altcoin follows with lesser magnitude, performing worse than Bitcoin. In this case, the altcoin gained less than Bitcoin.
  • Overcompensation on high – Bitcoin price increases and the altcoin follows with a greater magnitude, performing better than Bitcoin. In this case, the altcoin gained more than Bitcoin.
  • Undercompensation on low – Bitcoin price decreases and the altcoin follows with a lesser magnitude, performing better than Bitcoin. In this case, the altcoin lost less than Bitcoin.
  • Overcompensation on low – Bitcoin price decreases and the altcoin follows with a greater magnitude, performing worse than Bitcoin. In this case, the altcoin lost more than Bitcoin.

For placing long trade orders on altcoins against Bitcoin, we want as much overcompensation on high and undercompensation on low as possible.

For placing short trade orders on altcoins against Bitcoin, we want as much undercompensation on high and overcompensation on low as possible.

It is clear from the example above that Apecoin is more volatile than Bitcoin, but we still don’t know if we should place a long or short order on the APE/BTC pair. However, would it help if we counted the occurrences of the four characteristics explained above? Suppose we know that the number of occurrences of overcompensation on high greatly exceeds the number of occurrences of undercompensation on high, meaning that in the majority of cases when Bitcoin goes up, the altcoin follows with greater magnitude. Or that the occurrence of undercompensation on low greatly exceeds the occurrence of overcompensation on low, meaning that in the majority of cases when Bitcoin goes down, the altcoin follows with lesser magnitude.

By performing data analysis in Python we can count the number of occurrences of each of the four characteristics. If the analysis shows that all four characteristics occur equally, then there is no support to place either the long or the short order. But if the data analysis shows that certain characteristics occur more often than the others, then there could be enough support to a long or a short order, depending on the analysis results.

High-frequency comparison of Bitcoin and Apecoin price percentage change

By counting and comparing the occurrences of the defined characteristics we can determine the most likely outcome of both positive and negative imminent price changes on 1-minute crypto candles. In other words, we can find the altcoin that should, if the trend continues, gain more when Bitcoin rises and lose less when Bitcoin falls.

Further modeling

We can further develop the model by combining the methodology described above with the mapping of the absolute price change of Bitcoin and the altcoins from the referent discrete-time point.

Absolute price change of Bitcoin and the altcoins from the referent discrete-time point

By combining both methods we can achieve a greater level of decision support.

Conclusion

The described methodologies are used to establish a decision-support system for comparison and prediction of the relative performance that altcoins have against Bitcoin. The methods defined above, together with numerous more complex methodologies, are integrated into Endurio’s data science for crypto trading algorithms. If you wish to see how the described methodologies are used in the algorithmic ranking of the new crypto projects, consider trying our products.

Leave a Reply

Your email address will not be published.