Giter VIP home page Giter VIP logo

Comments (1)

mdancho84 avatar mdancho84 commented on June 8, 2024

This should be fixed now. Yahoo Finance accepts symbols in BRK-B and BF-B format.

tq_index("SP500") %>% filter(str_detect(symbol, "BRK"))
Getting holdings for SP500
# A tibble: 1 × 8                                                                                                     
  symbol company                         identifier sedol   weight sector     shares_held local_currency
  <chr>  <chr>                           <chr>      <chr>    <dbl> <chr>            <dbl> <chr>         
1 BRK-B  Berkshire Hathaway Inc. Class B 08467070   2073390 0.0168 Financials    20439872 USD  


"BRK-B" %>% tq_get()
# A tibble: 2,736 × 8
   symbol date        open  high   low close  volume adjusted
   <chr>  <date>     <dbl> <dbl> <dbl> <dbl>   <dbl>    <dbl>
 1 BRK-B  2012-01-03  77.4  78.3  77.3  77.7 5343500     77.7
 2 BRK-B  2012-01-04  77.6  77.6  76.6  76.8 4264400     76.8
 3 BRK-B  2012-01-05  76.4  77.1  75.9  76.9 4235400     76.9
 4 BRK-B  2012-01-06  76.8  77.1  76.1  76.4 3751400     76.4
 5 BRK-B  2012-01-09  76.5  76.8  75.9  76.3 2978200     76.3
 6 BRK-B  2012-01-10  77    77.5  76.7  77.4 4815000     77.4
 7 BRK-B  2012-01-11  77.2  78.1  76.9  78   3819700     78  
 8 BRK-B  2012-01-12  78.3  78.5  77.6  78.5 3749300     78.5
 9 BRK-B  2012-01-13  77.8  77.9  77    77.8 4772300     77.8
10 BRK-B  2012-01-17  78.6  78.6  77.6  78.0 4344500     78.0
# … with 2,726 more rows
# ℹ Use `print(n = ...)` to see more rows

from tidyquant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.