Data Science Project: Predicting End of Bitcoin Bull Season. When is the Time to Exit?

Hakan Elbas
5 min readApr 7, 2021
Thinking alone is sometimes peaceful. No need to feel alert.

This article has been written by Hakan Elbas and Alparslan Mesri.

People are thinking answer to the same question: “When bull season will over?” In this article, we examined the previous two bull cycles, searched for a clue to forecast the end of the season. Seems we found out one of them.

When you enter into a warm cafe you need to take off your gloves. At least one of them… Firstly we will import our libraries and CSV files. Kaggle.com is a good data source. Unfortunately, we couldn’t find all years data in the same file. One of them is for the past years and the second one is for current months.

After the imports, we defined a function that converts Unix date data to gregorian date data and called it while using read_csv function.

As you see we have two data sources. df and df2. their format is also different. df is based on minute format while df2 is based on daily format. First, let take a look into df and df2 variables.

When we take a closer look at the data, we will see there is a lot of nan values. According to kaggle.com related page, the nan values mean that price didn’t change since the previous time unit. It means, in fact, nan values have meaning. Thus we used fillna function and ffill method to replay missing data correctly. Since our studies, we also detected a wrong value and changed it with the correct one. Also, we changed df data format and transformed it into a daily basis.

Now our first data source is also daily basis.

The Algorithm and Graphs…

Talking with friends. No need to cut a pleasant conversation.

Our df variable includes first and second bull seasons. We need to assign seasons into different variables. And the third season represents our current bull season.

After it, there is an algorithm. It is for the first season. Apply the same algorithm for the other bull seasons too.

Now let us draw some graphs… That code is for the first season. Do it again for other seasons too.

Until now, we experienced two bull seasons and we are at the inside of the third one. We need to talk about one exception. In fact, in the first season, there were two bull sub-seasons which are divided very distinctly with a massive drop. In the first bull season, between 2012–2013 first sub-bull season finished with an 80% drop. After an accumulation period second sub-bull started. When we examine the first graph we need to consider that truth.

First Bull Season with Two Sub-Bull Seasons
Second Bull Season
Third Bull Season, the Current One

These are good graphs for researchers. It is obvious that before the bear market arrives, at the end of the bull market, acceleration of the prices is step by step increasing. Nevertheless, for the investors, with the help of these visuals, it is difficult to detect a certain period range to exit from the market. Let us try to simplify them. In this viewpoint, we illustrated the acceleration points just which is more than 10%.

First Bull Season with Two Sub-Bull Seasons (Simplified Version)
Second Bull Season (Simplified Version)
Third Bull Season, the Current One (Simplified Version)

Conclusion

The fourth one is approaching, be attention

The fourth one is approaching, be attention

As it can be seen in simplified graphs, bull seasons finish a few sequential 10% daily increments. In a season to see such a situation within the same month, one time is normal, two times is okay but three times is scary. Even four times might be a little late for us. Of course, this phenomenon is not a physics law and the next bear market might come without the same signal but when we see the white guy within 15–30 days three times, it might be good to take precautions and set the stop loss tight.

Set a stop loss before darkness arrives.

You can reach this file from our GitHub profiles:

https://github.com/simplextable

https://github.com/hakanelbas

--

--