Visualize Your Crypto Portfolio

I share a Google Sheets script that you can use to quickly generate a bar plot of your cryptocurrency portfolio on — Yes, this means you need to track/create your private portfolio on CryptoCompare.

The script will generate a plot like this:

Image for post

and a table like this:

Image for post

Google Sheets Script

The script is quite simple, it reads “copy and pasted” data from , transforms it into a table, and then plots it. This would have taken me a few minutes in Python. But I wanted everyone to be able to use it! So… I spent half a day writing JavaScript that can be run in a Google Sheets app.

Last updated: November 25th, 2017

Here is how you can use it:

1) Open your portfolio on CryptoCompare. Then open a new Google Sheet document in Google Drive.

2) Select and copy the following table:

Image for post

Make sure you copy the column names as well.

3) Paste this into the first cell of your newly opened sheets doc.

Image for post

4) Select “Script Editor” from the Tools menu.

Image for post

5) Delete any default code in the window, and then paste the JavaScript code here.

Image for post

Hard link to github source here:

This code is also available for review at the end of this post.

6) Save your project, feel free to keep the default name.

7) Select the main function.

Image for post

8) Click the play button at the top of the page to run the main function.

Image for post

9) Give the required authorization.

Image for post

10) You may get a warning like the following I’ve posted below, which can be resolved by clicking the Advanced tab.

Image for post

11) Then click on the newly available link to grant authorization.

Image for post

I also had to type “Continue”

Image for post

12) After granting authorization, the script should automatically run. Go back to your sheet and — voila — the table and plot should have appeared.

Image for post

If it didn’t work, you’re welcome to get in touch with me on twitter here:

The code I’ve provided to do data parsing and visualization can be seen below:
Upon review, you will find there is nothing fishy going on, we are just parsing the values pasted into the sheet and creating a plot.

Here is the github source:

Thanks for reading 👏.

Written by

Python Data Engineer, MSc. Physics

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store