diff --git a/articles/TQ00-introduction-to-tidyquant.html b/articles/TQ00-introduction-to-tidyquant.html index ded4436c..50d732cc 100644 --- a/articles/TQ00-introduction-to-tidyquant.html +++ b/articles/TQ00-introduction-to-tidyquant.html @@ -101,7 +101,7 @@

Matt Dancho

-

2023-10-03

+

2023-11-01

Source: vignettes/TQ00-introduction-to-tidyquant.Rmd
TQ00-introduction-to-tidyquant.Rmd
diff --git a/articles/TQ01-core-functions-in-tidyquant.html b/articles/TQ01-core-functions-in-tidyquant.html index 39ac428c..367ff7d7 100644 --- a/articles/TQ01-core-functions-in-tidyquant.html +++ b/articles/TQ01-core-functions-in-tidyquant.html @@ -101,7 +101,7 @@

Matt Dancho

-

2023-10-03

+

2023-11-01

Source: vignettes/TQ01-core-functions-in-tidyquant.Rmd
TQ01-core-functions-in-tidyquant.Rmd
@@ -219,7 +219,7 @@

2.1 Yahoo! Finance
 aapl_prices  <- tq_get("AAPL", get = "stock.prices", from = " 1990-01-01")
 aapl_prices 
-
## # A tibble: 8,503 × 8
+
## # A tibble: 8,524 × 8
 ##    symbol date        open  high   low close    volume adjusted
 ##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl>
 ##  1 AAPL   1990-01-02 0.315 0.335 0.312 0.333 183198400    0.264
@@ -232,7 +232,7 @@ 

2.1 Yahoo! Finance## 8 AAPL 1990-01-11 0.324 0.324 0.308 0.308 211052800 0.244 ## 9 AAPL 1990-01-12 0.306 0.310 0.301 0.308 171897600 0.244 ## 10 AAPL 1990-01-15 0.308 0.319 0.306 0.306 161739200 0.243 -## # ℹ 8,493 more rows

+## # ℹ 8,514 more rows

Yahoo Japan stock prices can be retrieved using a similar call, get = "stock.prices.japan".

@@ -250,7 +250,7 @@ 

2.2 FRED Economic Data
 wti_price_usd <- tq_get("DCOILWTICO", get = "economic.data")
 wti_price_usd 

-
## # A tibble: 2,800 × 3
+
## # A tibble: 2,820 × 3
 ##    symbol     date       price
 ##    <chr>      <date>     <dbl>
 ##  1 DCOILWTICO 2013-01-01  NA  
@@ -263,7 +263,7 @@ 

2.2 FRED Economic Data## 8 DCOILWTICO 2013-01-10 93.8 ## 9 DCOILWTICO 2013-01-11 93.6 ## 10 DCOILWTICO 2013-01-14 94.3 -## # ℹ 2,790 more rows

+## # ℹ 2,810 more rows

Working with non-OHLC data tq_transmute(mutate_fun = to.period, period = "months", col_rename = "WTI Price")

-
## # A tibble: 129 × 2
+
## # A tibble: 130 × 2
 ##    date       `WTI Price`
 ##    <date>           <dbl>
 ##  1 2013-01-31        97.6
@@ -605,7 +605,7 @@ 

Working with non-OHLC data## 8 2013-08-30 108. ## 9 2013-09-30 102. ## 10 2013-10-31 96.3 -## # ℹ 119 more rows

+## # ℹ 120 more rows
diff --git a/articles/TQ02-quant-integrations-in-tidyquant.html b/articles/TQ02-quant-integrations-in-tidyquant.html index bf751f4e..c54eb31e 100644 --- a/articles/TQ02-quant-integrations-in-tidyquant.html +++ b/articles/TQ02-quant-integrations-in-tidyquant.html @@ -101,7 +101,7 @@

Matt Dancho

-

2023-10-03

+

2023-11-01

Source:
vignettes/TQ02-quant-integrations-in-tidyquant.Rmd
TQ02-quant-integrations-in-tidyquant.Rmd
@@ -925,12 +925,12 @@

