How and with what to analyze the connections of cryptocurrency pairs? (2024)

Author: Evgenii Bodiagin

From author: Cooperation proposal for the supply of data

How and with what to analyze the connections of cryptocurrency pairs? (2)

How to analyze the relationship of cryptocurrencies? What are the laws governing the movement of cryptocurrencies? What are the features in the movements of the crypt?

Content:

  1. Introduction.
  2. Is everything all right with your distribution?….
  3. Extraction of data on cryptocurrencies. Active cryptopairs.
  4. How is the crypto market moving? …
  5. A nonparametric tool for analyzing relationships between pairs of cryptocurrencies
  6. Conclusion.

Not so long ago, our world was replenished with another phenomenon: cryptocurrencies. At first, they were treated as a tool that only geeks are interested in. Today it is obvious that the “crypt” is becoming a backbone. Its mysteriousness, frightening volatility attracts more and more people: from speculators to lovers of conspiracy theory. There is a natural desire to understand the movement of the crypt. The urge to organize and “put everything on the shelves” forces you to turn to data processing tools. Very often these tools are used not quite, to put it mildly, correctly.

For example, in the flow of information about cryptocurrency markets, a lot of attention is paid to the research of cryptocurrency connections. Which cryptocurrencies rise / fall at the same time (have the same movement vector)? AND…. on the contrary — which have the opposite direction. The answers to these questions can enrich the investor in the truest sense of the word. This task is a classic task of correlation analysis. It would seem … we take the quotes of cryptocurrencies … a package of spreadsheets. “Go” and done. But … I remember a phrase from an advertisem*nt: “not all yoghurts are equally useful.”

The subtleties, as they say, are in the details. The fact is that the methods for calculating correlations are different. Spreadsheets use Pearson’s correlation, although it is referred to simply as “correlation.” But there is one but. Pearson’s correlation is only possible if the data we are trying to analyze is normally distributed.

Let’s remember what the normal distribution is. First there will be boring formulas, then an entertaining example. So, a one-dimensional random variable that corresponds to a normal distribution has the following probability density function:

How and with what to analyze the connections of cryptocurrency pairs? (3)

Behind the eyes, it is also called the Gaussian function;) It has only two parameters. First: µ is the mathematical expectation (mean), median and distribution mode. Second parameter: σ — standard deviation (σ2 — variance) of the distribution. The probability density function has the following graphical representation:

How and with what to analyze the connections of cryptocurrency pairs? (4)

In order to describe the normal distribution without formulas, consider, for example, the height of the people around us. Think of your friends, acquaintances, work colleagues. Are there many giants among them? Are there many people of extremely small stature among them? The most common value is likely to be “average height”.

The normal distribution has another remarkable property. We measure three standard deviations down from the average height. We measure three standard deviations up from the average height. 99.73% of your subjects will be within this range. In other words, the lion’s share of the sample is within the “three sigma” range.

Imagine now that we are in the fabulous Middle Ages. In addition to people, other creatures live on earth: giants, gnomes. Dragons hover in the sky. Elves lurk in the woods. Let’s form a sample of the growth of fantastic creatures. As you can see, the histogram has heavy tails.

How and with what to analyze the connections of cryptocurrency pairs? (5)

Why? It’s simple — a meeting with a gnome or a giant is not so rare. The distribution of the height of the inhabitants of the fairy forest differs significantly from the normal one.

It is especially worth noting that if a random variable is affected by many random variables that are practically independent of each other, the behavior of such a random variable is described by a normal distribution. The normal distribution is fairly well understood. A lot of data processing techniques are based on it. The Pearson correlation, which requires normality, is only one in a thousand instruments. And here a fundamental question arises. What is the distribution of price changes in cryptocurrencies?

We will consider the Binance crypto exchange as a source of data on cryptocurrency pairs. We will use Python 3.7.7 as processing tools. We use libraries such as: scipy, numpy, pandas, plotly.

At the time of this writing, we have historical data on 600 cryptocurrency pairs. We will consider daily data. Data mining is done using the Binance API. The sample size is 90 days. The subject of consideration will be the following indicator:

Growth_rate_Close = Close_temp_day / Close_last_day

