Author Topic: Cryptocurrency Portfolio Spreadsheet Help  (Read 4764 times)

0 Members and 1 Guest are viewing this topic.

Offline Chartist

  • Jr. Member
  • **
  • Posts: 28
    • View Profile
If you use Google Spreadsheets, you can use this general script to import prices from each exchange's API (select Tools -> Script Editor from within your spreadsheet):

var url = "http://bter.com/api/1/ticker/pts_btc/";
var response = UrlFetchApp.fetch(url);
var json = response.getContentText();
var bter_ptsdata = JSON.parse(json);

function bter_pts() {
  var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Exchange Rates");                     
  ss.getRange("B5").setValue(bter_ptsdata["last"])
}


The script above populates cell B5 in the spreadsheet tab "Exchange Rates" with the PTS to USD exchange rate data from Bter.  Now, in order to keep this exchange rate up to date you need to setup a Trigger (in the Script Editor this is under Resources -> Current Project's Triggers).  The trigger will run your script at a set increment to keep your exchange rate up to date.

I keep the "Exchange Rates" sheet separate of my balance sheet to keep things clean.

That is interesting, I'll have to give that a go. What about excel? Do you know of anyone who is using excel? It's what I would prefer to use. I'd rather have it on my computer than in the cloud...
@BTC_Analyst
PTS - PfBmz147Mt6aU3tZ38PyFLMT8P1oxy8NVz
MMC - MRxPyEDRbQFcEpeTdv2B6oXUKWTxeFqWsq

Offline wasthatawolf

If you use Google Spreadsheets, you can use this general script to import prices from each exchange's API (select Tools -> Script Editor from within your spreadsheet):

var url = "http://bter.com/api/1/ticker/pts_btc/";
var response = UrlFetchApp.fetch(url);
var json = response.getContentText();
var bter_ptsdata = JSON.parse(json);

function bter_pts() {
  var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Exchange Rates");                     
  ss.getRange("B5").setValue(bter_ptsdata["last"])
}


The script above populates cell B5 in the spreadsheet tab "Exchange Rates" with the PTS to USD exchange rate data from Bter.  Now, in order to keep this exchange rate up to date you need to setup a Trigger (in the Script Editor this is under Resources -> Current Project's Triggers).  The trigger will run your script at a set increment to keep your exchange rate up to date.

I keep the "Exchange Rates" sheet separate of my balance sheet to keep things clean.

Offline Chartist

  • Jr. Member
  • **
  • Posts: 28
    • View Profile
checkout www.cryptofolio.info

Oh, cool! Thanks. I'll play around with that later when I get home.
@BTC_Analyst
PTS - PfBmz147Mt6aU3tZ38PyFLMT8P1oxy8NVz
MMC - MRxPyEDRbQFcEpeTdv2B6oXUKWTxeFqWsq

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc

Offline Chartist

  • Jr. Member
  • **
  • Posts: 28
    • View Profile
http://data.bter.com/api
https://www.cryptsy.com/pages/api

Thanks for your reply. Where I'm having problems is knowing how to use the API's. I've tried playing with the Cryptsy API and did some reading in the Help section of excel, but I can't get it to work. Does anyone here have any experience with this stuff?
@BTC_Analyst
PTS - PfBmz147Mt6aU3tZ38PyFLMT8P1oxy8NVz
MMC - MRxPyEDRbQFcEpeTdv2B6oXUKWTxeFqWsq


Offline Chartist

  • Jr. Member
  • **
  • Posts: 28
    • View Profile
Hey, quick question. I created an excel spreadsheet to track my portfolio. I was wondering if anyone knew if there is a way to import price data from exchanges like Cryptsy, Bter, and bitcoinwisdom, and have real-time price data update the exchange rates so I don't have to manually update it. Any help would be very much appreciated.
@BTC_Analyst
PTS - PfBmz147Mt6aU3tZ38PyFLMT8P1oxy8NVz
MMC - MRxPyEDRbQFcEpeTdv2B6oXUKWTxeFqWsq