Example 6 ## ## Residuals: ## Min 1Q Median 3Q Max -## -0.0269572 -0.0039655 0.0002151 0.0039652 0.0289458 +## -0.0269568 -0.0039658 0.0002155 0.0039652 0.0289460 ## ## Coefficients: ## Estimate Std. Error t value Pr(>|t|) ## (Intercept) 0.0001130 0.0003097 0.365 0.715 -## V 0.8133659 0.0226394 35.927 <2e-16 *** +## V 0.8133667 0.0226393 35.927 <2e-16 *** ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## diff --git a/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-20-1.png b/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-20-1.png index c93c72a3..84643dbd 100644 Binary files a/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-20-1.png and b/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-20-1.png differ diff --git a/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-27-1.png b/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-27-1.png index 505f94e9..bbce79ee 100644 Binary files a/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-27-1.png and b/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-27-1.png differ diff --git a/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-31-1.png b/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-31-1.png index 8c0ddf49..25e27f7f 100644 Binary files a/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-31-1.png and b/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-31-1.png differ diff --git a/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-32-1.png b/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-32-1.png index d50bbcdd..be471743 100644 Binary files a/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-32-1.png and b/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-32-1.png differ diff --git a/articles/TQ03-scaling-and-modeling-with-tidyquant.html b/articles/TQ03-scaling-and-modeling-with-tidyquant.html index 49463e27..9943a682 100644 --- a/articles/TQ03-scaling-and-modeling-with-tidyquant.html +++ b/articles/TQ03-scaling-and-modeling-with-tidyquant.html @@ -101,7 +101,7 @@

Matt Dancho

-

2023-10-03

+

2023-11-01

Source: vignettes/TQ03-scaling-and-modeling-with-tidyquant.Rmd
TQ03-scaling-and-modeling-with-tidyquant.Rmd
@@ -231,20 +231,20 @@

Method 2B: Use index or exchangeGet an index…

 tq_index("DOW")
-
## # A tibble: 31 × 8
+
## # A tibble: 32 × 8
 ##    symbol company      identifier sedol weight sector shares_held local_currency
 ##    <chr>  <chr>        <chr>      <chr>  <dbl> <chr>        <dbl> <chr>         
-##  1 UNH    UNITEDHEALT… 91324P102  2917… 0.101  -          5477820 USD           
-##  2 MSFT   MICROSOFT C… 594918104  2588… 0.0632 -          5477820 USD           
-##  3 GS     GOLDMAN SAC… 38141G104  2407… 0.0626 -          5477820 USD           
-##  4 HD     HOME DEPOT … 437076102  2434… 0.0589 -          5477820 USD           
-##  5 CAT    CATERPILLAR… 149123101  2180… 0.0534 -          5477820 USD           
-##  6 AMGN   AMGEN INC    031162100  2023… 0.0523 -          5477820 USD           
-##  7 MCD    MCDONALD S … 580135101  2550… 0.0506 -          5477820 USD           
-##  8 V      VISA INC CL… 92826C839  B2PZ… 0.0454 -          5477820 USD           
-##  9 CRM    SALESFORCE … 79466L302  2310… 0.0400 -          5477820 USD           
-## 10 BA     BOEING CO/T… 097023105  2108… 0.0369 -          5477820 USD           
-## # ℹ 21 more rows
+## 1 UNH UNITEDHEALT… 91324P102 2917… 0.106 - 5339472 USD +## 2 MSFT MICROSOFT C… 594918104 2588… 0.0675 - 5339472 USD +## 3 GS GOLDMAN SAC… 38141G104 2407… 0.0602 - 5339472 USD +## 4 HD HOME DEPOT … 437076102 2434… 0.0563 - 5339472 USD +## 5 AMGN AMGEN INC 031162100 2023… 0.0526 - 5339472 USD +## 6 MCD MCDONALD S … 580135101 2550… 0.0520 - 5339472 USD +## 7 CAT CATERPILLAR… 149123101 2180… 0.0484 - 5339472 USD +## 8 V VISA INC CL… 92826C839 B2PZ… 0.0466 - 5339472 USD +## 9 CRM SALESFORCE … 79466L302 2310… 0.0399 - 5339472 USD +## 10 BA BOEING CO/T… 097023105 2108… 0.0365 - 5339472 USD +## # ℹ 22 more rows