Those. if, for example, this ratio is 1.015, the closing price has increased by 1.5%. If the value, for example, is 0.98, then the price has dropped by 2%. Thus, we analyze not the absolute values of the closing prices of cryptocurrency pairs, but their gains.

Note that not all crypto pairs are actively traded. Let’s select the most liquid ones. There are two criteria for activity — the number of transactions or the volume of trade. Let’s choose the number of deals. So, if you sort all cryptocurrency pairs by the number of transactions, and display it on the chart, you get the following.

How and with what to analyze the connections of cryptocurrency pairs? (6)

Let’s take the 35 most actively traded cryptocurrencies. They are shown in red on the graph. All data on cryptocurrency pairs are displayed in blue. The graph shows that the most active part of cryptocurrencies is only 6% of the entire list of cryptocurrencies.

0,05833 = 35 / 600

Yes, that’s a fact. These are the realities of the crypto market.

What does the histogram of price increases for these most active 35 positions look like? How is the crypto market moving? Something like this:

How and with what to analyze the connections of cryptocurrency pairs? (7)

Testing for compliance with the normal distribution is performed both by visual compliance with the normal distribution graph and by calculating statistics. How close is this picture to a normal distribution? Visually? Doubtful …

Additionally, we will conduct the Shapiro — Wilk test. This test is used to determine whether a sample fits a normal distribution. The following results were obtained:

How and with what to analyze the connections of cryptocurrency pairs? (8)

Only 10 out of 35 crypto pairs have p, which turned out to be higher than the alpha level of Shapiro — Wilk. This means that, technically, we cannot reject the hypothesis that the samples are normally distributed. Here’s what the histogram of the 10 mentioned crypto pairs looks like:

How and with what to analyze the connections of cryptocurrency pairs? (9)

To what extent does their appearance correspond to the normal distribution? Despite the significance of the Shapiro-Wilk statistic, it is highly doubtful. Thickened tails are visible on both the right and left. Let’s remember about gnomes and giants;)

Cryptocurrency pairs do not live according to the laws of normal distribution! This fact has an important consequence. It is necessary to use such analysis tools that would be free of distribution type. We are talking about nonparametric statistics. And … researching relationships is also possible there!

The nonparametric analogue of the Pearson coefficient is the Spearman coefficient. In general, its calculation refers to the methods of rank correlation. But … rank correlation is applicable to real variables as well. Calculating the Spearman coefficient between cryptocurrency pairs in each case, we get two values: the coefficient itself, as well as the value p, which allows us to assess the significance level of the Spearman coefficient itself.

At the time of the research, we identified only 35 pairs of instruments where there is an interesting and statistically significant relationship. Why is the term interestingused here? Not strong … not weak? Because the value of the correlation is not the only parameter that indicates how interesting the relationship is in terms of making a profit. You can read the research “Guide indicators in cryptocurrency trading or the Truman effect in action. Weak correlations are in the arsenal of a trader.” at www.cryptosensors.info, which will tell you about the nuances of researching relationships.

The cryptocurrency market is volatile, but … our monitoring software processing works with it. You can find out what relationships exist between cryptocurrency pairs at this time (we are not talking about the time of writing these lines; but about the time when you read these lines) at www.cryptosensors.info.

Cryptocurrency pairs do not behave according to the laws of normal distribution. When choosing a tool for analyzing cryptocurrency connections, you must use the right tool. Spearman’s correlation coefficient can be used to analyze the crypto market, since it is a nonparametric criterion.

From author: Cooperation proposal for the supply of data

You may be interested in research / data:

Send your questions and suggestions to mail@cryptosensors.info. We are open for cooperation!

How and with what to analyze the connections of cryptocurrency pairs? (2024)
Top Articles
Latest Posts
Article information

Author: Wyatt Volkman LLD

Last Updated:

Views: 5873

Rating: 4.6 / 5 (46 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Wyatt Volkman LLD

Birthday: 1992-02-16

Address: Suite 851 78549 Lubowitz Well, Wardside, TX 98080-8615

Phone: +67618977178100

Job: Manufacturing Director

Hobby: Running, Mountaineering, Inline skating, Writing, Baton twirling, Computer programming, Stone skipping

Introduction: My name is Wyatt Volkman LLD, I am a handsome, rich, comfortable, lively, zealous, graceful, gifted person who loves writing and wants to share my knowledge and understanding with you.