Portfolio Rebalancing Tool Using Google Sheets - Quadruple Your Earnings!

in #cryptocurrency7 years ago (edited)

Your Simple Guide To Creating An Effective Rebalancing Tool


invest-1346104_960_720.jpg


Rebalancing is a great method to ensure you sell high and buy low, it takes the emotion out of trying to call the bottom or the top. It really is a staple of investing, although most asset management firms rebalance for you whether its an index fund or your 401(k), for this tool you will have to do the trading yourself. Normally you see a stock portfolio rebalanced quarterly but in crypto a more aggressive rebalancing strategy may be necessary.

In light of this I'm going to share a new Google Sheet I put together that assists you in rebalancing your portfolio.

Features

Before we start here are some cool features:

  • Prices pulled from Coinmarketcap
  • Automatically tells you what to buy and sell in your portfolio
  • Can account for adding recurring deposits to your crypto portfolio

Screenshot.png

Ok lets begin...

1 - Make a copy of this Google Sheet: Rebalance Tool
2 - Once the Google Sheet is copied open Tools> Script Editor...
3 - Remove default text when script editor loads.
4 - Copy and Paste this into the new script:

function onOpen() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet();
  var entries = [{
    name : "Refresh",
    functionName : "refreshLastUpdate"
  }];
  sheet.addMenu("Refresh", entries);
};

function refreshLastUpdate() {
  SpreadsheetApp.getActiveSpreadsheet().getRange('I5').setValue(new Date().toTimeString());
}

function ccprice(name, currency, datetime) 
{
var url = "https://api.coinmarketcap.com/v1/ticker/" + name + "?convert=" + currency
var response = UrlFetchApp.fetch(url);
var json = response.getContentText();
var data = JSON.parse(json);

var priceval = {  "EUR" : data[0].price_eur, "USD" : data[0].price_usd, "BTC" : data[0].price_btc,
                  "AUD" : data[0].price_aud, "BRL" : data[0].price_brl, "CAD" : data[0].price_cad, 
                  "CHF" : data[0].price_chf, "CNY" : data[0].price_cny, "RUB" : data[0].price_rub,
                  "GBP" : data[0].price_gbp, "HKD" : data[0].price_hkd, "IDR" : data[0].price_idr, 
                  "INR" : data[0].price_inr, "JPY" : data[0].price_jpy, "KRW" : data[0].price_krw, 
                  "MXN" : data[0].price_mxn, "eur" : data[0].price_eur, "usd" : data[0].price_usd, 
                  "btc" : data[0].price_btc, "aud" : data[0].price_aud, "brl" : data[0].price_brl,  
                  "chf" : data[0].price_chf, "cny" : data[0].price_cny, "rub" : data[0].price_rub,
                  "gbp" : data[0].price_gbp, "hkd" : data[0].price_hkd, "idr" : data[0].price_idr, 
                  "inr" : data[0].price_inr, "jpy" : data[0].price_jpy, "krw" : data[0].price_krw, 
                  "mxn" : data[0].price_mxn, "cad" : data[0].price_cad }

var price = priceval[currency]
                                    
return price
SpreadsheetApp.flush();
}



4 - Save Script (any name is fine)
5 - Start editing for your data. Collumns B, C, D are the only manually entered data.

  • B - Name of your coin
  • C - Ideal value that coin should be in as a percentage of your portfolio
  • D - Quantity of coin currently held (You can put 0 if you intent to buy some)

6 - To add or change a coin or the FIAT currency just select the respective $G cell and change the name of the coin. See this screen shot.

7 - To refresh the sheets prices anytime use the menu option refresh. Note: This actively calls the function which will require permissions - google will ask if you want to run it, follow the prompts to approve it. It will only do this the first time you run the script in a new sheet.

The end!

Hope you like the tool, if you have any questions or run into issues I'll try to support you in the comment section. I wish you the best in your journey to wealth!

Tips always appreciated:

BTC: 1LdHmPUAEggc5Rk6UmczSkfT8tYL68txb6

Sources & References

Kick ass Coinmarketcap api script sampled from: rathergood Github

Refresh function to update google sheet sampled from: Stack Overflow

Sort:  

Cool, but why did you not address one of the most important questions: how often and when to rebalance? Once a year? Once a month? Once a week?

Well for one, this is a post sharing how to make a google sheet work as a rebalancing tool not an educational piece on the topic of rebalancing. I did however mention in the first paragraph that a more aggressive rebalance strategy may be necessary in comparison to a quarterly schedule. The reason is quite simple, there is no one size fits all time period nor is there a set deviation from you target allocation that triggers a rebalance.

Regardless let me cover this question because it does come up. First of all when is a function of how often the vast majority of the time.

So how often? Thats up to you. But if you're totally unsure start with a 2 week period.

Now when? At the end of the two week period unless your deviation from your target allocation on all assets is less than 5%. If nothing as moved more than 5% wait for the next 2 week period.

Everyone will have a personal decision to make about these two questions because withdraw fees, exchange fees, network fees can impact a small portfolio more so than a large portfolio.

I was also wondering how often to rebalance. This is definitely an helpful answer! Another factor that's important to me is how much time I want to spent on trading. So far I couldn't help myself checking coinmarketcap several times a day, with that constant FOMO feeling. Rebalancing with a set period gives me more peace of mind. So, many thanks for the balance sheet and the guidance! And @coinmasteryct thanks for sharing this on your youtube channel!

This is truly exceptional.

This looks great, thanks for sharing!

Thanks @olyup!

Misspelled "Rebalancing" in the title. A quick fix for SEO.

Nice catch, here's a full upvote for that one!

Awesome! I'm excited to check this out. Thank you for sharing with the community. We're all in this together!

Hope you like it! I thought it was valuable for me but then again, I'm bias :p

Tip!

Appreciate the tip! I haven't used it yet but it would be a good way to support authors who's post passed their payout window.

Beep beep. Hi @thorthur22!
You have used tip! in your comment - that`s my magic word for sending tips ;)
Click here if you wish to learn more!

Hi @thorthur22! @rexhafiz is sending you 0.1 SBD tip and @tipU upvote :)

@tipU quick guide | earn interest in @tipU profit

Well done, like and resteemed!
Nice to see the CCC so active in here!

Thanks @hco, CCC is a great crypto centric group to share and extract information from so it seems natural to cross post to each.

Excellent post. Thanks for sharing. I've resteemed it as well.

Awesome, glad you liked it and thanks for sharing!

Awesome tool! its a good way to robot sellings and buys and cut the emotion orders

That's one of the best aspects, which makes it effective for novice traders or investors who would normally get emotionally attached to a coins value or performance.

Thanks for the info dude! Shoutout to coinmastery.com which led me to this.

No problem. So how did Coinmastery lead you here? Not sure what their service is.

Carter Thomas's youtube channel. He talked about your spreadsheet in one of his videos and forwarded a link to it. http://coinmastery.com/rebalance

He did credit you on it of course.

Ohh cool, I'll check out his content!

Coin Marketplace

STEEM 0.15
TRX 0.16
JST 0.028
BTC 68859.62
ETH 2444.01
USDT 1.00
SBD 2.34