Using R to Find Microcap Cryptocurrencies

June 19, 2018

(This article was first published on R Programming – Pretty Little Numbers, and kindly contributed to R-bloggers)

I have been interested in blockchain technologies and cryptocurrencies for a while now. While doing research I’ve stumbled upon some interesting techniques for picking hidden gems. Many of these techniques required a fair bit of legwork, so in an effort to make things quicker and more efficient I came up with the following.

We will be using a technique for picking out microcap stocks set forth by trader Nik Patel in his article “Picking Out Microcaps 101“, you can find the original article here. I recommend reading it if you haven’t already. Once you get the basics down we are ready to get digging.

If you don’t have the required packages installed you will need to do so. Use the code below to install the crypto and dplyr packages, as well as their required dependencies.

#install packages

Once the packages are installed you will need to load them.

#load packages

Now that the required packages are installed and loaded, we can begin the act of importing and cleaning the data. The code below will pull all of the cryptocurrencies currently listed on CoinMarketCap into a data frame.

#import data from coinmarketcap
crypto_prices <- crypto_prices()

One little hiccup will occur that we need to solve. The crypto package imports one of the columns with a name that starts with a number. If we try to use dplyr on this column it will throw an error. Use the code snippet below to rename that column.

#change column name to allow for dplyr
colnames(crypto_prices)[colnames(crypto_prices)=="24h_volume_usd"] <- "usd_volume_24h"

Ok, so we’ve now got our data loaded and in the correct format. Now it’s time to find our microcap gems!

The variables we care about here are market cap, coin supply, and a ratio of market cap to 24-hour volume. The first two already exist in our data frame, but we will have to create the last one. Luckily for us, we can do that easily with dplyr’s mutate() function. After we create the new column, which I have dubbed “mcv_ratio”, we can filter out just the rows that meet the criteria mentioned in Nik’s article. Note: I am using the piping operator to combine these into one step in the name of efficiency.

#using piping operator
crypto_prices <- crypto_prices %>% 
  mutate(mcv_ratio = (usd_volume_24h/market_cap_usd)) %>% 
  filter(market_cap_usd <= 250000, available_supply < 50000000 & available_supply > 0, mcv_ratio > .02)

Great! Now we have a data frame with just the currencies we want to focus on. I personally like having two data frames to work with now. The one we just created and a pared down one which will allow me to quickly see names and supply information. I will create a separate data frame with only three columns: coin name, available supply, and total supply. This allows me to quickly compare the columns and disqualify the ones that have evidence of a large premine.

supply_compare <- select(crypto_prices, name, available_supply, total_supply)

That’s it for the code. You should be able to use the remaining tips in Nik’s article to find some pretty interesting tokens. Feel free to comment below with any successes you’ve had.

Oh, and the above references an opinion and is for information purposes only. It is not intended to be investment advice.

I hope you enjoyed this tutorial, happy hunting!

ETC: 0x7474848108F4f84023b0C49572E89aCDCa32D179
LTC: MDsL44XKuTHchRgiHghH5QkaBxjUXfsqn2

To leave a comment for the author, please follow the link and comment on their blog: R Programming – Pretty Little Numbers. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)