…or, get an exchange.

 tq_exchange("NYSE")
@@ -256,20 +256,20 @@

Method 2B: Use index or exchangetq_index("DOW") %>% slice(1:3) %>% tq_get(get = "stock.prices")

-
## # A tibble: 8,118 × 15
+
## # A tibble: 8,181 × 15
 ##    symbol company      identifier sedol weight sector shares_held local_currency
 ##    <chr>  <chr>        <chr>      <chr>  <dbl> <chr>        <dbl> <chr>         
-##  1 UNH    UNITEDHEALT… 91324P102  2917…  0.101 -          5477820 USD           
-##  2 UNH    UNITEDHEALT… 91324P102  2917…  0.101 -          5477820 USD           
-##  3 UNH    UNITEDHEALT… 91324P102  2917…  0.101 -          5477820 USD           
-##  4 UNH    UNITEDHEALT… 91324P102  2917…  0.101 -          5477820 USD           
-##  5 UNH    UNITEDHEALT… 91324P102  2917…  0.101 -          5477820 USD           
-##  6 UNH    UNITEDHEALT… 91324P102  2917…  0.101 -          5477820 USD           
-##  7 UNH    UNITEDHEALT… 91324P102  2917…  0.101 -          5477820 USD           
-##  8 UNH    UNITEDHEALT… 91324P102  2917…  0.101 -          5477820 USD           
-##  9 UNH    UNITEDHEALT… 91324P102  2917…  0.101 -          5477820 USD           
-## 10 UNH    UNITEDHEALT… 91324P102  2917…  0.101 -          5477820 USD           
-## # ℹ 8,108 more rows
+##  1 UNH    UNITEDHEALT… 91324P102  2917…  0.106 -          5339472 USD           
+##  2 UNH    UNITEDHEALT… 91324P102  2917…  0.106 -          5339472 USD           
+##  3 UNH    UNITEDHEALT… 91324P102  2917…  0.106 -          5339472 USD           
+##  4 UNH    UNITEDHEALT… 91324P102  2917…  0.106 -          5339472 USD           
+##  5 UNH    UNITEDHEALT… 91324P102  2917…  0.106 -          5339472 USD           
+##  6 UNH    UNITEDHEALT… 91324P102  2917…  0.106 -          5339472 USD           
+##  7 UNH    UNITEDHEALT… 91324P102  2917…  0.106 -          5339472 USD           
+##  8 UNH    UNITEDHEALT… 91324P102  2917…  0.106 -          5339472 USD           
+##  9 UNH    UNITEDHEALT… 91324P102  2917…  0.106 -          5339472 USD           
+## 10 UNH    UNITEDHEALT… 91324P102  2917…  0.106 -          5339472 USD           
+## # ℹ 8,171 more rows
 ## # ℹ 7 more variables: date <date>, open <dbl>, high <dbl>, low <dbl>,
 ## #   close <dbl>, volume <dbl>, adjusted <dbl>

You can use any applicable “getter” to get data for every @@ -426,7 +426,7 @@

Analyze a Single Stock## ## Coefficients: ## (Intercept) year(date) -## 58.86280 -0.02915

+## 58.86279 -0.02915

