Jump to content

racemize

Member
  • Posts

    2,831
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by racemize

  1. This gets the latest close price:

    =getAlphaVantageClosePrice("^SP500TR")

     

    I modify the close price with the current change to get daily TR via:

    =getAlphaVantagePriceChange("^GSPC")

     

    For stocks, you can use the above or a live pull (doesn't work on SP500TR, but will work on GSPC):

    =getAlphaVantagePrice(B5) (where B5 is a stock ticker)

    or:

    =IMPORTJSON("https://api.iextrading.com/1.0/stock/AAPL/quote","latestPrice") (replace AAPL with a stock ticker)

     

  2. Here are the scripts I'm using:

     

    /**

    * Imports JSON data to your spreadsheet Ex: IMPORTJSON("http://myapisite.com","city/population")

    * @param url URL of your JSON data as string

    * @param xpath simplified xpath as string

    * @customfunction

    */

    function IMPORTJSON(url,xpath){

     

      try{

        // /rates/EUR

        var res = UrlFetchApp.fetch(url);

        var content = res.getContentText();

        var json = JSON.parse(content);

       

        var patharray = xpath.split("/");

        //Logger.log(patharray);

       

        for(var i=0;i<patharray.length;i++){

          json = json[patharray];

        }

       

        //Logger.log(typeof(json));

       

        if(typeof(json) === "undefined"){

          return "Node Not Available";

        } else if(typeof(json) === "object"){

          var tempArr = [];

         

          for(var obj in json){

            tempArr.push([obj,json[obj]]);

          }

          return tempArr;

        } else if(typeof(json) !== "object") {

          return json;

        }

      }

      catch(err){

          return "Error getting data"; 

      }

     

    }

     

    // Get your API key for free from this site: https://www.alphavantage.co/support/#api-key

    api_key = GET ONE FROM ALPHAVANTAGE

    url = 'https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol='

     

     

    /**

    * Imports JSON from Alpha Vantage into your spreadsheet Ex: getAlphaVantageClosePrice("AAPL")

    * @param symbol Ticker symbol of your stock

    * @customfunction

    */

    function getAlphaVantageClosePrice(symbol) {

      var response = UrlFetchApp.fetch(encodeURI("https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=" + symbol + "&apikey=" + api_key)).getContentText();

      var data = JSON.parse(response);

      var timeSeries = data["Time Series (Daily)"];

      var value = 0;

      for (var dates in timeSeries) {

        value = parseFloat(timeSeries[dates]["4. close"]);

        break;

      }

      return value;

    }

     

     

    /**

    * Imports JSON from Alpha Vantage into your spreadsheet Ex: getAlphaVantagePrice("AAPL")

    * @param symbol Ticker symbol of your stock

    * @customfunction

    */

    function getAlphaVantagePrice(symbol) {

      var response = UrlFetchApp.fetch(encodeURI("https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=" + symbol + "&interval=1min&apikey=" + api_key)).getContentText();

      var data = JSON.parse(response);

      var timeSeries = data["Time Series (1min)"];

      var value = 0;

      for (var dates in timeSeries) {

        value = parseFloat(timeSeries[dates]["4. close"]);

        break;

      }

      return value;

    }

     

    /**

    * Imports JSON from Alpha Vantage into your spreadsheet Ex: getAlphaVantagePrice("AAPL")

    * @param symbol Ticker symbol of your stock

    * @customfunction

    */

    function getAlphaVantagePriceChange(symbol) {

      var response = UrlFetchApp.fetch(encodeURI("https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=" + symbol + "&apikey=" + api_key)).getContentText();

      var data = JSON.parse(response);

      var timeSeries = data["Time Series (Daily)"];

      var initialValue = 0;

      for (var dates in timeSeries) {

        initialValue = parseFloat(timeSeries[dates]["1. open"]);

        break;

      }

      var response = UrlFetchApp.fetch(encodeURI("https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=" + symbol + "&interval=1min&apikey=" + api_key)).getContentText();

      var data = JSON.parse(response);

      var timeSeries = data["Time Series (1min)"];

      var finalValue = 0;

      for (var dates in timeSeries) {

        finalValue = parseFloat(timeSeries[dates]["4. close"]);

        break;

      }

      return finalValue/initialValue-1;

    }

     

    function getMidPrice(ticker) {

      ticker = encodeURI(ticker);

      var response = UrlFetchApp.fetch("https://query2.finance.yahoo.com/v7/finance/options/" + ticker);

      var chain = JSON.parse(response.getContentText());

      var ask = parseFloat(chain.optionChain.result[0].quote.ask);

      var bid = parseFloat(chain.optionChain.result[0].quote.bid);

      var mid = (bid + ask) / 2;

      return mid;

    }

  3. "Zero percent of our current assets are in the US. Which has never happened in the 19 years of running the fund.  We always had a very large portion of assets in the US. I would have never guessed that we would get to the point where we would be at zero - but here I am. "

     

    Pretty amazing.

     

    I guess he's pretending FCAU is a Dutch company.

  4. Just to be clear - stating the other side better than they can is stating the argument for their side not yours.  Your summary of the opposite side is "growth baby growth"--that is not a well articulated version of your opponent's stance.

  5.  

     

    It took me quite a few years of reading before I finally started buying BRK (began watching i

    I've shifted my philosophy from trying to find upside (a dubious endeavor for me), to Howard Marks "downside protection", and in this respect, Berkshire is the only company I understand well enough to feel comfortable with.

     

    +1

    I came to that conclusion as well between 2009 and 11. After messing around with lesser names and ideas. Downside protection for the really long term is rare. My conclusion is that they simply don’t exist elsewhere. Not just that I cannot find them. The secret is to have lower expectations while taking the downside protection.

     

    You have a huge leg up on me in that you’re doing this as a student. Mine happened in my middle years and the messing around cost me. No big regrets, pleased that I learned that then, not now or later.

    Good luck to us.

     

    Students come in all ages.  DooDiligence is in his mid 50's or something like that

     

    hmmm.. goes to show assumptions don't work! More respect for the a-typical student ;)

     

    Talking about assumptions, I can't let go of the chance to point out the topic of FANG versus BRK that consumed so many pages on this thread. Everyone here know to how to zero in on the exact BV and the multiple thereof for BRK literally to two or more decimal places; There are look thru earnings and cost of float and DTL projections and and.....in other words, few assumptions need to be made to value BRK.

     

    How about the FANGs; any assumptions being made?  Naah, don't think so! Growth baby, growth. Just sit back and watch them win it all!

     

    I think you are underestimating the work going into most of FANG by value investors.  I’m assuming Munger is a hero of yours?  If so, you might consider trying to articulate the position of your opponents better than they can, and I don’t think “growth baby growth” counts.

     

    Disclosure: I own Berkshire. Among FANG, I own one (less than Berkshire), think another is worth buying, and will likely be wrong to dismiss the value of a third. And I still might be wrong about the N.

  6. I recall that interview with Mr. Buffett that Dynamic in referring to, too. To my best recollection without trying to look up the video I consider Dynamic's description here accurate.

     

    - - - o 0 o - - -

     

    In Jeff's book [book by fellow board member rainforesthiker] there is a chapter 8 called "Investment Case studies - The Variant perception and the Inefficient Rationale". Investment case #6 is Berkshire Hathaway, and is called "Mispriced due to Indexation". [start p. 149.]

     

    In short, it's about when the US financials go out of favour from time to time in the market, Berkshire does too, because of indexing and because Berkshire is a material component of S&P Financial Select Sector, while the properties of Berkshire as an investment are materially different than the properties of the other financials in that category/index.

     

    Personally, I feel and think, that this is exactly where we are now.

     

    It is the largest weighted company in XLF:

    http://etfdb.com/etf/XLF/

  7. So disclosure here: I own BRK and GOOG (and more of BRK), but...

     

    The earnings/book of the 'A' (Amazon) really isn't useful and shouldn't be used for comparison against Berkshire.  Bezos is hiding billions of dollars in earnings through reinvestment, and the margins and growth of AWS is insane.  While I wouldn't say Amazon's current price is cheap, I have created models where it can still do very well, it just requires assumptions that I'm not willing to make.  (I've also made models where it drops in half, but I doubt that will happen, it just shows that I really don't know)

     

    On the other hand, if you want to look at something like Tesla and perhaps Netflix, then by all means.

  8. One thing I hadn't thought of (and TBW mentioned this to me when I was talking about Eurobank) was that a bank was, to a large extent, a bet on the sovereign bonds of that country.  For U.S./Canadians, that wasn't something that we had to even think about.  For Italy/Greece/etc., it definitely is.

  9.  

    Somehow this essay is materially different to you former essays, so far. It is not as theoretical as your former essays, more practical oriented, and in a very compressed form [to me, not too compressed though] stating your stance on these banks. Like you, I also like the proposition the market is giving us right now on these investments, considering the risks involved.

     

     

    Yes, this is quite different than normal--mostly I write essays when I think what I'm thinking about is worth writing down and sharing to other people, so in that sense, it made sense to write and share it.  On the other hand, this is very definitely an essay about a current situation, so I run the risk of being completely wrong!  Typically, I write essays where I know I'm mostly just stating facts, so there aren't statements that can go against me.  So, I'm somewhat nervous about it (Even here though, I hedged at the end by saying things could go wrong).

  10. I like the guy at CITI but they have gone bankrupt like three times in my investing life and I can't do it.

     

    This lingers in my mind a lot--I was quite reluctant to start the position because of this, and I'll be quite happy to leave it (hopefully only a year or so to go)...

  11. Thanks for all the comments, very appreciated.

     

    With regard to the online issue, I actually think the big four have a large advantage.  They can spend a massive amount of capital on technology (and have been) that credit unions just won't be able to do.  I don't think any online bank can match their scale and/or the online bank would have to offer higher interest rates (which is what has happened previously).  I would hate to be a small bank and trying to create and maintain apps on devices with the corresponding backoffice stuff on a level that competes with JPM's spending on exactly the same feature set.  You can also see that when new features come out, it's always the big banks first (e.g., Apple Pay).

     

    Moreover, the branches are still money makers for the banks--Dimon has talked about this, and that is why they are opening more of them.  Said another way, if it were such an advantage to close the branches, then BAC/C/JPM wouldn't be opening new ones now.  Certainly, they did close quite a few after the crisis, but I think that was a rationalization of the size and number per city.  Going forward, the branches provide a different service than before (less transactions, more advice/management), so the number/size/density will be different than it used to be.

     

    I'm more concerned about the payment space after seeing what Tencent is doing.  I'm not sure if credit cards are going to be bank driven in China at all.  I also wonder if they can get disrupted out of the U.S./West, but I'm much less concerned about that over the next 5 years.

  12. Look forward to reading.  I haven't bought my BAC back. 

     

    One reason is that I had occasion to see what a Merrill Lynch broker did to a retail account with a few hundred thousand bucks.  Churned it up, really badly....like one share of this, four shares of that with probably hundreds of micro positions. 

     

    Pretty highly unethical/disturbing to me.  Once that person learns about vanguard and/or RIAs they are probably never again going to be in the market for any BofA product in my opinion. 

     

    I also saw an advertisement from one of the banks for something they were calling a CD, which was basically a variable annuity.  Not sure if that is still alive.

     

    Maybe I can go with JPM and avoid this type of retail "grifting" bidness?  Much prefer a rogue trader or two.

     

    Yeah, I can't say the thesis is that the banks are necessarily doing great things for customers or that shitty things aren't happening.  That being said, I think satisfaction scores have been going up over time.

  13. Hi All, just wrapped up a new essay compiling my thoughts on banks at present prices.  I thought I'd post it here as a initial release in case there's any last-minute catches, before a "full" release tonight.

     

    Special thanks to Viking and John for all the excellent posts--I wasn't really responding as I was incorporating my thoughts into this essay, so hopefully it adds some value to the BAC/JPM/C/WFC discussions that are ongoing.

     

    Also, I'm very open to push back on this, as it is still a large composite position for me (BAC/JPM/C).

     

    https://drive.google.com/file/d/1aNXxnWepesOuCWEffnytdAjFqx86Inu3/view?usp=sharing

  14. While I think Semper has done some great work on Berkshire, I'd say Tilson has provided a good service of updating this valuation over the years.  It makes sense, doesn't require 50 pages of explanation, and is within the range of a reasonable IV.  As Buffett says, you don't need a scale to tell if a man is overweight.

  15. Over our history, we have issued 29.5 million shares as we expanded Fairfax from net premiums written of

    $10 million to $10 billion (current run rate of $11.5 billion). During this period, we have also reduced our shares

    outstanding by 6.7 million, for a net increase of 22.8 million. As the table below shows, our shares outstanding have

    grown by 5.6x while net premiums written, investments and common equity have increased by 1,000x or more.

    Henry Singleton, at Teledyne, reversed this trend, as you know, and over the next ten years we expect to do the

    same – use our free cash flow to buy back our shares!

     

    He said cash flow, but I don't think it was explicitly clear that all the current cash was off the table.

     

    Right--he said cash flow, but I don't think it was explicitly clear that all the current cash was off the table.

  16. From the meeting today, sounds like buybacks will be the focus on retained earnings over the entire few years, but that current cash is reserved for buying back minority interests as they become available.

     

    I guess that means they have enough current cash for the minorities they want to buy out, so we're relying on current/future cash flow to the holding company for buybacks?

  17. Regarding Arlington specifically it's a tad suspect that the accusations come out and the following year they keep their letter private.  He has every right to do so, but the timing is peculiar.

     

    He probably just doesn't want any attention drawn to him anymore.  I wouldn't if some RIA with no information accused me of fraud, particularly if the fund was closed.  Any partner can easily verify with the auditor that he actually has the money in a brokerage account.

×
×
  • Create New...