Will You Give Thanks for Bitcoin?

After falling as much as 35% from late October levels, Bitcoin (BTC) is likely on the cusp of a dramatic + or – 50% move. BTC has price memory around 6,500, and a break below should take the market to 2018 lows around 3,000. A bounce could result in a 10,000 price print.

I built a Random Forest model using data going back to 2010 to predict future prices over the coming 3, 6, 9, and 12 months. Predicted prices are:

RF Model Predicted Bitcoin Price ($)
TimeframePredicted BTC Price ($)
3 months8,850.54
6 months7,829.66
9 months8,835.55
12 months8,698.38

In my view, the use cases of BTC remain speculation and criminal activity. Despite this emotion, up is the more likely near-term path, especially if 6,500 can hold. Speculator markets can continue unabated for a long time. The code for this post can be found at my GitHub under post 66.

Random Forest Model

Given the size of the dataset (a few thousand rows), I opted to build a Random Forest (RF) model as opposed to a neural network. The RF model uses daily BTC data since 2010. Model features are described below:

FeatureDescription
TransactionsTotal number of transactions
Unique TransactionsTotal number of unique bitcoin transactions per day
Hash RateThe estimated number of giga hashes per second (billions of hashes per second) the bitcoin network is performing
Bitcoin DifficultyMeasure of how difficult it is to find a hash below a given target
Average Block SizeThe average block size in MB
Bitcoin api.blockchain SizeThe total size of all block headers and transactions (not including database indexes)
Miners RevenueHistorical data showing (number of bitcoins mined per day + transaction fees) * market price
Cost per TransactionData showing miners revenue divided by the number of transactions
USD Exchange Trade VolumeData showing the USD trade volume from the top exchanges
Total Output VolumeThe total value of all transaction outputs per day. This includes coins which were returned to the sender as change
Number of Transaction per BlockThe average number of transactions per block
Number of Unique Bitcoin Addresses UsedNumber of unique bitcoin addresses used per day
Number of Transactions Excluding Popular AddressesData showing the total number of unique bitcoin transactions per day excluding those which involve any of the top 100 most popular addresses popular addresses
Total Transaction Fees USDData showing the total BTC value of transaction fees miners earn per day in USD
Total Transaction FeesData showing the total BTC value of transaction fees miners earn per day
Market CapitalizationData showing the total number of bitcoins in circulation the market price in USD
Total BitcoinsData showing the historical total number of bitcoins which have been mined
Blockchain WalletsNumber of transactions made by Blockchain My Wallet Users per day
Bitcoin My Wallet Transaction Volume24hr transaction volume of Blockchain web wallet service
Sources: Blockchain.info and Quandl

I employed a standard Random Forest regressor model from scikit-learn. The core code is below. This model was done four times, for each timeframe.

from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score, GridSearchCV
from sklearn.preprocessing import MinMaxScaler

labels = np.array(dfr['price'])
features= dfr.drop(['price','data'], axis = 1)
feature_list = list(features.columns)
features = np.array(features)
train_features, test_features, train_labels, test_labels = train_test_split(features, labels, test_size = 0.25, random_state = 42)

print('Training Features Shape:', train_features.shape)
print('Training Labels Shape:', train_labels.shape)
print('Testing Features Shape:', test_features.shape)
print('Testing Labels Shape:', test_labels.shape)

print('Training Features Shape:', train_features.shape)
print('Training Labels Shape:', train_labels.shape)
print('Testing Features Shape:', test_features.shape)
print('Testing Labels Shape:', test_labels.shape)

#Test
dft = pd.read_csv(path/'Bitcoin - rftest.csv')
dft= dft.drop(['data','price'], axis = 1)
predictions = pd.DataFrame(rf.predict(dft))
predictions

I evaluated feature importance using the following code:

fi = rf.feature_importances_
pd.DataFrame({'Variable':feature_list,
            'Importance':rf.feature_importances_}).sort_values('Importance', ascending=False)

features=feature_list
importances = rf.feature_importances_
indices = np.argsort(importances)
plt.title('Feature Importances')
plt.barh(range(len(indices)), importances[indices], color='b', align='center')
plt.yticks(range(len(indices)), [features[i] for i in indices])
plt.xlabel('Relative Importance')
plt.show()

Perhaps unsurprisingly, Transactions, Total Bitcoins, and Wallets are the most important features determining BTC’s price.

Price Memory

BTC has price memory around 6,500, and a break below should take the market to 2018 lows around 3,000. A bounce could result in a 10,000 price print.

  • From 2/4/118 -2/6/18, BTC fell as much as 27% to 6,048 before bouncing and closing at 7,754, then rising as much as 91% to 11,573
  • Over 127 days from 6/13/18 – 10/17/18, BTC traded below 6,500 69 times and closed below than above that level 46 times
  • On 5/10/19, BTC made a high just short of 6,500. The next day it gapped up above and did not look back for several months
  • Today, BTC traded down to around 6,530 before bouncing up over 7,200

Core Views of Bitcoin

In my view, the use cases of BTC remain speculation and criminal activity. I wrote more about it here in May. Speculator markets can continue unabated for a long time.

Bitcoin StrengthReality
It's SecureEverything digital can be hacked. Most importantly, you may not even know you've been hacked
It's Borderless & UnconfiscatableNo, nothing is beyond the reach of governments. They have bigger satellites and guns than you do
Investment in the Space is GrowingYes, it continues, by people who are rich and well-diversified
Everyone's InvolvedDespite the presence of credible players, the space continues to be populated by con artists and pump and dump stock promoters
Store of ValueThe rules governing supply of any cryptocurrency (unliked gold) are governed by humans, who could change the rules if enough of them come together and agree

Any opinions or forecasts contained herein reflect the personal and subjective judgments and assumptions of the author only. There can be no assurance that developments will transpire as forecasted and actual results will be different. The accuracy of data is not guaranteed but represents the author’s best judgment and can be derived from a variety of sources. The information is subject to change at any time without notice.

Leave a Reply