We can utilize the broom package to get “tidy” data from the model. There’s three primary functions:

    @@ -484,11 +484,11 @@

    Scale to Many Stocks## # A tibble: 5 × 8 ## symbol company identifier sedol weight sector shares_held local_currency ## <chr> <chr> <chr> <chr> <dbl> <chr> <dbl> <chr> -## 1 FRT FEDERAL REA… 313745101 BN7P… 1.80e-4 - 820430 USD -## 2 PXD PIONEER NAT… 723787107 2690… 1.45e-3 - 2613608 USD -## 3 VRSN VERISIGN INC 92343E102 2142… 5.04e-4 - 1005605 USD -## 4 IEX IDEX CORP 45167R104 2456… 4.31e-4 - 841532 USD -## 5 ALLE ALLEGION PLC G0176J109 BFRT… 2.53e-4 - 992871 USD +## 1 NCLH NORWEGIAN C… G66721104 B9CG… 1.60e-4 - 4629317 USD +## 2 PSX PHILLIPS 66 718546104 B78C… 1.43e-3 - 4984643 USD +## 3 IRM IRON MOUNTA… 46284V101 BVFT… 4.86e-4 - 3261486 USD +## 4 VLTO VERALTO CORP 92338C103 BPGM… 4.29e-4 - 2452072 USD +## 5 ALLE ALLEGION PLC G0176J109 BFRT… 2.48e-4 - 991519 USD

    We can now apply our analysis function to the stocks using dplyr::mutate() and purrr::map(). The mutate() function adds a column to our tibble, and the @@ -518,15 +518,14 @@

    Scale to Many Stocksselect(-term) stocks_model_stats -
    ## # A tibble: 5 × 7
    -## # Groups:   symbol, company [5]
    +
    ## # A tibble: 4 × 7
    +## # Groups:   symbol, company [4]
     ##   symbol company                   data     estimate std.error statistic p.value
     ##   <chr>  <chr>                     <list>      <dbl>     <dbl>     <dbl>   <dbl>
    -## 1 IEX    IDEX CORP                 <tibble>  0.0178     0.0264    0.673    0.520
    -## 2 FRT    FEDERAL REALTY INVS TRUST <tibble>  0.0170     0.0165    1.03     0.334
    -## 3 ALLE   ALLEGION PLC              <tibble>  0.0157     0.0850    0.185    0.870
    -## 4 VRSN   VERISIGN INC              <tibble>  0.00669    0.0411    0.163    0.875
    -## 5 PXD    PIONEER NATURAL RESOURCE… <tibble>  0.00664    0.0686    0.0969   0.925
    +## 1 ALLE ALLEGION PLC <tibble> 0.0157 0.0850 0.185 0.870 +## 2 IRM IRON MOUNTAIN INC <tibble> 0.0137 0.0300 0.458 0.659 +## 3 PSX PHILLIPS 66 <tibble> -0.0978 0.0530 -1.84 0.162 +## 4 NCLH NORWEGIAN CRUISE LINE HO… <tibble> -0.209 0.0823 -2.53 0.127

    We’re done! We now have the coefficient of the linear regression that tracks the direction of the trend line. We can easily extend this type of analysis to larger lists or stock indexes. For example, the entire @@ -585,7 +584,7 @@

    Bad Apples Fail Gracefully, tq_get## ! x = 'BAD APPLE', get = 'stock.prices': Error in getSymbols.yahoo(Symbols = "BAD APPLE", env = <environment>, : Unable to import "BAD APPLE". ## URL using bad/illegal format or missing URL ## Removing BAD APPLE. -
    ## # A tibble: 5,412 × 8
    +
    ## # A tibble: 5,454 × 8
     ##    symbol date        open  high   low close    volume adjusted
     ##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl>
     ##  1 AAPL   2013-01-02  19.8  19.8  19.3  19.6 560518000     16.8
    @@ -598,7 +597,7 @@ 

    Bad Apples Fail Gracefully, tq_get## 8 AAPL 2013-01-11 18.6 18.8 18.5 18.6 350506800 15.9 ## 9 AAPL 2013-01-14 18.0 18.1 17.8 17.9 734207600 15.3 ## 10 AAPL 2013-01-15 17.8 17.8 17.3 17.4 876772400 14.9 -## # ℹ 5,402 more rows

    +## # ℹ 5,444 more rows

    Now switching complete_cases = FALSE will retain any errors as NA values in a nested data frame. Notice that the error message and output change. The error message now states that the @@ -612,7 +611,7 @@

    Bad Apples Fail Gracefully, tq_get## Caused by warning: ## ! x = 'BAD APPLE', get = 'stock.prices': Error in getSymbols.yahoo(Symbols = "BAD APPLE", env = <environment>, : Unable to import "BAD APPLE". ## URL using bad/illegal format or missing URL -
    ## # A tibble: 5,413 × 8
    +
    ## # A tibble: 5,455 × 8
     ##    symbol date        open  high   low close    volume adjusted
     ##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl>
     ##  1 AAPL   2013-01-02  19.8  19.8  19.3  19.6 560518000     16.8
    @@ -625,7 +624,7 @@ 

    Bad Apples Fail Gracefully, tq_get## 8 AAPL 2013-01-11 18.6 18.8 18.5 18.6 350506800 15.9 ## 9 AAPL 2013-01-14 18.0 18.1 17.8 17.9 734207600 15.3 ## 10 AAPL 2013-01-15 17.8 17.8 17.3 17.4 876772400 14.9 -## # ℹ 5,403 more rows

    +## # ℹ 5,445 more rows

    In both cases, the prudent user will review the warnings to determine what happened and whether or not this is acceptable. In the complete_cases = FALSE example, if the user attempts to diff --git a/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-15-1.png b/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-15-1.png index 1028f6f6..6ca0cbf2 100644 Binary files a/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-15-1.png and b/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-15-1.png differ diff --git a/articles/TQ04-charting-with-tidyquant.html b/articles/TQ04-charting-with-tidyquant.html index 36fb2f97..f2e33fdb 100644 --- a/articles/TQ04-charting-with-tidyquant.html +++ b/articles/TQ04-charting-with-tidyquant.html @@ -101,7 +101,7 @@

    Matt Dancho

    -

    2023-10-03

    +

    2023-11-01

    Source:
    vignettes/TQ04-charting-with-tidyquant.Rmd
    TQ04-charting-with-tidyquant.Rmd
    diff --git a/articles/TQ05-performance-analysis-with-tidyquant.html b/articles/TQ05-performance-analysis-with-tidyquant.html index 5327c430..b501e34a 100644 --- a/articles/TQ05-performance-analysis-with-tidyquant.html +++ b/articles/TQ05-performance-analysis-with-tidyquant.html @@ -101,7 +101,7 @@

    Matt Dancho

    -

    2023-10-03

    +

    2023-11-01

    Source: vignettes/TQ05-performance-analysis-with-tidyquant.Rmd
    TQ05-performance-analysis-with-tidyquant.Rmd
    diff --git a/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-44-1.png b/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-44-1.png index b9b08c51..f1712cf5 100644 Binary files a/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-44-1.png and b/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-44-1.png differ diff --git a/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-46-1.png b/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-46-1.png index f605a62c..01d24caa 100644 Binary files a/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-46-1.png and b/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-46-1.png differ diff --git a/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-48-1.png b/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-48-1.png index 39940dfb..5f1efc2c 100644 Binary files a/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-48-1.png and b/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-48-1.png differ diff --git a/authors.html b/authors.html index 9f02a658..4f01d125 100644 --- a/authors.html +++ b/authors.html @@ -86,13 +86,14 @@

    Citation

    Dancho M, Vaughan D (2023). tidyquant: Tidy Quantitative Financial Analysis. -https://business-science.github.io/tidyquant/, https://github.com/business-science/tidyquant. +R package version 1.0.7.9000, https://github.com/business-science/tidyquant, https://business-science.github.io/tidyquant/.

    @Manual{,
       title = {tidyquant: Tidy Quantitative Financial Analysis},
       author = {Matt Dancho and Davis Vaughan},
       year = {2023},
    -  note = {https://business-science.github.io/tidyquant/, https://github.com/business-science/tidyquant},
    +  note = {R package version 1.0.7.9000, https://github.com/business-science/tidyquant},
    +  url = {https://business-science.github.io/tidyquant/},
     }