Anonymous credit cardrechargeable with bitcoinssbd
39 commentsBitcoin gold rate history chart
Buying and trading cryptocurrencies is all the rage right now. But how do you actually keep track of your investments? Especially if you do them on various websites. There are a few websites out there that allow you to do this, but most of them are rather complex. Let's take a look at how it works! I have accounts on a few exchanges that allow me to buy different coins. Not having a central place to check up on my portfolio makes it very time consuming to check your positions.
I immediately thought that a spreadsheet could be a great solution to my problem. Just enter all of my purchases and sales in a Google spreadsheet and done! However, a spreadsheet can not update the value of your coins dynamically. For that it needs to fetch the prices of each coin from an API. I was certain that I needed to write a simple web app for this Just as was about to give up on using a spreadsheet, I discovered that Google offers the ability to write scripts inside their documents.
These scripts have full access to the internet, they can update data in the documents, they run on Google's servers and they can run on a schedule. So I started by creating a table for all the coins that I'm currently tracking or that I currently own.
Overview of coins that I want to track. For each coin I keep track of the current price, the amount I have invested in it SUMIF function , the changes of the price over a few intervals and my opinion with some notes. Without some scripting magic, the price of the coin is obviously not updated dynamically so bear with me.
Next, I created a sheet for all my purchases. Every purchase is a single row and contains details about when I bought the coins, how many I bought, at what price I bought them and what their current value is. I wish these numbers were real I also added some columns for when I sell a coin. Now let's make all of this dynamic! We need a way to update the first sheet with the real-time prices of each coin.
Google Apps Script to the rescue! I wrote a small script that talks to the coinmarketcap. After getting a response from the API, it iterates over the first sheet and fills in the value of each coin along with the price changes.
The script is pretty efficient. It reads the data from the spreadsheet as a multi-dimensional array. It then updates the values in the array with the data from the API.
Afterwards it dumps all of this new data into the spreadsheet in 1 go! Much better then my original version that updated each cell individually. Sorry Google for the wasted cycles The final step is to make sure that the script runs periodically so that our spreadsheet always has the latest information.
Luckily Google has our back again! You can set up a trigger that will execute your function when a certain event occurs. This can be an event in the spreadsheet or on a time interval. I configured the trigger so that the script runs every 5 minutes. You can even ask it to send you an email should there be any errors during executions. My spreadsheet now updates itself every 5 minutes without me having to do anything. Everything runs on Google's servers: I can even close the spreadsheet and it will still update itself!
I've been using Google Drive and it's suite of office products for a while now. I always considered them great tools for collaboration. Discovering Google Apps Script was huge for me. It's incredibly powerful and it really allows you to make documents that come alive and integrate with other services. I'll definitely use this feature more in the future! To get a copy of this spreadsheet in your own Google Drive: Want to start buying Bitcoin, Ethereum or Litecoin?
Consider buying them through my Coinbase referral link. Posted on 01 Sep Track your cryptocurrency portfolio with Google Spreadsheets Buying and trading cryptocurrencies is all the rage right now. Google Spreadsheets I immediately thought that a spreadsheet could be a great solution to my problem.
Enter Google Apps Script Just as was about to give up on using a spreadsheet, I discovered that Google offers the ability to write scripts inside their documents. That sounds exactly like what I need!
My spreadsheet So let's take a look at how I constructed my spreadsheet. It consists out of 2 sheets: Overview of coins that I want to track For each coin I keep track of the current price, the amount I have invested in it SUMIF function , the changes of the price over a few intervals and my opinion with some notes.
The script Now let's make all of this dynamic! Running it periodically The final step is to make sure that the script runs periodically so that our spreadsheet always has the latest information. Conclusion I've been using Google Drive and it's suite of office products for a while now. Get it for yourself Want to use this simple spreadsheet for yourself? Here is the link to the spreadsheet: Buy crypto for yourself Want to start buying Bitcoin, Ethereum or Litecoin?