diff --git a/.Rbuildignore b/.Rbuildignore index 62b96bec..066e0ca0 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,7 +3,6 @@ ^data-raw$ ^README\.Rmd$ ^README-.*\.png$ -^\.travis\.yml$ ^cran-comments\.md$ ^revdep$ img @@ -11,7 +10,6 @@ img ^_pkgdown\.yml$ ^index\.Rmd$ ^docs$ -^appveyor\.yml$ ^doc$ ^Meta$ ^CRAN-RELEASE$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index c16af6cd..a3ac6182 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,12 +1,6 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -# -# NOTE: This workflow is overkill for most R packages and -# check-standard.yaml is likely a better choice. -# usethis::use_github_action("check-standard") will install it. on: - schedule: - - cron: '0 0 1 * *' push: branches: [main, master] pull_request: diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index eeace55f..ed7650c7 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -1,9 +1,13 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: branches: [main, master] - tags: ['*'] + pull_request: + branches: [main, master] + release: + types: [published] + workflow_dispatch: name: pkgdown @@ -15,6 +19,8 @@ jobs: group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/pr-commands.yaml b/.github/workflows/pr-commands.yaml index fb77f8c6..71f335b3 100644 --- a/.github/workflows/pr-commands.yaml +++ b/.github/workflows/pr-commands.yaml @@ -1,4 +1,4 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: issue_comment: @@ -14,9 +14,9 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/pr-fetch@v1 + - uses: r-lib/actions/pr-fetch@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} @@ -26,10 +26,12 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: roxygen2 + extra-packages: any::roxygen2 + needs: pr-document - name: Document - run: Rscript -e 'roxygen2::roxygenise()' + run: roxygen2::roxygenise() + shell: Rscript {0} - name: commit run: | @@ -38,7 +40,7 @@ jobs: git add man/\* NAMESPACE git commit -m 'Document' - - uses: r-lib/actions/pr-push@v1 + - uses: r-lib/actions/pr-push@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} @@ -49,19 +51,21 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/pr-fetch@v1 + - uses: r-lib/actions/pr-fetch@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: r-lib/actions/setup-r@v2 - name: Install dependencies - run: Rscript -e 'install.packages("styler")' + run: install.packages("styler") + shell: Rscript {0} - name: Style - run: Rscript -e 'styler::style_pkg()' + run: styler::style_pkg() + shell: Rscript {0} - name: commit run: | @@ -70,6 +74,6 @@ jobs: git add \*.R git commit -m 'Style' - - uses: r-lib/actions/pr-push@v1 + - uses: r-lib/actions/pr-push@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 4b01af75..2c5bb502 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,4 +1,4 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: @@ -15,7 +15,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: r-lib/actions/setup-r@v2 with: @@ -23,8 +23,28 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: covr + extra-packages: any::covr + needs: coverage - name: Test coverage - run: covr::codecov() + run: | + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") + ) shell: Rscript {0} + + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v3 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/DESCRIPTION b/DESCRIPTION index 704ee9cb..111fc3a4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,12 +1,11 @@ Package: tidyquant Type: Package Title: Tidy Quantitative Financial Analysis -Version: 1.0.7 +Version: 1.0.7.9000 Authors@R: c( person("Matt", "Dancho", email = "mdancho@business-science.io", role = c("aut", "cre")), person("Davis", "Vaughan", email = "dvaughan@business-science.io", role = c("aut")) ) -Maintainer: Matt Dancho Description: Bringing business and financial analysis to the 'tidyverse'. The 'tidyquant' package provides a convenient wrapper to various 'xts', 'zoo', 'quantmod', 'TTR' and 'PerformanceAnalytics' package @@ -14,7 +13,7 @@ Description: Bringing business and financial analysis to the 'tidyverse'. The 't advantage is being able to use quantitative functions with the 'tidyverse' functions including 'purrr', 'dplyr', 'tidyr', 'ggplot2', 'lubridate', etc. See the 'tidyquant' website for more information, documentation and examples. -URL: https://github.com/business-science/tidyquant +URL: https://business-science.github.io/tidyquant/, https://github.com/business-science/tidyquant BugReports: https://github.com/business-science/tidyquant/issues License: MIT + file LICENSE Encoding: UTF-8 @@ -26,18 +25,15 @@ Depends: quantmod (>= 0.4-13) Imports: dplyr (>= 1.0.0), - ggplot2, - jsonlite, + ggplot2 (>= 3.4.0), + jsonlite, httr, - curl, + curl, lazyeval, magrittr, purrr, - Quandl, - riingo, - readr, + readr, readxl, - alphavantager (>= 0.1.2), stringr, tibble, tidyr (>= 1.0.0), @@ -45,19 +41,19 @@ Imports: timeDate, TTR, xts, - rlang, - tidyverse, - tidyselect + rlang Suggests: + alphavantager (>= 0.1.2), + Quandl, + riingo, tibbletime, - forcats, broom, knitr, + forcats, rmarkdown, testthat (>= 2.1.0), scales, Rblpapi, - covr, janitor RoxygenNote: 7.2.3 Roxygen: list(markdown = TRUE) diff --git a/NAMESPACE b/NAMESPACE index b3ea64bf..bee7cfcc 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -185,16 +185,12 @@ export(tq_transmute_xy_) import(PerformanceAnalytics) import(lubridate) import(quantmod) -importFrom(Quandl,"Quandl") -importFrom(Quandl,"Quandl.api_key") -importFrom(Quandl,"Quandl.datatable") -importFrom(Quandl,"Quandl.search") -importFrom(TTR,"SMA") +importFrom(TTR,SMA) importFrom(ggplot2,`%+replace%`) importFrom(magrittr,"%$%") importFrom(magrittr,"%>%") importFrom(rlang,":=") -importFrom(utils,"data") -importFrom(utils,"download.file") -importFrom(utils,"read.csv") -importFrom(xts,"to.period") +importFrom(rlang,.data) +importFrom(utils,download.file) +importFrom(utils,read.csv) +importFrom(xts,to.period) diff --git a/NEWS.md b/NEWS.md index 94f2e31b..9d9c5fb9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,14 @@ +# tidyquant (development version) + +- Remove the dependency on tidyverse +- tidyquant no longer loads lubridate as tidyverse 2.0 now loads lubridate +- Changed the `size` argument to `linewidth` for ggplot2 3.4.0 +- Removed the last tidyr and dplyr deprecated functions +- Add linewidth = to `geom_ma()` +- Move Quandl, riingo, and alphavantager to Suggests. tidyquant will not explictly install those, but you can install them from CRAN. +- Fixed CRAN alias +- FB to META change in `FANG` + # tidyquant 1.0.7 - Moved `tidyverse` from suggest to imports to pass cran tests @@ -238,7 +249,7 @@ _[Potential Breaking Change] Move `tidyverse` to suggests_ * Split introduction into four separate vignettes, which improves flow and enables readers to more easily get to needed documentation. Now five docs total covering the primary needs of `tidyquant` users! * New data: * `tq_exchange()` gets the stock list for NASDAQ, NYSE, and AMEX exchanges. Use `tq_exchange_options()` to exchange options. - * `FANG` data set that can be loaded with `data(FANG)`. + * `FANG` data set * New visualizations that integrate with `ggplot2`: * `palette_()` functions used to create scales are exported. * `theme_tq()` creates light, dark, and green themes for tidyquant visualizations. diff --git a/R/api-alphavantager.R b/R/api-alphavantager.R index 1942b0a6..5d758c8e 100644 --- a/R/api-alphavantager.R +++ b/R/api-alphavantager.R @@ -1,5 +1,6 @@ #' Set Alpha Vantage API Key #' +#' Requires the alphavantager packager to use. #' @param api_key Optionally passed parameter to set Alpha Vantage `api_key`. #' #' @return Returns invisibly the currently set `api_key` @@ -14,15 +15,15 @@ #' @examples #' #' \dontrun{ +#' if (rlang::is_installed("alphavantager")) { #' av_api_key(api_key = "foobar") #' } +#' } #' #' @name av_api_key #' @export av_api_key <- function(api_key) { - if(!requireNamespace("alphavantager", quietly = TRUE)) { - stop("alphavantager must be installed to use this functionality.", call. = FALSE) - } + rlang::check_installed("alphavantager", "to use the alphavantager API.") alphavantager::av_api_key(api_key) } diff --git a/R/api-quandl.R b/R/api-quandl.R index 980f3265..00619f41 100644 --- a/R/api-quandl.R +++ b/R/api-quandl.R @@ -15,13 +15,16 @@ #' @examples #' #' \dontrun{ +#' if (rlang::is_installed("Quandl")) { #' quandl_api_key(api_key = "foobar") #' } +#' } NULL #' @rdname quandl_api_key #' @export quandl_api_key <- function(api_key) { + rlang::check_installed("Quandl") if (!missing(api_key)) { options(Quandl.api_key = api_key) @@ -45,7 +48,7 @@ quandl_api_key <- function(api_key) { #' #' @export #' -#' @examples +#' @examplesIf rlang::is_installed("Quandl") #' #' \dontrun{ #' quandl_search(query = "oil") @@ -55,8 +58,8 @@ NULL #' @rdname quandl_search #' @export quandl_search <- function(query, silent = FALSE, per_page = 10, ...) { - - Quandl.search(query = query, silent = silent, per_page = per_page, ...) %>% + rlang::check_installed("Quandl") + Quandl::Quandl.search(query = query, silent = silent, per_page = per_page, ...) %>% tibble::as_tibble() } diff --git a/R/api-tiingo.R b/R/api-tiingo.R index 654e0989..35251543 100644 --- a/R/api-tiingo.R +++ b/R/api-tiingo.R @@ -1,5 +1,6 @@ #' Set Tiingo API Key #' +#' Requires the riingo package to be installled. #' @param api_key Optionally passed parameter to set Tiingo `api_key`. #' #' @return Returns invisibly the currently set `api_key` @@ -9,15 +10,11 @@ #' @seealso [tq_get()] `get = "tiingo"` #' #' -#' @export -#' -#' @examples -#' +#' @examplesIf rlang::is_installed("riingo") #' \dontrun{ -#' tiingo_api_key(api_key = "foobar") +#' tiingo_api_key(api_key = "foobar") #' } #' -#' @name tiingo_api_key #' @export tiingo_api_key <- function(api_key) { if(!requireNamespace("riingo", quietly = TRUE)) { diff --git a/R/data.R b/R/data.R index e446b78e..a02382b9 100644 --- a/R/data.R +++ b/R/data.R @@ -1,7 +1,7 @@ #' Stock prices for the "FANG" stocks. #' #' A dataset containing the daily historical stock prices for the "FANG" tech stocks, -#' "FB", "AMZN", "NFLX", and "GOOG", spanning from the beginning of +#' "META", "AMZN", "NFLX", and "GOOG", spanning from the beginning of #' 2013 through the end of 2016. #' #' @format A "tibble" ("tidy" data frame) with 4,032 rows and 8 variables: diff --git a/R/excel-date-functions.R b/R/excel-date-functions.R index cde36fbe..84fee9e6 100644 --- a/R/excel-date-functions.R +++ b/R/excel-date-functions.R @@ -78,8 +78,6 @@ #' #' @examples #' # Libraries -#' library(tidyquant) -#' library(tidyverse) #' library(lubridate) #' #' # --- Basic Usage ---- @@ -134,7 +132,7 @@ #' ) #' #' @name excel_date_functions - +NULL # CONVERTERS ---- diff --git a/R/excel-if-functions.R b/R/excel-if-functions.R index 00d0945b..71cb60ab 100644 --- a/R/excel-if-functions.R +++ b/R/excel-if-functions.R @@ -48,9 +48,8 @@ #' value (scalar). See examples below. #' #' -#' @examples -#' library(tidyverse) -#' library(tidyquant) +#' @examplesIf rlang::is_installed("forcats") +#' library(dplyr) #' library(timetk) #' library(stringr) #' library(lubridate) @@ -81,7 +80,7 @@ #' #' # Count negative returns by month #' FANG %>% -#' mutate(symbol = as_factor(symbol)) %>% +#' mutate(symbol = forcats::as_factor(symbol)) %>% #' group_by(symbol) %>% #' #' # Collapse from daily to FIRST value by month diff --git a/R/excel-pivot-table.R b/R/excel-pivot-table.R index f14a3c1c..ad86630d 100644 --- a/R/excel-pivot-table.R +++ b/R/excel-pivot-table.R @@ -42,9 +42,6 @@ #' - __All grouping and summarizing functions MUST BE prefixed with `~`__. Example: `.rows = ~ YEAR(order_date)` #' #' @examples -#' library(tidyquant) -#' library(tidyverse) -#' #' # PIVOT TABLE ---- #' # Calculate returns by year/quarter #' FANG %>% @@ -124,7 +121,7 @@ pivot_table <- function(.data, .rows, .columns, .values, if (length(.col_names) == 0) return(summarized_tbl) pivoted_tbl <- summarized_tbl %>% - tidyr::pivot_wider(names_from = tidyselect::all_of(.col_names), values_from = tidyselect::all_of(.val_names)) + tidyr::pivot_wider(names_from = dplyr::all_of(.col_names), values_from = dplyr::all_of(.val_names)) pivoted_tbl[is.na(pivoted_tbl)] <- fill_na diff --git a/R/excel-ref-functions.R b/R/excel-ref-functions.R index 65f50e35..b2e11452 100644 --- a/R/excel-ref-functions.R +++ b/R/excel-ref-functions.R @@ -24,11 +24,10 @@ #' - Can only return values from one column only. Use `dplyr::left_join()` to perform table joining. #' #' @examples -#' library(tidyquant) -#' library(tidyverse) +#' library(dplyr) #' #' lookup_table <- tibble( -#' stock = c("FB", "AMZN", "NFLX", "GOOG"), +#' stock = c("META", "AMZN", "NFLX", "GOOG"), #' company = c("Facebook", "Amazon", "Netflix", "Google") #' ) #' @@ -46,7 +45,7 @@ #' mutate(company = VLOOKUP(symbol, lookup_table, stock, company)) #' #' @name excel_ref_functions - +NULL #' @rdname excel_ref_functions #' @export @@ -60,6 +59,6 @@ VLOOKUP <- function(.lookup_values, .data, .lookup_column, .return_column) { y = .data, by = c(x = rlang::quo_name(key_expr)), ) %>% - dplyr::pull(!! var_expr) + dplyr::pull(!!var_expr) } diff --git a/R/excel-stat-mutation-functions.R b/R/excel-stat-mutation-functions.R index 6a66932e..984c68e6 100644 --- a/R/excel-stat-mutation-functions.R +++ b/R/excel-stat-mutation-functions.R @@ -26,12 +26,10 @@ #' @return #' - __Mutation functions__ return a mutated / transformed version of the vector #' -#' @examples +#' @examplesIf rlang::is_installed("forcats") #' # Libraries -#' library(tidyquant) #' library(timetk) -#' library(tidyverse) -#' library(forcats) +#' library(dplyr) #' #' # --- Basic Usage ---- #' @@ -44,7 +42,7 @@ #' # Go from daily to monthly periodicity, #' # then calculate returns and growth of $1 USD #' FANG %>% -#' mutate(symbol = as_factor(symbol)) %>% +#' mutate(symbol = forcats::as_factor(symbol)) %>% #' group_by(symbol) %>% #' #' # Summarization - Collapse from daily to FIRST value by month diff --git a/R/excel-stat-summary-functions.R b/R/excel-stat-summary-functions.R index 79023de3..882f73cf 100644 --- a/R/excel-stat-summary-functions.R +++ b/R/excel-stat-summary-functions.R @@ -36,12 +36,11 @@ #' __Summary Functions__ #' - All functions remove missing values (`NA`). This is the same behavior as in Excel and most commonly what is desired. #' -#' @examples +#' @examplesIf rlang::is_installed("forcats") #' # Libraries -#' library(tidyquant) #' library(timetk) -#' library(tidyverse) #' library(forcats) +#' library(dplyr) #' #' # --- Basic Usage ---- #' @@ -54,7 +53,7 @@ #' # Go from daily to monthly periodicity, #' # then calculate returns and growth of $1 USD #' FANG %>% -#' mutate(symbol = as_factor(symbol)) %>% +#' mutate(symbol = forcats::as_factor(symbol)) %>% #' group_by(symbol) %>% #' #' # Summarization - Collapse from daily to FIRST value by month diff --git a/R/ggplot-coord_date.R b/R/ggplot-coord_date.R index 179a5471..a3fe1885 100644 --- a/R/ggplot-coord_date.R +++ b/R/ggplot-coord_date.R @@ -27,7 +27,6 @@ #' #' @examples #' # Load libraries -#' library(tidyquant) #' library(dplyr) #' library(ggplot2) #' diff --git a/R/ggplot-geom_bbands.R b/R/ggplot-geom_bbands.R index d4490ce8..2fd4f431 100644 --- a/R/ggplot-geom_bbands.R +++ b/R/ggplot-geom_bbands.R @@ -65,8 +65,6 @@ #' @export #' #' @examples -#' # Load libraries -#' library(tidyquant) #' library(dplyr) #' library(ggplot2) #' @@ -276,7 +274,7 @@ StatBBandsMA_vol <- ggplot2::ggproto("StatBBandsMA", ggplot2::Stat, GeomBBandsRibbon <- ggplot2::ggproto("GeomBBandsRibbon", ggplot2::GeomRibbon, default_aes = ggplot2::aes(colour = "red", fill = "grey20", - size = 0.5, + linewidth = 0.5, linetype = 2, alpha = 0.15) ) @@ -284,7 +282,7 @@ GeomBBandsRibbon <- ggplot2::ggproto("GeomBBandsRibbon", ggplot2::GeomRibbon, GeomBBandsMA <- ggplot2::ggproto("GeomBBandsMA", ggplot2::GeomLine, default_aes = ggplot2::aes(colour = "darkblue", linetype = 2, - size = 0.5, + linewidth = 0.5, alpha = NA) ) diff --git a/R/ggplot-geom_chart.R b/R/ggplot-geom_chart.R index 9f31fed8..22110513 100644 --- a/R/ggplot-geom_chart.R +++ b/R/ggplot-geom_chart.R @@ -44,8 +44,6 @@ #' @export #' #' @examples -#' # Load libraries -#' library(tidyquant) #' library(dplyr) #' library(ggplot2) #' @@ -159,13 +157,15 @@ StatSegmentRightBC <- ggplot2::ggproto("StatSegmentRightBC", ggplot2::Stat, ) GeomLinerangeBC <- ggplot2::ggproto("GeomLinerangeBC", ggplot2::GeomLinerange, - default_aes = ggplot2::aes(size = 0.5, + default_aes = ggplot2::aes( + linewidth = 0.5, linetype = 1, alpha = NA) ) GeomSegmentBC <- ggplot2::ggproto("GeomSegmentBC", ggplot2::GeomSegment, - default_aes = ggplot2::aes(size = 0.5, + default_aes = ggplot2::aes( + linewidth = 0.5, linetype = 1, alpha = NA) ) @@ -227,7 +227,7 @@ StatRectCS <- ggplot2::ggproto("StatRectCS", ggplot2::Stat, GeomRectCS <- ggplot2::ggproto("GeomRectCS", ggplot2::GeomRect, default_aes = ggplot2::aes(colour = NA, - size = 0.5, + linewidth = 0.5, linetype = 1, alpha = NA) ) diff --git a/R/ggplot-geom_ma.R b/R/ggplot-geom_ma.R index c8cacd86..efb66307 100644 --- a/R/ggplot-geom_ma.R +++ b/R/ggplot-geom_ma.R @@ -71,6 +71,8 @@ #' \item `colour` #' \item `group` #' \item `linetype` +#' \item `linewidth` +#' #' \item `size` #' } #' @@ -93,8 +95,6 @@ #' @export #' #' @examples -#' # Load libraries -#' library(tidyquant) #' library(dplyr) #' library(ggplot2) #' @@ -207,7 +207,7 @@ StatMA_vol <- ggplot2::ggproto("StatSMA_vol", ggplot2::Stat, GeomMA <- ggplot2::ggproto("GeomMA", ggplot2::GeomLine, default_aes = ggplot2::aes(colour = "darkblue", linetype = 2, - size = 0.5, + linewidth = 0.5, alpha = NA) ) diff --git a/R/ggplot-scale_manual.R b/R/ggplot-scale_manual.R index 87923d2b..811b7598 100644 --- a/R/ggplot-scale_manual.R +++ b/R/ggplot-scale_manual.R @@ -21,12 +21,11 @@ #' #' @examples #' # Load libraries -#' library(tidyquant) #' library(dplyr) #' library(ggplot2) #' #' # Get stock prices -#' stocks <- c("AAPL", "FB", "NFLX") %>% +#' stocks <- c("AAPL", "META", "NFLX") %>% #' tq_get(from = "2013-01-01", #' to = "2017-01-01") #' diff --git a/R/ggplot-theme_tq.R b/R/ggplot-theme_tq.R index 6545ce7c..c3be3832 100644 --- a/R/ggplot-theme_tq.R +++ b/R/ggplot-theme_tq.R @@ -8,7 +8,6 @@ #' #' @examples #' # Load libraries -#' library(tidyquant) #' library(dplyr) #' library(ggplot2) #' @@ -49,10 +48,10 @@ theme_tq <- function(base_size = 11, base_family = "") { ggplot2::theme( # Base Inherited Elements - line = ggplot2::element_line(colour = blue, size = 0.5, linetype = 1, + line = ggplot2::element_line(colour = blue, linewidth = 0.5, linetype = 1, lineend = "butt"), rect = ggplot2::element_rect(fill = white, colour = blue, - size = 0.5, linetype = 1), + linewidth = 0.5, linetype = 1), text = ggplot2::element_text(family = base_family, face = "plain", colour = blue, size = base_size, lineheight = 0.9, hjust = 0.5, vjust = 0.5, angle = 0, @@ -61,14 +60,14 @@ theme_tq <- function(base_size = 11, base_family = "") { # Axes axis.line = ggplot2::element_blank(), axis.text = ggplot2::element_text(size = ggplot2::rel(0.8)), - axis.ticks = ggplot2::element_line(color = grey, size = ggplot2::rel(1/3)), + axis.ticks = ggplot2::element_line(color = grey, linewidth = ggplot2::rel(1/3)), axis.title = ggplot2::element_text(size = ggplot2::rel(1.0)), # Panel panel.background = ggplot2::element_rect(fill = white, color = NA), - panel.border = ggplot2::element_rect(fill = NA, size = ggplot2::rel(1/2), color = blue), - panel.grid.major = ggplot2::element_line(color = grey, size = ggplot2::rel(1/3)), - panel.grid.minor = ggplot2::element_line(color = grey, size = ggplot2::rel(1/3)), + panel.border = ggplot2::element_rect(fill = NA, linewidth = ggplot2::rel(1/2), color = blue), + panel.grid.major = ggplot2::element_line(color = grey, linewidth = ggplot2::rel(1/3)), + panel.grid.minor = ggplot2::element_line(color = grey, linewidth = ggplot2::rel(1/3)), panel.grid.minor.x = ggplot2::element_blank(), panel.spacing = ggplot2::unit(.75, "cm"), @@ -106,12 +105,12 @@ theme_tq_dark <- function(base_size = 11, base_family = "") { ggplot2::theme( # Axes - axis.ticks = ggplot2::element_line(color = blue, size = ggplot2::rel(1/3)), + axis.ticks = ggplot2::element_line(color = blue, linewidth = ggplot2::rel(1/3)), # Panel panel.background = ggplot2::element_rect(fill = grey, color = NA), - panel.grid.major = ggplot2::element_line(color = white, size = ggplot2::rel(1/3)), - panel.grid.minor = ggplot2::element_line(color = white, size = ggplot2::rel(1/3)), + panel.grid.major = ggplot2::element_line(color = white, linewidth = ggplot2::rel(1/3)), + panel.grid.minor = ggplot2::element_line(color = white, linewidth = ggplot2::rel(1/3)), # Complete theme complete = TRUE @@ -133,12 +132,12 @@ theme_tq_green <- function(base_size = 11, base_family = "") { ggplot2::theme( # Axes - axis.ticks = ggplot2::element_line(color = blue, size = ggplot2::rel(1/3)), + axis.ticks = ggplot2::element_line(color = blue, linewidth = ggplot2::rel(1/3)), # Panel panel.background = ggplot2::element_rect(fill = green, color = NA), - panel.grid.major = ggplot2::element_line(color = white, size = ggplot2::rel(1/3)), - panel.grid.minor = ggplot2::element_line(color = white, size = ggplot2::rel(1/3)), + panel.grid.major = ggplot2::element_line(color = white, linewidth = ggplot2::rel(1/3)), + panel.grid.minor = ggplot2::element_line(color = white, linewidth = ggplot2::rel(1/3)), # Complete theme complete = TRUE diff --git a/R/tidyquant.R b/R/tidyquant.R index b2c770a4..f3755714 100644 --- a/R/tidyquant.R +++ b/R/tidyquant.R @@ -24,18 +24,13 @@ #' To learn more about tidyquant, start with the vignettes: #' `browseVignettes(package = "tidyquant")` #' -#' @docType package -#' @name tidyquant #' #' @import quantmod #' @import lubridate #' @import PerformanceAnalytics -#' @importFrom rlang ":=" -#' @importFrom magrittr "%>%" -#' @importFrom magrittr "%$%" -#' @importFrom utils "data" "download.file" "read.csv" -#' @importFrom TTR "SMA" -#' @importFrom xts "to.period" -#' @importFrom Quandl "Quandl" "Quandl.datatable" "Quandl.api_key" "Quandl.search" - -NULL +#' @importFrom rlang ":=" .data +#' @importFrom magrittr %$% +#' @importFrom utils download.file read.csv +#' @importFrom TTR SMA +#' @importFrom xts to.period +"_PACKAGE" diff --git a/R/tq_get.R b/R/tq_get.R index 6ecbd4fe..84e330cb 100644 --- a/R/tq_get.R +++ b/R/tq_get.R @@ -95,8 +95,6 @@ #' #' @examples #' # Load libraries -#' library(tidyquant) -#' library(tidyverse) #' #' # Get the list of `get` options #' tq_get_options() @@ -105,7 +103,7 @@ #' aapl_stock_prices <- tq_get("AAPL") #' #' # Get stock prices for multiple stocks -#' mult_stocks <- tq_get(c("FB", "AMZN"), +#' mult_stocks <- tq_get(c("META", "AMZN"), #' get = "stock.prices", #' from = "2016-01-01", #' to = "2017-01-01") @@ -114,15 +112,18 @@ #' \dontrun{ #' #' # --- Quandl --- -#' +#' if (rlang::is_installed("quandl")) { #' quandl_api_key('') +#' tq_get("EIA/PET_MTTIMUS1_M", get = "quandl", from = "2010-01-01") +#' } +#' #' #' # Energy data from EIA -#' tq_get("EIA/PET_MTTIMUS1_M", get = "quandl", from = "2010-01-01") #' #' -#' # --- Tiingo --- #' +#' # --- Tiingo --- +#' if (rlang::is_installed("riingo")) { #' tiingo_api_key('') #' #' # Tiingo Prices (Free alternative to Yahoo Finance!) @@ -143,8 +144,11 @@ #' resample_frequency = "5min") #' #' +#' } +#' #' # --- Alpha Vantage --- #' +#' if (rlang::is_installed("alphavantager")) { #' av_api_key('') #' #' # Daily Time Series @@ -159,7 +163,6 @@ #' av_fun = "TIME_SERIES_INTRADAY", #' interval = "15min", #' outputsize = "full") -#' #' # FX DAILY #' tq_get("USD/EUR", get = "alphavantage", av_fun = "FX_DAILY", outputsize = "full") #' @@ -167,8 +170,7 @@ #' tq_get("USD/EUR", get = "alphavantage", av_fun = "CURRENCY_EXCHANGE_RATE") #' #' } - - +#' } # PRIMARY FUNCTIONS ---- @@ -182,27 +184,28 @@ tq_get <- function(x, get = "stock.prices", complete_cases = TRUE, ...) { # Validate quandl api key if("quandl" %in% get) { + rlang::check_installed("Quandl") if (is.null(quandl_api_key())) warning("No Quandl API key detected. Limited to 50 anonymous calls per day. Set key with 'quandl_api_key()'.", call. = FALSE) } # Validate Alpha Vantage api key if(stringr::str_detect("alphavantage", get)) { + rlang::check_installed("alphavantager", "to access the alphavantage API.") if (is.null(tidyquant::av_api_key())) stop("No Alpha Vantager API key detected. Set key with 'av_api_key()'.", call. = FALSE) } # Validate Alpha Vantage api key if(stringr::str_detect("tiingo", get)) { + rlang::check_installed("riingo", "to use to riingo API.") if (is.null(riingo::riingo_get_token())) stop("No Tiingo API key detected. Set key with 'tiingo_api_key()'.", call. = FALSE) } # Setup Rblpapi if("rblpapi" %in% get) { - if(!requireNamespace("Rblpapi", quietly = TRUE)) { - stop("Rblpapi must be installed to get data from Bloomberg.", call. = FALSE) - } + rlang::check_installed("Rblpapi") Rblpapi::blpConnect() #must have a valid blp session running } @@ -251,8 +254,7 @@ tq_get <- function(x, get = "stock.prices", complete_cases = TRUE, ...) { names(x)[[1]] <- "symbol.." - x_tib <- x %>% - tibble::as_tibble() + x_tib <- tibble::as_tibble(x) ret <- tq_get_map(x = x_tib, get = get, complete_cases = complete_cases, ...) @@ -509,7 +511,7 @@ tq_get_util_1 <- # Tidy a single financial statement tidy_fin <- function(x) { - group <- 1:nrow(x) + group <- seq_len(nrow(x)) df <- dplyr::bind_cols( tibble::tibble(group), @@ -530,9 +532,9 @@ tq_get_util_1 <- period = rep(c("A", "Q"), 3)) %>% dplyr::mutate(retrieve = paste0("ret$", type, "$", period)) %>% dplyr::mutate(data = purrr::map(.x = retrieve, .f = function(x) eval(parse(text = x)))) %>% - dplyr::mutate(data = purrr::map(.x = data, .f = tidy_fin)) %>% + dplyr::mutate(data = purrr::map(.x = .data$data, .f = tidy_fin)) %>% dplyr::select(-retrieve) %>% - tidyr::spread(key = period, value = data) %>% + tidyr::spread(key = period, value = "data") %>% dplyr::rename(annual = A, quarter = Q) } @@ -624,7 +626,7 @@ tq_get_util_4 <- function(x, get, type = "raw", meta = FALSE, order = "asc", co # Util 5: Quandl.datatable ----- tq_get_util_5 <- function(x, get, paginate = FALSE, complete_cases, map, ...) { - + rlang::check_installed("Quandl") # Check x if (!is.character(x)) { stop("x must be a character string in the form of a valid symbol.") @@ -636,14 +638,14 @@ tq_get_util_5 <- function(x, get, paginate = FALSE, complete_cases, map, ...) { ret <- tryCatch({ - Quandl.datatable(code = x, paginate = paginate, ...) %>% + Quandl::Quandl.datatable(code = x, paginate = paginate, ...) %>% tibble::as_tibble() }, error = function(e) { warn <- paste0("x = '", x, "', get = 'quandl.datatable", "': ", e) - if (map == TRUE && complete_cases) warn <- paste0(warn, " Removing ", x, ".") + if (map && complete_cases) warn <- paste0(warn, " Removing ", x, ".") warning(warn, call. = FALSE) return(NA) # Return NA on error @@ -701,9 +703,7 @@ tq_get_util_6 <- function(x, get, av_fun, complete_cases, map, ...) { # Util : tiingo ----- tq_get_util_7 <- function(x, get, tiingo_fun, complete_cases, map, ...) { - if(!requireNamespace("riingo", quietly = TRUE)) { - stop("riingo must be installed to use this functionality.", call. = FALSE) - } + rlang::check_installed("riingo", "to get the Tiingo API.") # Check x if (!is.character(x)) { @@ -738,14 +738,14 @@ tq_get_util_7 <- function(x, get, tiingo_fun, complete_cases, map, ...) { # Make columns consistent with Yahoo Finance! if (get == "tiingo") { ret <- ret %>% - dplyr::select(ticker, date, open, high, low, close, volume, adjClose, dplyr::everything()) %>% + dplyr::relocate("ticker", "date", "open", "high", "low", "close", "volume", "adjClose") %>% dplyr::rename(adjusted = adjClose, symbol = ticker) } if (get == "tiingoiex") { ret <- ret %>% - dplyr::select(ticker, date, open, high, low, close, dplyr::everything()) %>% + dplyr::relocate(ticker, date, open, high, low, close) %>% dplyr::rename(symbol = ticker) } @@ -757,7 +757,7 @@ tq_get_util_7 <- function(x, get, tiingo_fun, complete_cases, map, ...) { }, error = function(e) { warn <- paste0("x = '", x, "', get = '", get, "': ", e) - if (map == TRUE && complete_cases) warn <- paste0(warn, " Removing ", x, ".") + if (map && complete_cases) warn <- paste0(warn, " Removing ", x, ".") warning(warn, call. = FALSE) return(NA) # Return NA on error diff --git a/R/tq_mutate.R b/R/tq_mutate.R index cc4e2240..0b219275 100644 --- a/R/tq_mutate.R +++ b/R/tq_mutate.R @@ -66,13 +66,12 @@ #' #' @examples #' # Load libraries -#' library(tidyquant) #' library(dplyr) #' #' ##### Basic Functionality #' #' fb_stock_prices <- FANG %>% -#' filter(symbol == "FB") %>% +#' filter(symbol == "META") %>% #' filter( #' date >= "2016-01-01", #' date <= "2016-12-31" @@ -382,9 +381,9 @@ arrange_by_date <- function(tib) { tib <- tib %>% tidyr::nest() %>% dplyr::mutate(nested.col = - purrr::map(data, arrange_date) + purrr::map(.data$data, arrange_date) ) %>% - dplyr::select(-data) %>% + dplyr::select(-"data") %>% tidyr::unnest(cols = nested.col) %>% dplyr::group_by_at(.vars = group_names) diff --git a/R/tq_performance.R b/R/tq_performance.R index d68946e9..16669805 100644 --- a/R/tq_performance.R +++ b/R/tq_performance.R @@ -55,11 +55,9 @@ #' #' @examples #' # Load libraries -#' library(tidyquant) #' library(dplyr) #' #' # Use FANG data set -#' data(FANG) #' #' # Get returns for individual stock components grouped by symbol #' Ra <- FANG %>% @@ -235,7 +233,7 @@ tq_performance_.grouped_df <- function(data, Ra, Rb = NULL, performance_fun, ... performance_fun = performance_fun, ...) ) %>% - dplyr::select(-data) %>% + dplyr::select(-"data") %>% tidyr::unnest(cols = nested.col) %>% dplyr::group_by_at(.vars = group_names) } diff --git a/R/tq_portfolio.R b/R/tq_portfolio.R index 4ed56400..a1e8a8f7 100644 --- a/R/tq_portfolio.R +++ b/R/tq_portfolio.R @@ -55,11 +55,9 @@ #' #' @examples #' # Load libraries -#' library(tidyquant) #' library(dplyr) #' #' # Use FANG data set -#' data(FANG) #' #' # Get returns for individual stock components #' monthly_returns_stocks <- FANG %>% @@ -82,7 +80,7 @@ #' #' # Note that GOOG's weighting is zero in Method 1. In Method 2, #' # GOOG is not added and same result is achieved. -#' weights_df <- tibble(symbol = c("FB", "AMZN", "NFLX"), +#' weights_df <- tibble(symbol = c("META", "AMZN", "NFLX"), #' weights = c(0.50, 0.25, 0.25)) #' tq_portfolio(data = monthly_returns_stocks, #' assets_col = symbol, @@ -101,7 +99,7 @@ #' 0.00, 0.50, 0.25, 0.25, #' 0.25, 0.00, 0.50, 0.25, #' 0.25, 0.25, 0.00, 0.50) -#' stocks <- c("FB", "AMZN", "NFLX", "GOOG") +#' stocks <- c("META", "AMZN", "NFLX", "GOOG") #' weights_table <- tibble(stocks) %>% #' tq_repeat_df(n = 4) %>% #' bind_cols(tibble(weights)) %>% diff --git a/R/tq_stock_list.R b/R/tq_stock_list.R index 0ee2e0e3..302ccc1c 100644 --- a/R/tq_stock_list.R +++ b/R/tq_stock_list.R @@ -28,8 +28,6 @@ #' #' #' @examples -#' # Load libraries -#' library(tidyquant) #' #' # Get the list of stock index options #' tq_index_options() @@ -222,7 +220,10 @@ spdr_mapper <- function(x) { DOWGLOBAL = "DGT", SP400 = "MDY", SP500 = "SPY", - SP600 = "SLY", + # SLY seems broken. + # Using SLYG for S&P 600 + # https://www.ssga.com/us/en/institutional/etfs/funds/spdr-sp-600-small-cap-growth-etf-slyg + SP600 = "SLYG", SP1000 = "SMD" ) } @@ -246,7 +247,7 @@ index_download <- function(x, index_name) { tryCatch({ # Download to disk, force as a xlsx - httr::GET(spdr_link, httr::write_disk(tf <- tempfile(fileext = ".xlsx"))) + curl::curl_download(spdr_link, tf <- tempfile(fileext = ".xlsx")) # Read the xls file suppressMessages({ @@ -261,7 +262,7 @@ index_download <- function(x, index_name) { }, error = function(e) { # On error, catch it and return - res$err <- paste0("Error at ", index_name, " during download. \n", e) + res$err <- paste0("Error at ", index_name, x, " during download. \n", e) return(res) diff --git a/R/tq_transmute.R b/R/tq_transmute.R index 566c1cb9..1c0c42fa 100644 --- a/R/tq_transmute.R +++ b/R/tq_transmute.R @@ -129,7 +129,7 @@ tq_transmute_.grouped_df <- function(data, select = NULL, mutate_fun, col_rename col_rename = col_rename, ...) ) %>% - dplyr::select(-data) %>% + dplyr::select(-"data") %>% tidyr::unnest(cols = nested.col) %>% dplyr::group_by_at(.vars = group_names) } @@ -268,7 +268,7 @@ tq_transmute_xy_.grouped_df <- function(data, x, y = NULL, mutate_fun, col_renam col_rename = col_rename, ...) ) %>% - dplyr::select(-data) %>% + dplyr::select(-"data") %>% tidyr::unnest(cols = nested.col) %>% dplyr::group_by_at(.vars = group_names) } diff --git a/README.Rmd b/README.Rmd index 066514f4..4ec3d3fe 100644 --- a/README.Rmd +++ b/README.Rmd @@ -14,20 +14,21 @@ knitr::opts_chunk$set( message = F, warning = F ) -devtools::load_all() ``` -# tidyquant +# tidyquant -[![R-CMD-check](https://github.com/business-science/tidyquant/workflows/R-CMD-check/badge.svg)](https://github.com/business-science/tidyquant/actions) + +[![R-CMD-check](https://github.com/business-science/tidyquant/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/business-science/tidyquant/actions/workflows/R-CMD-check.yaml) [![codecov](https://codecov.io/gh/business-science/tidyquant/branch/master/graph/badge.svg)](https://app.codecov.io/gh/business-science/tidyquant) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/tidyquant)](https://cran.r-project.org/package=tidyquant) ![](http://cranlogs.r-pkg.org/badges/tidyquant?color=brightgreen) ![](http://cranlogs.r-pkg.org/badges/grand-total/tidyquant?color=brightgreen) + > Bringing financial and business analysis to the tidyverse -## 2-Minutes To Tidyquant +## 2-Minutes To tidyquant Our short introduction to `tidyquant` on [YouTube](https://www.youtube.com/embed/woxJZTL2hok). @@ -37,13 +38,13 @@ Our short introduction to `tidyquant` on -# Features of Tidyquant +# Features of tidyquant `tidyquant` integrates the best resources for collecting and analyzing financial data, `zoo`, `xts`, `quantmod`, `TTR`, and `PerformanceAnalytics`, with the tidy data infrastructure of the `tidyverse` allowing for seamless interaction between each. You can now perform complete financial analyses in the `tidyverse`. * __A few core functions with a lot of power__ * __Integrates the quantitative analysis functionality of `zoo`, `xts`, `quantmod`, `TTR`, and _now_ `PerformanceAnalytics`__ -* __Designed for modeling and scaling analyses using the the `tidyverse` tools in [_R for Data Science_](https://r4ds.had.co.nz/)__ +* __Designed for modeling and scaling analyses using the the `tidyverse` tools in [_R for Data Science_](https://r4ds.hadley.nz/)__ * __Implements `ggplot2` functionality for beautiful and meaningful financial visualizations__ * __User-friendly documentation to get you up to speed quickly!__ diff --git a/README.md b/README.md index d576f4ab..a7312040 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,27 @@ -# tidyquant +# tidyquant -[![R-CMD-check](https://github.com/business-science/tidyquant/workflows/R-CMD-check/badge.svg)](https://github.com/business-science/tidyquant/actions) + + +[![R-CMD-check](https://github.com/business-science/tidyquant/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/business-science/tidyquant/actions/workflows/R-CMD-check.yaml) [![codecov](https://codecov.io/gh/business-science/tidyquant/branch/master/graph/badge.svg)](https://app.codecov.io/gh/business-science/tidyquant) -[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/tidyquant)](https://cran.r-project.org/package=tidyquant) +[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/tidyquant)](https://cran.r-project.org/package=tidyquant) ![](http://cranlogs.r-pkg.org/badges/tidyquant?color=brightgreen) ![](http://cranlogs.r-pkg.org/badges/grand-total/tidyquant?color=brightgreen) + > Bringing financial and business analysis to the tidyverse -## 2-Minutes To Tidyquant +## 2-Minutes To tidyquant Our short introduction to `tidyquant` on [YouTube](https://www.youtube.com/embed/woxJZTL2hok). Anomalize -# Features of Tidyquant +# Features of tidyquant `tidyquant` integrates the best resources for collecting and analyzing financial data, `zoo`, `xts`, `quantmod`, `TTR`, and @@ -26,22 +29,20 @@ financial data, `zoo`, `xts`, `quantmod`, `TTR`, and `tidyverse` allowing for seamless interaction between each. You can now perform complete financial analyses in the `tidyverse`. -- **A few core functions with a lot of power** -- **Integrates the quantitative analysis functionality of `zoo`, - `xts`, `quantmod`, `TTR`, and *now* `PerformanceAnalytics`** -- **Designed for modeling and scaling analyses using the the - `tidyverse` tools in [*R for Data - Science*](https://r4ds.had.co.nz/)** -- **Implements `ggplot2` functionality for beautiful and meaningful - financial visualizations** -- **User-friendly documentation to get you up to speed quickly!** +- **A few core functions with a lot of power** +- **Integrates the quantitative analysis functionality of `zoo`, `xts`, + `quantmod`, `TTR`, and *now* `PerformanceAnalytics`** +- **Designed for modeling and scaling analyses using the the `tidyverse` + tools in [*R for Data Science*](https://r4ds.hadley.nz/)** +- **Implements `ggplot2` functionality for beautiful and meaningful + financial visualizations** +- **User-friendly documentation to get you up to speed quickly!** ### New Excel Functionality in tidyquant -- [**Excel in R - Pivot Tables, VLOOKUPs, and - more**](https://www.business-science.io/finance/2020/02/26/r-for-excel-users.html): - Details on the **Excel integrations** are covered in the blog - article. +- [**Excel in R - Pivot Tables, VLOOKUPs, and + more**](https://www.business-science.io/finance/2020/02/26/r-for-excel-users.html): + Details on the **Excel integrations** are covered in the blog article. ## One-Stop Shop for Serious Financial Analysis @@ -50,26 +51,25 @@ for serious financial analysis!* ### Core Functions -- **Getting Financial Data from the web: `tq_get()`**. This is a - one-stop shop for getting web-based financial data in a “tidy” data - frame format. Get data for daily stock prices (historical), key - statistics (real-time), key ratios (historical), financial - statements, dividends, splits, economic data from the FRED, FOREX - rates from Oanda. - -- **Manipulating Financial Data: `tq_transmute()` and `tq_mutate()`**. - Integration for many financial functions from `xts`, `zoo`, - `quantmod`,`TTR` and `PerformanceAnalytics` packages. `tq_mutate()` - is used to add a column to the data frame, and `tq_transmute()` is - used to return a new data frame which is necessary for periodicity - changes. - -- **Performance Analysis and Portfolio Analysis: `tq_performance()` - and `tq_portfolio()`**. The newest additions to the `tidyquant` - family integrate `PerformanceAnalytics` functions. - `tq_performance()` converts investment returns into performance - metrics. `tq_portfolio()` aggregates a group (or multiple groups) of - asset returns into one or more portfolios. +- **Getting Financial Data from the web: `tq_get()`**. This is a + one-stop shop for getting web-based financial data in a “tidy” data + frame format. Get data for daily stock prices (historical), key + statistics (real-time), key ratios (historical), financial statements, + dividends, splits, economic data from the FRED, FOREX rates from + Oanda. + +- **Manipulating Financial Data: `tq_transmute()` and `tq_mutate()`**. + Integration for many financial functions from `xts`, `zoo`, + `quantmod`,`TTR` and `PerformanceAnalytics` packages. `tq_mutate()` is + used to add a column to the data frame, and `tq_transmute()` is used + to return a new data frame which is necessary for periodicity changes. + +- **Performance Analysis and Portfolio Analysis: `tq_performance()` and + `tq_portfolio()`**. The newest additions to the `tidyquant` family + integrate `PerformanceAnalytics` functions. `tq_performance()` + converts investment returns into performance metrics. `tq_portfolio()` + aggregates a group (or multiple groups) of asset returns into one or + more portfolios. ### Comparing Stock Prices @@ -80,8 +80,8 @@ quick and easy… ### Evaluating Stock Performance -What about stock performance? Quickly visualize how a $10,000 investment -in various stocks would perform. +What about stock performance? Quickly visualize how a \$10,000 +investment in various stocks would perform. @@ -91,10 +91,10 @@ Ok, stocks are too easy. What about portfolios? With the `PerformanceAnalytics` integration, visualizing blended portfolios are easy too! -- Portfolio 1: 50% FB, 25% AMZN, 25% NFLX, 0% GOOG -- Portfolio 2: 0% FB, 50% AMZN, 25% NFLX, 25% GOOG -- Portfolio 3: 25% FB, 0% AMZN, 50% NFLX, 25% GOOG -- Portfolio 4: 25% FB, 25% AMZN, 0% NFLX, 50% GOOG +- Portfolio 1: 50% FB, 25% AMZN, 25% NFLX, 0% GOOG +- Portfolio 2: 0% FB, 50% AMZN, 25% NFLX, 25% GOOG +- Portfolio 3: 25% FB, 0% AMZN, 50% NFLX, 25% GOOG +- Portfolio 4: 25% FB, 25% AMZN, 0% NFLX, 50% GOOG @@ -121,46 +121,45 @@ install.packages("tidyquant") The `tidyquant` package includes several vignettes to help users get up to speed quickly: -- [TQ00 - Introduction to - `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ00-introduction-to-tidyquant.html) -- [TQ01 - Core Functions in - `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ01-core-functions-in-tidyquant.html) -- [TQ02 - R Quantitative Analysis Package Integrations in - `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ02-quant-integrations-in-tidyquant.html) -- [TQ03 - Scaling and Modeling with - `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ03-scaling-and-modeling-with-tidyquant.html) -- [TQ04 - Charting with - `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ04-charting-with-tidyquant.html) -- [TQ05 - Performance Analysis with - `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ05-performance-analysis-with-tidyquant.html) -- [Blog Article: Excel in R - Pivot Tables, VLOOKUPs, and - more!](https://www.business-science.io/finance/2020/02/26/r-for-excel-users.html) +- [TQ00 - Introduction to + `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ00-introduction-to-tidyquant.html) +- [TQ01 - Core Functions in + `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ01-core-functions-in-tidyquant.html) +- [TQ02 - R Quantitative Analysis Package Integrations in + `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ02-quant-integrations-in-tidyquant.html) +- [TQ03 - Scaling and Modeling with + `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ03-scaling-and-modeling-with-tidyquant.html) +- [TQ04 - Charting with + `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ04-charting-with-tidyquant.html) +- [TQ05 - Performance Analysis with + `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ05-performance-analysis-with-tidyquant.html) +- [Blog Article: Excel in R - Pivot Tables, VLOOKUPs, and + more!](https://www.business-science.io/finance/2020/02/26/r-for-excel-users.html) # Want to Learn tidyquant? -- [Learning Lab - \#9:](https://university.business-science.io/p/learning-labs-pro) +- [Learning Lab + \#9:](https://university.business-science.io/p/learning-labs-pro) - - **Performance Analysis & Portfolio Optimization with - `tidyquant`** - A 1-hour course on `tidyquant` in Learning Labs - PRO + - **Performance Analysis & Portfolio Optimization with `tidyquant`** - + A 1-hour course on `tidyquant` in Learning Labs PRO -- [Learning Lab - \#10:](https://university.business-science.io/p/learning-labs-pro) +- [Learning Lab + \#10:](https://university.business-science.io/p/learning-labs-pro) - - **Building an API with `plumber`** - Build a stock optimization - API with `plumber` and `tidyquant` + - **Building an API with `plumber`** - Build a stock optimization API + with `plumber` and `tidyquant` -- [Learning Lab - \#16:](https://university.business-science.io/p/learning-labs-pro) +- [Learning Lab + \#16:](https://university.business-science.io/p/learning-labs-pro) - - **Stock Portfolio Optimization and Nonlinear Programming** - Use - the `ROI` package with `tidyquant` to calculate optimal minimum - variance portfolios and develop an efficient frontier. + - **Stock Portfolio Optimization and Nonlinear Programming** - Use the + `ROI` package with `tidyquant` to calculate optimal minimum variance + portfolios and develop an efficient frontier. -- [Learning Lab - \#30:](https://university.business-science.io/courses/learning-labs-pro/lectures/14630075) +- [Learning Lab + \#30:](https://university.business-science.io/courses/learning-labs-pro/lectures/14630075) - - **Shiny Financial Analysis with Tidyquant API & Excel Pivot - Tables** - Learn how to use the new Excel Functionality to make - Pivot Tables, VLOOKUPs, Sum-If’s, and more! + - **Shiny Financial Analysis with Tidyquant API & Excel Pivot + Tables** - Learn how to use the new Excel Functionality to make + Pivot Tables, VLOOKUPs, Sum-If’s, and more! diff --git a/_pkgdown.yml b/_pkgdown.yml index 7606124b..2ddf5e0c 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -12,40 +12,30 @@ template: ganalytics: UA-76139189-2 navbar: - title: "tidyquant" - left: - - text: "Home" - href: index.html - - text: "Getting Started" - href: articles/TQ00-introduction-to-tidyquant.html - - text: "Tutorials" - href: articles/index.html - menu: - - text: 'Financial Workflow' - - text: "Introduction to tidyquant" - href: articles/TQ00-introduction-to-tidyquant.html - - text: "Core functions" - href: articles/TQ01-core-functions-in-tidyquant.html - - text: "Quantitative integrations" - href: articles/TQ02-quant-integrations-in-tidyquant.html - - text: "Scaling and modeling" - href: articles/TQ03-scaling-and-modeling-with-tidyquant.html - - text: "Charting" - href: articles/TQ04-charting-with-tidyquant.html - - text: "Performance analysis" - href: articles/TQ05-performance-analysis-with-tidyquant.html - - text: '---' - - text: 'Excel Users' - - text: "Excel in R" - href: articles/TQ06-excel-in-r.html - - text: "API Reference" - href: reference/index.html - - text: "News" - href: news/index.html + structure: + left: [intro, articles, reference, news] + components: + intro: + text: Getting Started + href: articles/TQ00-introduction-to-tidyquant.html + news: + text: News + href: news/index.html - right: - - icon: fab fa-github - href: https://github.com/business-science/tidyquant +articles: +- title: Financial + navbar: Financial Workflow + contents: + - TQ00-introduction-to-tidyquant + - TQ01-core-functions-in-tidyquant + - TQ02-quant-integrations-in-tidyquant + - TQ03-scaling-and-modeling-with-tidyquant + - TQ04-charting-with-tidyquant + - TQ05-performance-analysis-with-tidyquant +- title: Excel + navbar: Excel Users + contents: + - TQ06-excel-in-r reference: diff --git a/data-raw/FANG.R b/data-raw/FANG.R new file mode 100644 index 00000000..f5226639 --- /dev/null +++ b/data-raw/FANG.R @@ -0,0 +1,5 @@ +## code to prepare `FANG` dataset goes here +FANG <- readr::read_csv("data-raw/FANG.csv") +FANG <- FANG %>% + mutate(symbol = ifelse(symbol == "FB", "META", symbol)) +usethis::use_data(FANG, overwrite = TRUE) diff --git a/data-raw/FANG.csv b/data-raw/FANG.csv new file mode 100644 index 00000000..be12927e --- /dev/null +++ b/data-raw/FANG.csv @@ -0,0 +1,4033 @@ +symbol,date,open,high,low,close,volume,adjusted +FB,2013-01-02,27.440001,28.18,27.42,28,69846400,28 +FB,2013-01-03,27.879999,28.469999,27.59,27.77,63140600,27.77 +FB,2013-01-04,28.01,28.93,27.83,28.76,72715400,28.76 +FB,2013-01-07,28.690001,29.790001,28.65,29.42,83781800,29.42 +FB,2013-01-08,29.51,29.6,28.860001,29.059999,45871300,29.059999 +FB,2013-01-09,29.67,30.6,29.49,30.59,104787700,30.59 +FB,2013-01-10,30.6,31.450001,30.280001,31.299999,95316400,31.299999 +FB,2013-01-11,31.280001,31.959999,31.1,31.719999,89598000,31.719999 +FB,2013-01-14,32.080002,32.209999,30.620001,30.950001,98892800,30.950001 +FB,2013-01-15,30.639999,31.709999,29.879999,30.1,173242600,30.1 +FB,2013-01-16,30.209999,30.35,29.530001,29.85,75332700,29.85 +FB,2013-01-17,30.08,30.42,30.030001,30.139999,40256700,30.139999 +FB,2013-01-18,30.309999,30.440001,29.27,29.66,49631500,29.66 +FB,2013-01-22,29.75,30.889999,29.74,30.73,55243300,30.73 +FB,2013-01-23,31.1,31.5,30.799999,30.82,48899800,30.82 +FB,2013-01-24,31.27,31.49,30.809999,31.08,43845100,31.08 +FB,2013-01-25,31.41,31.93,31.129999,31.540001,54363600,31.540001 +FB,2013-01-28,31.879999,32.509998,31.809999,32.470001,59682500,32.470001 +FB,2013-01-29,32,32.07,30.709999,30.790001,72976500,30.790001 +FB,2013-01-30,30.98,31.49,30.879999,31.24,87682100,31.24 +FB,2013-01-31,29.15,31.469999,28.74,30.98,190744900,30.98 +FB,2013-02-01,31.01,31.02,29.629999,29.73,85856700,29.73 +FB,2013-02-04,29.059999,29.200001,28.01,28.110001,92362200,28.110001 +FB,2013-02-05,28.26,28.959999,28.040001,28.639999,47948200,28.639999 +FB,2013-02-06,28.74,29.290001,28.66,29.049999,38375900,29.049999 +FB,2013-02-07,29.110001,29.15,28.27,28.65,34540100,28.65 +FB,2013-02-08,28.889999,29.17,28.51,28.549999,37708800,28.549999 +FB,2013-02-11,28.610001,28.68,28.040001,28.26,37361800,28.26 +FB,2013-02-12,27.67,28.16,27.1,27.370001,93498700,27.370001 +FB,2013-02-13,27.360001,28.32,27.309999,27.91,50164000,27.91 +FB,2013-02-14,28.02,28.629999,28.01,28.5,35615800,28.5 +FB,2013-02-15,28.52,28.75,28.09,28.32,33109300,28.32 +FB,2013-02-19,28.23,29.08,28.120001,28.93,49396400,28.93 +FB,2013-02-20,28.92,29.049999,28.33,28.459999,42098200,28.459999 +FB,2013-02-21,28.280001,28.549999,27.15,27.280001,49642300,27.280001 +FB,2013-02-22,27.620001,27.629999,26.82,27.129999,36350200,27.129999 +FB,2013-02-25,27.16,27.639999,27.15,27.27,34652000,27.27 +FB,2013-02-26,27.360001,27.459999,26.700001,27.389999,31611700,27.389999 +FB,2013-02-27,27.34,27.34,26.629999,26.870001,44319700,26.870001 +FB,2013-02-28,26.84,27.299999,26.34,27.25,83027800,27.25 +FB,2013-03-01,27.049999,28.120001,26.809999,27.780001,54064800,27.780001 +FB,2013-03-04,27.76,28.059999,27.440001,27.719999,32400700,27.719999 +FB,2013-03-05,27.879999,28.18,27.209999,27.52,40622200,27.52 +FB,2013-03-06,28.1,28.129999,27.35,27.450001,33532600,27.450001 +FB,2013-03-07,27.57,28.68,27.469999,28.58,74540200,28.58 +FB,2013-03-08,28.43,28.469999,27.73,27.959999,44198900,27.959999 +FB,2013-03-11,28.01,28.639999,27.83,28.139999,35642100,28.139999 +FB,2013-03-12,28.1,28.32,27.6,27.83,27569600,27.83 +FB,2013-03-13,27.620001,27.65,26.92,27.08,39619500,27.08 +FB,2013-03-14,27.1,27.43,26.83,27.040001,27646400,27.040001 +FB,2013-03-15,27.030001,27.059999,26.559999,26.65,31597400,26.65 +FB,2013-03-18,26.370001,26.790001,25.780001,26.49,26653700,26.49 +FB,2013-03-19,26.530001,26.9,26.209999,26.549999,25254200,26.549999 +FB,2013-03-20,26.68,26.690001,25.780001,25.860001,44006500,25.860001 +FB,2013-03-21,25.66,26.110001,25.559999,25.74,24336100,25.74 +FB,2013-03-22,25.799999,26.01,25.629999,25.73,18456300,25.73 +FB,2013-03-25,25.75,25.799999,25.08,25.129999,39199000,25.129999 +FB,2013-03-26,25.08,25.48,25.030001,25.209999,26957200,25.209999 +FB,2013-03-27,25,26.280001,24.719999,26.09,52297400,26.09 +FB,2013-03-28,26.09,26.17,25.52,25.58,28585700,25.58 +FB,2013-04-01,25.629999,25.889999,25.280001,25.530001,22249300,25.530001 +FB,2013-04-02,25.77,26.120001,25.299999,25.42,35153300,25.42 +FB,2013-04-03,25.83,26.389999,25.700001,26.25,48195200,26.25 +FB,2013-04-04,26.620001,27.23,26.110001,27.07,82016800,27.07 +FB,2013-04-05,26.860001,27.799999,26.610001,27.389999,64566600,27.389999 +FB,2013-04-08,27.190001,27.200001,26.629999,26.85,27256000,26.85 +FB,2013-04-09,26.58,26.889999,26.42,26.59,21311100,26.59 +FB,2013-04-10,27.01,27.84,26.9,27.57,45949400,27.57 +FB,2013-04-11,27.48,28.1,27.25,28.02,33368500,28.02 +FB,2013-04-12,28,28,27.24,27.4,28697400,27.4 +FB,2013-04-15,27.16,27.48,26.360001,26.52,30275400,26.52 +FB,2013-04-16,26.809999,27.110001,26.4,26.92,27365900,26.92 +FB,2013-04-17,26.65,27.200001,26.389999,26.629999,26440600,26.629999 +FB,2013-04-18,26.82,26.82,25.15,25.690001,39059000,25.690001 +FB,2013-04-19,25.620001,25.959999,25.33,25.73,20380900,25.73 +FB,2013-04-22,25.809999,26.360001,25.700001,25.969999,25687600,25.969999 +FB,2013-04-23,26.219999,26.33,25.77,25.98,25191500,25.98 +FB,2013-04-24,25.93,26.4,25.799999,26.110001,19729900,26.110001 +FB,2013-04-25,26.07,26.4,26,26.139999,17150000,26.139999 +FB,2013-04-26,26.6,27.620001,26.6,26.85,33018000,26.85 +FB,2013-04-29,27.16,27.41,26.860001,26.98,29201100,26.98 +FB,2013-04-30,27.129999,27.85,27.01,27.77,36245700,27.77 +FB,2013-05-01,27.85,27.92,27.309999,27.43,64567600,27.43 +FB,2013-05-02,28.01,29.02,27.98,28.969999,104257000,28.969999 +FB,2013-05-03,29.040001,29.07,28.15,28.309999,58506400,28.309999 +FB,2013-05-06,28.33,28.459999,27.48,27.57,43939400,27.57 +FB,2013-05-07,27.549999,27.85,26.85,26.889999,41259100,26.889999 +FB,2013-05-08,26.879999,27.299999,26.65,27.120001,34654900,27.120001 +FB,2013-05-09,27.08,27.549999,26.85,27.040001,33457200,27.040001 +FB,2013-05-10,27.139999,27.299999,26.57,26.68,30847100,26.68 +FB,2013-05-13,26.6,27.33,26.530001,26.82,29068800,26.82 +FB,2013-05-14,26.889999,27.280001,26.82,27.07,24930300,27.07 +FB,2013-05-15,26.92,26.99,26.4,26.6,30299800,26.6 +FB,2013-05-16,26.48,26.549999,25.9,26.129999,35499100,26.129999 +FB,2013-05-17,26.4,26.6,26.200001,26.25,29462700,26.25 +FB,2013-05-20,26.18,26.190001,25.690001,25.76,42402900,25.76 +FB,2013-05-21,25.870001,26.08,25.59,25.66,26261300,25.66 +FB,2013-05-22,25.65,25.85,24.92,25.16,45314500,25.16 +FB,2013-05-23,24.799999,25.530001,24.77,25.059999,37663100,25.059999 +FB,2013-05-24,24.969999,24.969999,24.08,24.309999,58727900,24.309999 +FB,2013-05-28,24.540001,24.540001,23.92,24.1,50079700,24.1 +FB,2013-05-29,23.790001,23.809999,23.26,23.32,64237800,23.32 +FB,2013-05-30,24.129999,24.780001,23.93,24.549999,60733200,24.549999 +FB,2013-05-31,24.629999,24.950001,24.27,24.35,35925000,24.35 +FB,2013-06-03,24.27,24.32,23.709999,23.85,35733800,23.85 +FB,2013-06-04,23.889999,23.93,23.32,23.52,34760800,23.52 +FB,2013-06-05,23.35,23.709999,22.790001,22.9,53819700,22.9 +FB,2013-06-06,22.99,23.09,22.67,22.969999,31260700,22.969999 +FB,2013-06-07,23.030001,23.4,22.860001,23.290001,38699200,23.290001 +FB,2013-06-10,24.059999,24.6,23.99,24.33,58393000,24.33 +FB,2013-06-11,24.030001,24.35,24,24.030001,29885900,24.030001 +FB,2013-06-12,24.16,24.26,23.58,23.77,26445800,23.77 +FB,2013-06-13,23.719999,23.83,23.27,23.73,31189300,23.73 +FB,2013-06-14,23.559999,23.889999,23.26,23.629999,30677100,23.629999 +FB,2013-06-17,23.91,24.25,23.75,24.02,33664500,24.02 +FB,2013-06-18,24.09,24.690001,24.08,24.209999,36709100,24.209999 +FB,2013-06-19,24.200001,25.190001,24.1,24.309999,31790600,24.309999 +FB,2013-06-20,24.280001,24.75,23.65,23.9,42765600,23.9 +FB,2013-06-21,24.59,24.700001,24.049999,24.530001,45833900,24.530001 +FB,2013-06-24,23.950001,24.110001,23.379999,23.940001,40626000,23.940001 +FB,2013-06-25,24.139999,24.43,24.040001,24.25,24713200,24.25 +FB,2013-06-26,24.51,24.65,23.99,24.16,29890300,24.16 +FB,2013-06-27,24.24,24.84,24.209999,24.66,34694100,24.66 +FB,2013-06-28,24.68,24.98,24.42,24.879999,96778900,24.879999 +FB,2013-07-01,24.969999,25.059999,24.620001,24.809999,20582200,24.809999 +FB,2013-07-02,24.700001,24.77,24.299999,24.41,18394100,24.41 +FB,2013-07-03,24.219999,24.709999,24.15,24.52,10404400,24.52 +FB,2013-07-05,24.65,24.66,24.200001,24.370001,20229500,24.370001 +FB,2013-07-08,24.469999,25.040001,24.42,24.709999,27064600,24.709999 +FB,2013-07-09,25.07,25.49,25.030001,25.48,30387900,25.48 +FB,2013-07-10,25.58,25.83,25.469999,25.799999,26721800,25.799999 +FB,2013-07-11,25.959999,26,25.450001,25.809999,26777400,25.809999 +FB,2013-07-12,25.74,25.93,25.549999,25.91,16537900,25.91 +FB,2013-07-15,25.93,26.43,25.65,26.280001,24234000,26.280001 +FB,2013-07-16,26.389999,26.75,26.01,26.32,30817600,26.32 +FB,2013-07-17,26.370001,26.780001,26.299999,26.65,21518500,26.65 +FB,2013-07-18,26.75,26.77,26.120001,26.18,24806900,26.18 +FB,2013-07-19,25.82,26.110001,25.6,25.879999,46539700,25.879999 +FB,2013-07-22,25.99,26.129999,25.719999,26.049999,27526300,26.049999 +FB,2013-07-23,26.1,26.299999,25.969999,26.129999,28221600,26.129999 +FB,2013-07-24,26.32,26.530001,26.049999,26.51,82635600,26.51 +FB,2013-07-25,33.540001,34.880001,32.75,34.360001,365457900,34.360001 +FB,2013-07-26,33.77,34.73,33.560001,34.009998,136028900,34.009998 +FB,2013-07-29,34.07,35.630001,34.009998,35.43,124718800,35.43 +FB,2013-07-30,35.650002,37.959999,35.32,37.630001,173582800,37.630001 +FB,2013-07-31,37.959999,38.310001,36.330002,36.799999,154828700,36.799999 +FB,2013-08-01,37.299999,38.290001,36.919998,37.490002,106066500,37.490002 +FB,2013-08-02,37.66,38.490002,37.5,38.049999,73058500,38.049999 +FB,2013-08-05,38.43,39.32,38.25,39.189999,79994800,39.189999 +FB,2013-08-06,39.110001,39.25,37.939999,38.549999,63950800,38.549999 +FB,2013-08-07,38.610001,38.939999,37.700001,38.869999,68854800,38.869999 +FB,2013-08-08,39.130001,39.189999,38.43,38.540001,41301000,38.540001 +FB,2013-08-09,38.59,38.740002,38.009998,38.5,43532300,38.5 +FB,2013-08-12,38.200001,38.5,38.099998,38.220001,31161000,38.220001 +FB,2013-08-13,38.240002,38.32,36.77,37.02,65379200,37.02 +FB,2013-08-14,36.830002,37.549999,36.619999,36.650002,48423900,36.650002 +FB,2013-08-15,36.360001,37.07,36.02,36.560001,56521100,36.560001 +FB,2013-08-16,36.970001,37.490002,36.900002,37.080002,45840800,37.080002 +FB,2013-08-19,37.43,38.279999,37.139999,37.810001,57609600,37.810001 +FB,2013-08-20,38.349998,38.580002,37.689999,38.41,57995200,38.41 +FB,2013-08-21,38.380001,38.849998,38.150002,38.32,46116900,38.32 +FB,2013-08-22,38.369999,38.75,38.34,38.549999,21931200,38.549999 +FB,2013-08-23,39,40.630001,38.93,40.549999,86442300,40.549999 +FB,2013-08-26,40.900002,41.939999,40.619999,41.34,94162400,41.34 +FB,2013-08-27,40.68,41.200001,39.419998,39.639999,72695100,39.639999 +FB,2013-08-28,39.959999,40.849998,39.880001,40.549999,57918200,40.549999 +FB,2013-08-29,40.889999,41.779999,40.799999,41.279999,58303400,41.279999 +FB,2013-08-30,42.02,42.259998,41.060001,41.290001,67735100,41.290001 +FB,2013-09-03,41.84,42.16,41.509998,41.869999,48774900,41.869999 +FB,2013-09-04,42.009998,42.169998,41.439999,41.779999,42581900,41.779999 +FB,2013-09-05,41.790001,42.77,41.77,42.66,50035400,42.66 +FB,2013-09-06,43.09,44.610001,42.400002,43.950001,117535700,43.950001 +FB,2013-09-09,44.360001,44.790001,43.700001,44.040001,75794700,44.040001 +FB,2013-09-10,44.240002,44.259998,43.23,43.599998,54540300,43.599998 +FB,2013-09-11,43.389999,45.09,43.110001,45.040001,72328300,45.040001 +FB,2013-09-12,45.529999,45.619999,44.650002,44.75,68072300,44.75 +FB,2013-09-13,45.040001,45.080002,43.93,44.310001,52765300,44.310001 +FB,2013-09-16,44.849998,44.939999,42.43,42.509998,70424200,42.509998 +FB,2013-09-17,42.5,45.439999,42.43,45.07,91934600,45.07 +FB,2013-09-18,44.84,45.470001,44.400002,45.23,79317000,45.23 +FB,2013-09-19,45.509998,46.049999,45.23,45.98,63972400,45.98 +FB,2013-09-20,46.32,47.599998,45.740002,47.490002,115508400,47.490002 +FB,2013-09-23,47.279999,47.549999,46.290001,47.189999,75177000,47.189999 +FB,2013-09-24,48.509998,49.66,48.16,48.450001,136716100,48.450001 +FB,2013-09-25,49.23,49.540001,48.459999,49.459999,87879700,49.459999 +FB,2013-09-26,50.009998,50.599998,49.5,50.389999,98220100,50.389999 +FB,2013-09-27,50.290001,51.279999,49.860001,51.240002,81410500,51.240002 +FB,2013-09-30,50.139999,51.599998,49.799999,50.23,100095000,50.23 +FB,2013-10-01,49.970001,51.029999,49.450001,50.419998,98114000,50.419998 +FB,2013-10-02,50.130001,51.099998,49.950001,50.279999,62834000,50.279999 +FB,2013-10-03,50.470001,50.720001,49.060001,49.18,82045000,49.18 +FB,2013-10-04,49.77,51.16,49.57,51.040001,74447000,51.040001 +FB,2013-10-07,50.73,51.290001,50.400002,50.52,57204000,50.52 +FB,2013-10-08,50.599998,50.599998,47.080002,47.139999,136081000,47.139999 +FB,2013-10-09,47.380001,47.84,45.259998,46.77,147297000,46.77 +FB,2013-10-10,47.869999,49.68,47.830002,49.049999,99774000,49.049999 +FB,2013-10-11,49.18,49.869999,48.790001,49.110001,58428000,49.110001 +FB,2013-10-14,48.310001,49.630001,47.91,49.509998,68781000,49.509998 +FB,2013-10-15,49.990002,51,49.18,49.5,81167000,49.5 +FB,2013-10-16,50.040001,51.240002,49.900002,51.139999,64678000,51.139999 +FB,2013-10-17,51.119999,52.220001,50.950001,52.209999,71522000,52.209999 +FB,2013-10-18,54.18,54.830002,53.599998,54.220001,88260000,54.220001 +FB,2013-10-21,54.68,54.810001,53.509998,53.849998,58235000,53.849998 +FB,2013-10-22,54.330002,54.759998,52.200001,52.68,83204000,52.68 +FB,2013-10-23,51.75,52.25,51.130001,51.900002,57207000,51.900002 +FB,2013-10-24,52.380001,52.84,51.59,52.450001,46775000,52.450001 +FB,2013-10-25,53.18,53.240002,51.880001,51.950001,45085000,51.950001 +FB,2013-10-28,51.540001,51.700001,49.610001,50.23,73472000,50.23 +FB,2013-10-29,50.73,50.790001,49.25,49.400002,102143000,49.400002 +FB,2013-10-30,50,50.209999,48.75,49.009998,127073000,49.009998 +FB,2013-10-31,47.16,52,46.5,50.209999,248809000,50.209999 +FB,2013-11-01,50.849998,52.09,49.720001,49.75,95033000,49.75 +FB,2013-11-04,49.369999,49.75,48.02,48.220001,80371000,48.220001 +FB,2013-11-05,47.790001,50.18,47.509998,50.110001,76835000,50.110001 +FB,2013-11-06,50.259998,50.450001,48.709999,49.119999,67889000,49.119999 +FB,2013-11-07,49.240002,49.869999,47.299999,47.560001,97128000,47.560001 +FB,2013-11-08,47.810001,48.650002,47.25,47.529999,70731000,47.529999 +FB,2013-11-11,47.040001,47.529999,45.73,46.200001,80910000,46.200001 +FB,2013-11-12,46,47.369999,45.830002,46.610001,68196000,46.610001 +FB,2013-11-13,46.23,48.740002,46.060001,48.709999,79245000,48.709999 +FB,2013-11-14,48.700001,49.57,48.029999,48.990002,75117000,48.990002 +FB,2013-11-15,49.110001,49.48,48.709999,49.009998,42453000,49.009998 +FB,2013-11-18,48.470001,48.84,45.799999,45.830002,85910000,45.830002 +FB,2013-11-19,46.259998,47,45.720001,46.360001,75602000,46.360001 +FB,2013-11-20,46.610001,47.549999,46.310001,46.43,53933000,46.43 +FB,2013-11-21,46.990002,47.459999,46.689999,46.700001,34886000,46.700001 +FB,2013-11-22,47.040001,47.27,45.959999,46.23,40545000,46.23 +FB,2013-11-25,46.360001,46.650002,44.040001,44.82,82565000,44.82 +FB,2013-11-26,44.66,46.169998,43.549999,45.889999,82016000,45.889999 +FB,2013-11-27,45.970001,46.669998,45.529999,46.490002,44993000,46.490002 +FB,2013-11-29,46.75,47.209999,46.5,47.009998,22953900,47.009998 +FB,2013-12-02,46.900002,47.540001,46.259998,47.060001,50774000,47.060001 +FB,2013-12-03,46.75,47.200001,46.290001,46.73,32086000,46.73 +FB,2013-12-04,46.459999,48.77,46.259998,48.619999,60890000,48.619999 +FB,2013-12-05,48.150002,48.700001,47.869999,48.34,43855000,48.34 +FB,2013-12-06,48.98,49.389999,47.709999,47.939999,42938000,47.939999 +FB,2013-12-09,48.09,48.970001,47.740002,48.84,36056000,48.84 +FB,2013-12-10,48.639999,50.77,48.540001,50.25,68479000,50.25 +FB,2013-12-11,50.549999,50.77,49.009998,49.380001,65776000,49.380001 +FB,2013-12-12,51.049999,52.07,50.66,51.830002,92723000,51.830002 +FB,2013-12-13,51.66,53.5,51.34,53.32,82641000,53.32 +FB,2013-12-16,53.25,54.5,52.91,53.810001,85119000,53.810001 +FB,2013-12-17,54.759998,55.18,54.240002,54.860001,78751000,54.860001 +FB,2013-12-18,54.860001,55.889999,53.75,55.57,76003000,55.57 +FB,2013-12-19,54.330002,55.189999,53.950001,55.049999,89753200,55.049999 +FB,2013-12-20,54.93,55.150002,54.23,55.119999,239824000,55.119999 +FB,2013-12-23,55.5,58.32,55.450001,57.77,98297000,57.77 +FB,2013-12-24,58.27,58.580002,56.91,57.959999,46617800,57.959999 +FB,2013-12-26,58.32,58.380001,57.369999,57.73,55101000,57.73 +FB,2013-12-27,57.48,57.68,55.25,55.439999,60466000,55.439999 +FB,2013-12-30,54.93,55.18,53.43,53.709999,68307000,53.709999 +FB,2013-12-31,54.119999,54.860001,53.91,54.650002,43076200,54.650002 +FB,2014-01-02,54.830002,55.220001,54.189999,54.709999,43195500,54.709999 +FB,2014-01-03,55.02,55.650002,54.529999,54.560001,38246200,54.560001 +FB,2014-01-06,54.419998,57.259998,54.049999,57.200001,68852600,57.200001 +FB,2014-01-07,57.700001,58.549999,57.220001,57.919998,77207400,57.919998 +FB,2014-01-08,57.599998,58.41,57.23,58.23,56682400,58.23 +FB,2014-01-09,58.650002,58.959999,56.650002,57.220001,92253300,57.220001 +FB,2014-01-10,57.130001,58.299999,57.060001,57.939999,42449500,57.939999 +FB,2014-01-13,57.91,58.25,55.380001,55.91,63010900,55.91 +FB,2014-01-14,56.459999,57.779999,56.099998,57.740002,37503600,57.740002 +FB,2014-01-15,57.98,58.57,57.27,57.599998,33663400,57.599998 +FB,2014-01-16,57.259998,58.02,56.830002,57.189999,34541800,57.189999 +FB,2014-01-17,57.299999,57.82,56.07,56.299999,40849200,56.299999 +FB,2014-01-21,56.599998,58.580002,56.5,58.509998,48669200,58.509998 +FB,2014-01-22,58.849998,59.310001,57.099998,57.509998,61352900,57.509998 +FB,2014-01-23,56.369999,56.68,55.689999,56.630001,47951800,56.630001 +FB,2014-01-24,56.150002,56.419998,54.400002,54.450001,55200700,54.450001 +FB,2014-01-27,54.73,54.939999,51.849998,53.549999,73924100,53.549999 +FB,2014-01-28,54.02,55.279999,54,55.139999,48191200,55.139999 +FB,2014-01-29,54.610001,54.950001,53.189999,53.529999,92995600,53.529999 +FB,2014-01-30,62.119999,62.5,60.459999,61.080002,150178900,61.080002 +FB,2014-01-31,60.470001,63.369999,60.169998,62.57,87794600,62.57 +FB,2014-02-03,63.029999,63.77,60.700001,61.48,74866600,61.48 +FB,2014-02-04,62.049999,63.139999,61.82,62.75,45985500,62.75 +FB,2014-02-05,62.740002,63.16,61.27,62.189999,51685100,62.189999 +FB,2014-02-06,61.459999,62.779999,61.459999,62.16,42086500,62.16 +FB,2014-02-07,62.27,64.57,62.220001,64.32,60704300,64.32 +FB,2014-02-10,64.300003,64.489998,63.470001,63.549999,43666100,63.549999 +FB,2014-02-11,63.75,65,63.349998,64.849998,45675600,64.849998 +FB,2014-02-12,64.919998,65.059998,64.050003,64.449997,47282100,64.449997 +FB,2014-02-13,64.18,67.330002,64.050003,67.330002,61911700,67.330002 +FB,2014-02-14,67.5,67.580002,66.720001,67.089996,36694900,67.089996 +FB,2014-02-18,66.940002,67.540001,66.07,67.300003,43809900,67.300003 +FB,2014-02-19,67.050003,69.080002,67,68.059998,62087100,68.059998 +FB,2014-02-20,67.730003,70.110001,65.730003,69.629997,130928900,69.629997 +FB,2014-02-21,69.690002,69.959999,68.449997,68.589996,70932400,68.589996 +FB,2014-02-24,68.739998,71.440002,68.540001,70.779999,76620300,70.779999 +FB,2014-02-25,70.949997,71,69.449997,69.849998,52077000,69.849998 +FB,2014-02-26,70.190002,71.220001,68.849998,69.260002,55322700,69.260002 +FB,2014-02-27,69.339996,70.010002,68.870003,68.940002,41653700,68.940002 +FB,2014-02-28,69.470001,69.879997,67.379997,68.459999,66783700,68.459999 +FB,2014-03-03,66.959999,68.050003,66.510002,67.410004,56824100,67.410004 +FB,2014-03-04,68.660004,68.900002,67.620003,68.800003,42013500,68.800003 +FB,2014-03-05,69.690002,71.970001,69.620003,71.57,74567700,71.57 +FB,2014-03-06,71.879997,71.889999,70.25,70.839996,46026500,70.839996 +FB,2014-03-07,71.080002,71.18,69.470001,69.800003,38927000,69.800003 +FB,2014-03-10,70.769997,72.150002,70.510002,72.029999,59871600,72.029999 +FB,2014-03-11,72.5,72.589996,69.959999,70.099998,59408300,70.099998 +FB,2014-03-12,69.860001,71.349998,69,70.879997,46340500,70.879997 +FB,2014-03-13,71.290001,71.349998,68.150002,68.830002,57091000,68.830002 +FB,2014-03-14,68.489998,69.43,67.459999,67.720001,48227000,67.720001 +FB,2014-03-17,68.18,68.949997,66.620003,68.739998,52197000,68.739998 +FB,2014-03-18,68.760002,69.599998,68.300003,69.190002,40827000,69.190002 +FB,2014-03-19,69.169998,69.290001,67.470001,68.239998,43981000,68.239998 +FB,2014-03-20,68.010002,68.230003,66.82,66.970001,44439000,66.970001 +FB,2014-03-21,67.529999,67.919998,66.18,67.239998,59999900,67.239998 +FB,2014-03-24,67.190002,67.360001,63.360001,64.099998,85696000,64.099998 +FB,2014-03-25,64.889999,66.190002,63.779999,64.889999,68786000,64.889999 +FB,2014-03-26,64.739998,64.949997,60.369999,60.389999,97503900,60.389999 +FB,2014-03-27,60.509998,61.900002,57.98,60.970001,112650000,60.970001 +FB,2014-03-28,61.34,61.950001,59.34,60.009998,67052000,60.009998 +FB,2014-03-31,60.779999,61.52,59.869999,60.240002,53011000,60.240002 +FB,2014-04-01,60.459999,62.66,60.240002,62.619999,59291000,62.619999 +FB,2014-04-02,63.209999,63.91,62.209999,62.720001,66277000,62.720001 +FB,2014-04-03,62.549999,63.169998,59.130001,59.490002,83859000,59.490002 +FB,2014-04-04,59.939999,60.200001,56.32,56.75,125214400,56.75 +FB,2014-04-07,55.900002,58,55.439999,56.950001,108488000,56.950001 +FB,2014-04-08,57.68,58.709999,57.169998,58.189999,78836000,58.189999 +FB,2014-04-09,59.630001,62.459999,59.189999,62.41,100215000,62.41 +FB,2014-04-10,63.080002,63.18,58.68,59.16,114988000,59.16 +FB,2014-04-11,57.599998,60.310001,57.310001,58.529999,91452000,58.529999 +FB,2014-04-14,60.09,60.450001,57.779999,58.889999,72325000,58.889999 +FB,2014-04-15,59.290001,59.68,55.880001,59.09,108623000,59.09 +FB,2014-04-16,59.790001,60.189999,57.740002,59.720001,78774000,59.720001 +FB,2014-04-17,59.299999,60.580002,58.720001,58.939999,88040000,58.939999 +FB,2014-04-21,59.459999,61.240002,59.150002,61.240002,60364000,61.240002 +FB,2014-04-22,62.650002,63.439999,62.220001,63.029999,60631000,63.029999 +FB,2014-04-23,63.450001,63.48,61.259998,61.360001,95908700,61.360001 +FB,2014-04-24,63.599998,63.650002,59.77,60.869999,138769000,60.869999 +FB,2014-04-25,59.970001,60.009998,57.57,57.709999,92502000,57.709999 +FB,2014-04-28,58.049999,58.310001,54.66,56.139999,107758000,56.139999 +FB,2014-04-29,56.09,58.279999,55.84,58.150002,75557000,58.150002 +FB,2014-04-30,57.580002,59.849998,57.16,59.779999,76093000,59.779999 +FB,2014-05-01,60.43,62.279999,60.209999,61.150002,82429000,61.150002 +FB,2014-05-02,61.299999,61.889999,60.18,60.459999,54189000,60.459999 +FB,2014-05-05,59.669998,61.349998,59.18,61.220001,46057000,61.220001 +FB,2014-05-06,60.98,61.150002,58.490002,58.529999,55901000,58.529999 +FB,2014-05-07,58.77,59.299999,56.259998,57.389999,78587000,57.389999 +FB,2014-05-08,57.23,58.82,56.5,56.759998,61251000,56.759998 +FB,2014-05-09,56.849998,57.650002,56.380001,57.240002,52584000,57.240002 +FB,2014-05-12,57.98,59.900002,57.98,59.830002,48575000,59.830002 +FB,2014-05-13,59.66,60.889999,59.509998,59.830002,48525000,59.830002 +FB,2014-05-14,59.529999,60.450001,58.950001,59.23,47429000,59.23 +FB,2014-05-15,59.259998,59.380001,57.52,57.919998,56814000,57.919998 +FB,2014-05-16,58.310001,58.450001,57.310001,58.02,47933000,58.02 +FB,2014-05-19,57.889999,59.560001,57.57,59.209999,43034000,59.209999 +FB,2014-05-20,59.5,60.189999,58.18,58.560001,53931000,58.560001 +FB,2014-05-21,58.560001,60.5,58.25,60.490002,58992000,60.490002 +FB,2014-05-22,60.939999,61.48,60.400002,60.52,54200000,60.52 +FB,2014-05-23,60.41,61.450001,60.150002,61.349998,38294000,61.349998 +FB,2014-05-27,61.619999,63.509998,61.57,63.48,55682000,63.48 +FB,2014-05-28,63.389999,64.139999,62.619999,63.509998,47795000,63.509998 +FB,2014-05-29,63.84,64.300003,63.509998,63.830002,42700000,63.830002 +FB,2014-05-30,63.950001,64.169998,62.560001,63.299999,45253500,63.299999 +FB,2014-06-02,63.23,63.59,62.049999,63.080002,35996000,63.080002 +FB,2014-06-03,62.619999,63.419998,62.32,62.869999,32217000,62.869999 +FB,2014-06-04,62.450001,63.59,62.07,63.34,36514000,63.34 +FB,2014-06-05,63.66,64.360001,62.82,63.189999,47352000,63.189999 +FB,2014-06-06,63.369999,63.48,62.150002,62.5,42442000,62.5 +FB,2014-06-09,62.400002,63.34,61.790001,62.880001,37617000,62.880001 +FB,2014-06-10,63.529999,65.82,63.5,65.769997,69338000,65.769997 +FB,2014-06-11,65.32,65.800003,64.900002,65.779999,44242000,65.779999 +FB,2014-06-12,65.849998,66.470001,64.059998,64.290001,55730000,64.290001 +FB,2014-06-13,64.699997,64.970001,63.830002,64.5,29419000,64.5 +FB,2014-06-16,64.160004,64.879997,63.75,64.190002,31046000,64.190002 +FB,2014-06-17,64.099998,64.879997,63.93,64.400002,27715000,64.400002 +FB,2014-06-18,64.489998,65.75,64.050003,65.599998,35570000,65.599998 +FB,2014-06-19,65.459999,65.580002,64.209999,64.339996,34245000,64.339996 +FB,2014-06-20,64.459999,64.809998,63.349998,64.5,46466000,64.5 +FB,2014-06-23,64.32,65.660004,64.220001,65.370003,34560000,65.370003 +FB,2014-06-24,65.360001,67.169998,65.269997,65.720001,57335000,65.720001 +FB,2014-06-25,65.580002,67.480003,65.57,67.440002,44308000,67.440002 +FB,2014-06-26,68,68,66.900002,67.129997,47714000,67.129997 +FB,2014-06-27,67.309998,67.699997,66.839996,67.599998,46461000,67.599998 +FB,2014-06-30,67.459999,67.919998,67.129997,67.290001,27102800,67.290001 +FB,2014-07-01,67.580002,68.440002,67.389999,68.059998,33243000,68.059998 +FB,2014-07-02,68.040001,68.300003,65.790001,66.449997,41895000,66.449997 +FB,2014-07-03,66.860001,67,65.760002,66.290001,25203200,66.290001 +FB,2014-07-07,66.300003,66.57,65.120003,65.290001,28745000,65.290001 +FB,2014-07-08,65.059998,65.559998,62.209999,62.759998,68926000,62.759998 +FB,2014-07-09,63.41,65.120003,63.150002,64.970001,51432000,64.970001 +FB,2014-07-10,63.310001,65.339996,63.049999,64.870003,44422000,64.870003 +FB,2014-07-11,65.279999,66.589996,64.790001,66.339996,39212000,66.339996 +FB,2014-07-14,67.129997,68.169998,66.900002,67.900002,38537000,67.900002 +FB,2014-07-15,67.959999,68.089996,66.260002,67.169998,44213200,67.169998 +FB,2014-07-16,67.540001,67.940002,67.07,67.660004,29541600,67.660004 +FB,2014-07-17,67.029999,67.849998,66.040001,66.410004,38188000,66.410004 +FB,2014-07-18,66.800003,68.459999,66.160004,68.419998,42456000,68.419998 +FB,2014-07-21,68.809998,69.959999,68.5,69.400002,49539000,69.400002 +FB,2014-07-22,69.760002,69.769997,68.610001,69.269997,40398000,69.269997 +FB,2014-07-23,69.739998,71.330002,69.610001,71.290001,78435000,71.290001 +FB,2014-07-24,75.959999,76.739998,74.510002,74.980003,124168000,74.980003 +FB,2014-07-25,74.989998,75.669998,74.660004,75.190002,45917000,75.190002 +FB,2014-07-28,75.169998,75.5,73.849998,74.919998,41725000,74.919998 +FB,2014-07-29,74.720001,74.919998,73.419998,73.709999,41324000,73.709999 +FB,2014-07-30,74.209999,75.190002,74.129997,74.68,36853000,74.68 +FB,2014-07-31,74,74.169998,72.440002,72.650002,43992000,72.650002 +FB,2014-08-01,72.220001,73.220001,71.550003,72.360001,43535000,72.360001 +FB,2014-08-04,72.360001,73.879997,72.360001,73.510002,30777000,73.510002 +FB,2014-08-05,73.199997,73.589996,72.18,72.690002,34986000,72.690002 +FB,2014-08-06,72.019997,73.720001,71.790001,72.470001,30986000,72.470001 +FB,2014-08-07,73,74,72.699997,73.169998,38141000,73.169998 +FB,2014-08-08,73.400002,73.43,72.559998,73.059998,27202000,73.059998 +FB,2014-08-11,73.459999,73.910004,73.059998,73.440002,24591000,73.440002 +FB,2014-08-12,73.089996,73.330002,72.220001,72.830002,27419000,72.830002 +FB,2014-08-13,73.120003,74.25,73.050003,73.769997,29266000,73.769997 +FB,2014-08-14,73.970001,74.379997,73.690002,74.300003,22207000,74.300003 +FB,2014-08-15,74.32,74.650002,73,73.629997,38846600,73.629997 +FB,2014-08-18,74,74.720001,73.959999,74.589996,23974000,74.589996 +FB,2014-08-19,74.809998,75.580002,74.510002,75.290001,26679000,75.290001 +FB,2014-08-20,74.970001,75.18,74.620003,74.809998,22917000,74.809998 +FB,2014-08-21,74.919998,75.190002,74.410004,74.57,20102000,74.57 +FB,2014-08-22,74.339996,74.730003,73.57,74.57,20897000,74.57 +FB,2014-08-25,74.940002,75.279999,74.790001,75.019997,19734000,75.019997 +FB,2014-08-26,75,75.989998,74.730003,75.959999,23993000,75.959999 +FB,2014-08-27,75.269997,75.489998,74.459999,74.629997,36323000,74.629997 +FB,2014-08-28,74,74.43,73.730003,73.860001,21947000,73.860001 +FB,2014-08-29,74.300003,74.82,74.010002,74.82,26241000,74.82 +FB,2014-09-02,75.010002,76.699997,74.82,76.68,34979000,76.68 +FB,2014-09-03,77.139999,77.480003,75.599998,75.830002,32389000,75.830002 +FB,2014-09-04,75.889999,76.93,75.529999,75.949997,26676000,75.949997 +FB,2014-09-05,76.099998,77.379997,75.599998,77.260002,29476000,77.260002 +FB,2014-09-08,77.260002,78.169998,77.010002,77.889999,28183000,77.889999 +FB,2014-09-09,77.589996,78.169998,76.199997,76.669998,28882000,76.669998 +FB,2014-09-10,76.519997,77.949997,76.510002,77.43,29909000,77.43 +FB,2014-09-11,77.129997,78.360001,77.050003,77.919998,32219000,77.919998 +FB,2014-09-12,78.019997,78.300003,77.099998,77.480003,26676800,77.480003 +FB,2014-09-15,77.150002,77.25,73.43,74.580002,49679000,74.580002 +FB,2014-09-16,73.519997,76.230003,73.07,76.080002,37742000,76.080002 +FB,2014-09-17,75.959999,77.25,75.57,76.43,28693000,76.43 +FB,2014-09-18,76.769997,77.330002,76.519997,77,23031000,77 +FB,2014-09-19,77.400002,78.300003,76.440002,77.910004,76671000,77.910004 +FB,2014-09-22,77,77.529999,75.949997,76.800003,31961000,76.800003 +FB,2014-09-23,76.330002,78.629997,76.040001,78.290001,36814000,78.290001 +FB,2014-09-24,78.099998,78.620003,77.510002,78.540001,30680000,78.540001 +FB,2014-09-25,78.599998,78.940002,77.129997,77.220001,37533000,77.220001 +FB,2014-09-26,77.589996,78.839996,77.330002,78.790001,28872000,78.790001 +FB,2014-09-29,78.120003,79.199997,77.910004,79,34031000,79 +FB,2014-09-30,79.349998,79.709999,78.599998,79.040001,35899000,79.040001 +FB,2014-10-01,78.779999,78.82,75.900002,76.550003,55090000,76.550003 +FB,2014-10-02,76.57,77.480003,75.639999,77.080002,36488000,77.080002 +FB,2014-10-03,77.760002,78.059998,77.260002,77.440002,23340000,77.440002 +FB,2014-10-06,77.190002,77.889999,76.849998,77.559998,25729000,77.559998 +FB,2014-10-07,77.050003,77.949997,76.239998,76.290001,25317000,76.290001 +FB,2014-10-08,76.18,77.709999,75.099998,77.519997,32976000,77.519997 +FB,2014-10-09,77.279999,77.760002,75.849998,75.910004,32487000,75.910004 +FB,2014-10-10,75.589996,76.5,72.760002,72.910004,52146000,72.910004 +FB,2014-10-13,73.230003,74.779999,72.519997,72.989998,43938000,72.989998 +FB,2014-10-14,74,74.18,72.050003,73.589996,50299000,73.589996 +FB,2014-10-15,71.690002,73.800003,70.32,73.209999,61528000,73.209999 +FB,2014-10-16,70.790001,73.349998,70.580002,72.629997,53529000,72.629997 +FB,2014-10-17,74.230003,76,73.75,75.949997,76342000,75.949997 +FB,2014-10-20,75.599998,77.089996,75.379997,76.949997,34701000,76.949997 +FB,2014-10-21,77.559998,78.739998,77.150002,78.690002,32252000,78.690002 +FB,2014-10-22,78.82,79.849998,78.010002,78.370003,41862000,78.370003 +FB,2014-10-23,79.379997,80.629997,79.010002,80.040001,35056000,80.040001 +FB,2014-10-24,80.199997,80.82,79.32,80.669998,32248000,80.669998 +FB,2014-10-27,80.739998,80.800003,79.760002,80.279999,30169000,80.279999 +FB,2014-10-28,80.18,81.160004,79.57,80.769997,74212000,80.769997 +FB,2014-10-29,75.449997,76.879997,74.779999,75.860001,106120000,75.860001 +FB,2014-10-30,75.050003,75.349998,72.900002,74.110001,83270000,74.110001 +FB,2014-10-31,74.93,75.699997,74.449997,74.989998,44544000,74.989998 +FB,2014-11-03,75.470001,75.519997,73.699997,73.879997,40727000,73.879997 +FB,2014-11-04,74.230003,75.769997,73.650002,75.760002,39326000,75.760002 +FB,2014-11-05,76.510002,76.800003,74.419998,74.830002,35913000,74.830002 +FB,2014-11-06,74.889999,75.599998,74.309998,75.260002,21383000,75.260002 +FB,2014-11-07,75.389999,75.860001,75.019997,75.599998,20774000,75.599998 +FB,2014-11-10,75.360001,75.480003,74.610001,75,21575100,75 +FB,2014-11-11,74.949997,74.980003,74.029999,74.610001,18715700,74.610001 +FB,2014-11-12,74.279999,75.139999,73.540001,74.720001,26536600,74.720001 +FB,2014-11-13,74.739998,75.239998,73.639999,74.25,26448500,74.25 +FB,2014-11-14,74.269997,74.93,74.040001,74.879997,19476900,74.879997 +FB,2014-11-17,74.879997,75.660004,73.879997,74.239998,28701200,74.239998 +FB,2014-11-18,74.449997,74.800003,73.900002,74.339996,20690500,74.339996 +FB,2014-11-19,74.010002,74.540001,73.110001,73.330002,25441200,73.330002 +FB,2014-11-20,72.800003,73.989998,72.510002,73.599998,19154900,73.599998 +FB,2014-11-21,74.5,74.5,73.5,73.75,23060400,73.75 +FB,2014-11-24,73.540001,74.349998,73.349998,74.010002,22103800,74.010002 +FB,2014-11-25,74.209999,75.739998,74.129997,75.629997,32250200,75.629997 +FB,2014-11-26,75.529999,77.779999,75.510002,77.620003,32695300,77.620003 +FB,2014-11-28,77.669998,78.269997,77.230003,77.699997,15992000,77.699997 +FB,2014-12-01,77.260002,77.309998,74.800003,75.099998,31789900,75.099998 +FB,2014-12-02,75.330002,75.910004,75.040001,75.459999,16773900,75.459999 +FB,2014-12-03,75.379997,75.730003,74.400002,74.879997,16689900,74.879997 +FB,2014-12-04,74.830002,75.550003,74.660004,75.239998,14362800,75.239998 +FB,2014-12-05,75.800003,76.760002,75.360001,76.360001,24306400,76.360001 +FB,2014-12-08,76.18,77.25,75.400002,76.519997,25733900,76.519997 +FB,2014-12-09,75.199997,76.93,74.779999,76.839996,25358600,76.839996 +FB,2014-12-10,76.650002,77.550003,76.07,76.18,32210500,76.18 +FB,2014-12-11,76.519997,78.519997,76.480003,77.730003,33462100,77.730003 +FB,2014-12-12,77.160004,78.879997,77.019997,77.830002,28091600,77.830002 +FB,2014-12-15,78.459999,78.580002,76.559998,76.989998,29396500,76.989998 +FB,2014-12-16,76.190002,77.389999,74.589996,74.690002,31554600,74.690002 +FB,2014-12-17,75.010002,76.410004,74.900002,76.110001,29203900,76.110001 +FB,2014-12-18,76.889999,78.400002,76.510002,78.400002,34222100,78.400002 +FB,2014-12-19,78.75,80,78.330002,79.879997,43335000,79.879997 +FB,2014-12-22,80.080002,81.889999,80,81.449997,31395800,81.449997 +FB,2014-12-23,82.019997,82.169998,80.400002,80.610001,19865800,80.610001 +FB,2014-12-24,81.029999,81.43,80.75,80.769997,7685500,80.769997 +FB,2014-12-26,81.019997,81.279999,80.510002,80.779999,10647400,80.779999 +FB,2014-12-29,80.489998,80.959999,79.709999,80.019997,14134700,80.019997 +FB,2014-12-30,79.849998,80.589996,79.099998,79.220001,14370800,79.220001 +FB,2014-12-31,79.540001,79.800003,77.860001,78.019997,19935400,78.019997 +FB,2015-01-02,78.580002,78.93,77.699997,78.449997,18177500,78.449997 +FB,2015-01-05,77.980003,79.25,76.860001,77.190002,26452200,77.190002 +FB,2015-01-06,77.230003,77.589996,75.360001,76.150002,27399300,76.150002 +FB,2015-01-07,76.760002,77.360001,75.82,76.150002,22045300,76.150002 +FB,2015-01-08,76.739998,78.230003,76.080002,78.18,23961000,78.18 +FB,2015-01-09,78.199997,78.620003,77.199997,77.739998,21157000,77.739998 +FB,2015-01-12,77.839996,78,76.209999,76.720001,19190200,76.720001 +FB,2015-01-13,77.230003,78.080002,75.849998,76.449997,25179600,76.449997 +FB,2015-01-14,76.419998,77.199997,76.029999,76.279999,25741000,76.279999 +FB,2015-01-15,76.400002,76.57,73.540001,74.050003,34134000,74.050003 +FB,2015-01-16,74.040001,75.32,73.839996,75.18,21791500,75.18 +FB,2015-01-20,75.720001,76.309998,74.82,76.239998,22821600,76.239998 +FB,2015-01-21,76.160004,77.300003,75.849998,76.739998,25096700,76.739998 +FB,2015-01-22,77.169998,77.75,76.68,77.650002,19519500,77.650002 +FB,2015-01-23,77.650002,78.190002,77.040001,77.830002,16746500,77.830002 +FB,2015-01-26,77.980003,78.470001,77.290001,77.5,19260800,77.5 +FB,2015-01-27,76.709999,76.879997,75.629997,75.779999,20110000,75.779999 +FB,2015-01-28,76.900002,77.639999,76,76.239998,53306400,76.239998 +FB,2015-01-29,76.849998,78.019997,74.209999,78,61293500,78 +FB,2015-01-30,78,78.160004,75.75,75.910004,42649500,75.910004 +FB,2015-02-02,76.110001,76.139999,73.75,74.989998,41955300,74.989998 +FB,2015-02-03,75.190002,75.580002,73.860001,75.400002,26957700,75.400002 +FB,2015-02-04,75.089996,76.349998,75.010002,75.629997,20277400,75.629997 +FB,2015-02-05,75.709999,75.980003,75.209999,75.610001,15062600,75.610001 +FB,2015-02-06,75.68,75.699997,74.25,74.470001,21211000,74.470001 +FB,2015-02-09,74.050003,74.830002,73.449997,74.440002,16194300,74.440002 +FB,2015-02-10,74.849998,75.339996,74.5,75.190002,15811300,75.190002 +FB,2015-02-11,75.089996,76.75,75.029999,76.510002,20877400,76.510002 +FB,2015-02-12,76.860001,76.870003,75.889999,76.230003,17235000,76.230003 +FB,2015-02-13,76.459999,76.480003,75.5,75.739998,18621900,75.739998 +FB,2015-02-17,75.300003,76.910004,75.080002,75.599998,25254400,75.599998 +FB,2015-02-18,75.940002,76.900002,75.449997,76.709999,22426400,76.709999 +FB,2015-02-19,76.989998,79.839996,76.949997,79.419998,45851200,79.419998 +FB,2015-02-20,79.550003,80.339996,79.199997,79.900002,36931700,79.900002 +FB,2015-02-23,79.959999,80.190002,78.379997,78.839996,24139100,78.839996 +FB,2015-02-24,78.5,79.480003,78.099998,78.449997,18897100,78.449997 +FB,2015-02-25,78.5,80.199997,78.5,79.559998,25593800,79.559998 +FB,2015-02-26,79.879997,81.370003,79.720001,80.410004,31111900,80.410004 +FB,2015-02-27,80.68,81.230003,78.620003,78.970001,30739200,78.970001 +FB,2015-03-02,79,79.860001,78.519997,79.75,21662500,79.75 +FB,2015-03-03,79.610001,79.699997,78.519997,79.599998,18635000,79.599998 +FB,2015-03-04,79.300003,81.150002,78.849998,80.900002,28126700,80.900002 +FB,2015-03-05,81.230003,81.989998,81.050003,81.209999,27825700,81.209999 +FB,2015-03-06,80.900002,81.330002,79.830002,80.010002,24488600,80.010002 +FB,2015-03-09,79.68,79.910004,78.629997,79.440002,18925100,79.440002 +FB,2015-03-10,78.5,79.260002,77.550003,77.550003,23067100,77.550003 +FB,2015-03-11,77.800003,78.43,77.260002,77.57,20215700,77.57 +FB,2015-03-12,78.099998,79.050003,77.910004,78.93,16093300,78.93 +FB,2015-03-13,78.599998,79.379997,77.68,78.050003,18557300,78.050003 +FB,2015-03-16,77.959999,78.120003,77.360001,78.07,19305400,78.07 +FB,2015-03-17,78.360001,79.779999,78.339996,79.360001,22170000,79.360001 +FB,2015-03-18,79.25,81.239998,79.169998,80.910004,36912400,80.910004 +FB,2015-03-19,81.120003,83,81,82.75,42099500,82.75 +FB,2015-03-20,83.389999,84.599998,83.07,83.800003,44466300,83.800003 +FB,2015-03-23,83.919998,84.959999,83.300003,84.43,27357300,84.43 +FB,2015-03-24,84.709999,86.07,84.519997,85.309998,32576500,85.309998 +FB,2015-03-25,85.5,85.519997,82.919998,82.919998,37436100,82.919998 +FB,2015-03-26,82.720001,83.769997,82.139999,83.010002,32794800,83.010002 +FB,2015-03-27,83.379997,83.949997,82.879997,83.300003,18372600,83.300003 +FB,2015-03-30,83.809998,84.339996,82.410004,83.199997,24527700,83.199997 +FB,2015-03-31,82.900002,83.5,82.209999,82.220001,19734300,82.220001 +FB,2015-04-01,82.5,82.720001,80.870003,81.669998,22058200,81.669998 +FB,2015-04-02,82.25,82.559998,81.440002,81.559998,19664100,81.559998 +FB,2015-04-06,80.800003,82.809998,80.800003,82.440002,19062900,82.440002 +FB,2015-04-07,82.650002,83.419998,82.220001,82.32,17467000,82.32 +FB,2015-04-08,82.629997,83.099998,81.839996,82.279999,18966700,82.279999 +FB,2015-04-09,82.5,82.800003,81.709999,82.169998,15927300,82.169998 +FB,2015-04-10,82.209999,82.610001,81.910004,82.040001,12529700,82.040001 +FB,2015-04-13,81.93,83.940002,81.919998,83.010002,26883100,83.010002 +FB,2015-04-14,83.169998,83.690002,82.440002,83.519997,19634200,83.519997 +FB,2015-04-15,83.550003,83.660004,82.269997,82.709999,22390900,82.709999 +FB,2015-04-16,82.470001,83.07,82.150002,82.309998,13769700,82.309998 +FB,2015-04-17,81.480003,82.110001,80.370003,80.779999,24215000,80.779999 +FB,2015-04-20,81.540001,83.150002,81.239998,83.089996,28796800,83.089996 +FB,2015-04-21,84,84.489998,83.540001,83.620003,27171900,83.620003 +FB,2015-04-22,84.32,84.739998,83.650002,84.629997,45548000,84.629997 +FB,2015-04-23,84.099998,85.589996,82.410004,82.410004,73728100,82.410004 +FB,2015-04-24,82.769997,82.940002,81.480003,81.529999,29660400,81.529999 +FB,2015-04-27,81.870003,82.93,81.629997,81.910004,25446000,81.910004 +FB,2015-04-28,81.830002,81.900002,80.230003,80.68,23775300,80.68 +FB,2015-04-29,80.010002,81.389999,79.519997,80.470001,26430300,80.470001 +FB,2015-04-30,80.010002,80.959999,78.32,78.769997,28999000,78.769997 +FB,2015-05-01,79.239998,79.760002,78.110001,78.989998,24136400,78.989998 +FB,2015-05-04,79.330002,79.690002,78.629997,78.809998,14692000,78.809998 +FB,2015-05-05,78.550003,78.800003,77.220001,77.559998,22311300,77.559998 +FB,2015-05-06,77.970001,78.809998,77.050003,78.099998,28663000,78.099998 +FB,2015-05-07,78,78.940002,77.559998,78.43,19749400,78.43 +FB,2015-05-08,79.099998,79.230003,78.029999,78.510002,19943600,78.510002 +FB,2015-05-11,78.480003,79.029999,77.93,78.010002,18874100,78.010002 +FB,2015-05-12,77.870003,77.889999,76.790001,77.459999,21285300,77.459999 +FB,2015-05-13,77.720001,78.529999,77.650002,78.440002,21512300,78.440002 +FB,2015-05-14,78.940002,81.849998,78.669998,81.370003,49438000,81.370003 +FB,2015-05-15,81.410004,81.519997,80.18,80.419998,27069900,80.419998 +FB,2015-05-18,80.330002,81.379997,80.230003,80.879997,21613700,80.879997 +FB,2015-05-19,81.25,81.690002,80.550003,80.629997,17955400,80.629997 +FB,2015-05-20,80.470001,81.099998,79.459999,80.550003,23056900,80.550003 +FB,2015-05-21,80.190002,80.919998,80.080002,80.480003,13402700,80.480003 +FB,2015-05-22,80.349998,81.309998,80.25,80.540001,19567900,80.540001 +FB,2015-05-26,80.43,80.599998,79.080002,79.330002,16321300,79.330002 +FB,2015-05-27,79.599998,80.660004,79.43,80.550003,14160900,80.550003 +FB,2015-05-28,80.25,81.07,80,80.150002,11982000,80.150002 +FB,2015-05-29,79.949997,80.07,78.879997,79.190002,16134600,79.190002 +FB,2015-06-01,79.300003,80.379997,78.660004,80.290001,18119000,80.290001 +FB,2015-06-02,79.760002,81.349998,79.559998,80.440002,18923300,80.440002 +FB,2015-06-03,81.349998,82.529999,81.25,82.440002,31594700,82.440002 +FB,2015-06-04,82.139999,82.949997,81.510002,82.050003,20863900,82.050003 +FB,2015-06-05,81.870003,82.459999,81.510002,82.139999,16143100,82.139999 +FB,2015-06-08,81.82,82,80.129997,80.669998,16915500,80.669998 +FB,2015-06-09,80.599998,81.190002,79.32,80.669998,16497500,80.669998 +FB,2015-06-10,80.830002,82.599998,80.809998,82.160004,21531200,82.160004 +FB,2015-06-11,82.309998,82.900002,81.360001,81.830002,18656800,81.830002 +FB,2015-06-12,81.370003,82.089996,81.199997,81.529999,11417900,81.529999 +FB,2015-06-15,80.550003,80.93,80.07,80.709999,18805100,80.709999 +FB,2015-06-16,80.82,81.510002,80.449997,81.059998,13693700,81.059998 +FB,2015-06-17,81.760002,82.220001,81.339996,81.790001,18350300,81.790001 +FB,2015-06-18,81.639999,83.190002,81.57,82.910004,26782600,82.910004 +FB,2015-06-19,82.830002,82.980003,82.120003,82.510002,23353200,82.510002 +FB,2015-06-22,83.410004,84.970001,83.309998,84.739998,29383100,84.739998 +FB,2015-06-23,84.959999,87.970001,84.760002,87.879997,50667900,87.879997 +FB,2015-06-24,87.660004,89.25,87.449997,88.860001,41370200,88.860001 +FB,2015-06-25,89.260002,89.400002,87.839996,87.980003,27302000,87.980003 +FB,2015-06-26,88.120003,88.339996,86.830002,88.010002,38214600,88.010002 +FB,2015-06-29,86.610001,87.5,85.730003,85.800003,35957900,85.800003 +FB,2015-06-30,86.599998,86.699997,85.57,85.769997,23016500,85.769997 +FB,2015-07-01,86.769997,87.949997,86.489998,86.910004,25260000,86.910004 +FB,2015-07-02,87.400002,87.440002,86.339996,87.290001,16908800,87.290001 +FB,2015-07-06,86.489998,88.190002,86.389999,87.550003,24635900,87.550003 +FB,2015-07-07,87.800003,87.849998,85.230003,87.220001,33059900,87.220001 +FB,2015-07-08,86.290001,86.75,85.449997,85.650002,24399300,85.650002 +FB,2015-07-09,86.730003,87.599998,85.650002,85.879997,23144200,85.879997 +FB,2015-07-10,87.349998,88.220001,86.769997,87.949997,23245900,87.949997 +FB,2015-07-13,88.660004,90.220001,88.419998,90.099998,29976700,90.099998 +FB,2015-07-14,90.459999,90.800003,89.650002,89.68,26627800,89.68 +FB,2015-07-15,90,90.989998,89.419998,89.760002,30886600,89.760002 +FB,2015-07-16,90.279999,90.860001,89.769997,90.849998,21804100,90.849998 +FB,2015-07-17,92.550003,95.389999,92.540001,94.970001,54001600,94.970001 +FB,2015-07-20,95.849998,98.599998,95.360001,97.910004,54860500,97.910004 +FB,2015-07-21,98.949997,99.239998,97.139999,98.389999,39453300,98.389999 +FB,2015-07-22,96.739998,97.580002,95.919998,97.040001,28299500,97.040001 +FB,2015-07-23,96.959999,97.449997,94.809998,95.440002,29418800,95.440002 +FB,2015-07-24,97.349998,97.760002,95.879997,96.949997,33444900,96.949997 +FB,2015-07-27,96.580002,96.610001,93.830002,94.169998,38585400,94.169998 +FB,2015-07-28,94.839996,95.559998,93.309998,95.290001,35236000,95.290001 +FB,2015-07-29,96.32,97.279999,94.739998,96.989998,64648300,96.989998 +FB,2015-07-30,94.910004,95.809998,91.800003,95.209999,86211300,95.209999 +FB,2015-07-31,94.949997,96.330002,93.949997,94.010002,46509000,94.010002 +FB,2015-08-03,93.529999,95.080002,92.800003,94.139999,29343100,94.139999 +FB,2015-08-04,93.790001,94.730003,93.330002,94.059998,20136000,94.059998 +FB,2015-08-05,95.25,97.089996,95.18,96.440002,29813200,96.440002 +FB,2015-08-06,97.18,98.739998,94.419998,95.120003,42271300,95.120003 +FB,2015-08-07,95.379997,95.400002,93.610001,94.300003,23199100,94.300003 +FB,2015-08-10,95.68,95.900002,93.629997,94.150002,21624200,94.150002 +FB,2015-08-11,93.730003,94.760002,92.900002,93.620003,22491000,93.620003 +FB,2015-08-12,92.699997,94.440002,91.190002,94.190002,27050500,94.190002 +FB,2015-08-13,94.050003,94.730003,93.349998,93.43,17451800,93.43 +FB,2015-08-14,93.540001,94.720001,93.209999,94.419998,15929700,94.419998 +FB,2015-08-17,94.419998,94.459999,93.389999,93.93,18313500,93.93 +FB,2015-08-18,94.080002,95.849998,94.040001,95.169998,22278800,95.169998 +FB,2015-08-19,94.629997,96.099998,94.160004,95.309998,23156500,95.309998 +FB,2015-08-20,93.540001,94.769997,90.459999,90.559998,44598200,90.559998 +FB,2015-08-21,87.519997,89.18,85.610001,86.059998,62778700,86.059998 +FB,2015-08-24,77.029999,82.089996,72,82.089996,83710700,82.089996 +FB,2015-08-25,86.949997,87.669998,83,83,52021200,83 +FB,2015-08-26,85.949997,87.459999,83.260002,87.190002,45124300,87.190002 +FB,2015-08-27,89.099998,90.059998,87.190002,89.730003,42431400,89.730003 +FB,2015-08-28,89.879997,91.480003,89.790001,91.010002,33215900,91.010002 +FB,2015-08-31,90.599998,91.050003,88.889999,89.43,32850700,89.43 +FB,2015-09-01,86.849998,89.389999,86.5,87.230003,36097400,87.230003 +FB,2015-09-02,88.809998,89.889999,87.629997,89.889999,27190500,89.889999 +FB,2015-09-03,89.760002,89.82,87.730003,88.150002,27048200,88.150002 +FB,2015-09-04,87.199997,88.389999,86.699997,88.260002,27328700,88.260002 +FB,2015-09-08,89.690002,90.239998,88.830002,89.529999,27012500,89.529999 +FB,2015-09-09,90.779999,91.980003,90.169998,90.440002,32551100,90.440002 +FB,2015-09-10,90.07,92.059998,89.629997,91.980003,26437400,91.980003 +FB,2015-09-11,91.68,92.080002,91.129997,92.050003,21185000,92.050003 +FB,2015-09-14,92.309998,92.620003,91.599998,92.309998,20127900,92.309998 +FB,2015-09-15,92.370003,93.25,91.790001,92.900002,18859400,92.900002 +FB,2015-09-16,92.900002,93.599998,92.629997,93.449997,16321200,93.449997 +FB,2015-09-17,93.370003,95.510002,92.900002,94.339996,27841800,94.339996 +FB,2015-09-18,93.199997,95.190002,93.050003,94.400002,62300000,94.400002 +FB,2015-09-21,94.620003,96.489998,94.519997,95.550003,28790000,95.550003 +FB,2015-09-22,93.769997,94.68,91.919998,92.959999,36888900,92.959999 +FB,2015-09-23,93.400002,94.32,92.800003,93.970001,21701400,93.970001 +FB,2015-09-24,93.059998,94.769997,92.239998,94.410004,29106000,94.410004 +FB,2015-09-25,95.790001,95.849998,92.059998,92.769997,28961600,92.769997 +FB,2015-09-28,92.080002,92.290001,88.18,89.209999,41199900,89.209999 +FB,2015-09-29,89.099998,90.059998,85.720001,86.669998,42281800,86.669998 +FB,2015-09-30,88.440002,90.019997,88.010002,89.900002,36169100,89.900002 +FB,2015-10-01,90.050003,90.949997,88.360001,90.949997,29283700,90.949997 +FB,2015-10-02,88.900002,92.199997,88.370003,92.07,37881700,92.07 +FB,2015-10-05,92.940002,94.269997,92.660004,94.010002,27292500,94.010002 +FB,2015-10-06,94.080002,94.169998,92.339996,92.800003,22172800,92.800003 +FB,2015-10-07,93.110001,93.660004,91.370003,92.400002,24129300,92.400002 +FB,2015-10-08,91.889999,93.220001,90.470001,92.470001,27290500,92.470001 +FB,2015-10-09,92.900002,93.739998,92.239998,93.239998,20012900,93.239998 +FB,2015-10-12,93.32,94.599998,92.669998,94.260002,18449600,94.260002 +FB,2015-10-13,93.660004,95.370003,93.550003,94.120003,19480300,94.120003 +FB,2015-10-14,94.080002,95.199997,93.610001,94.07,19253400,94.07 +FB,2015-10-15,94.989998,96.300003,94.900002,95.959999,27557500,95.959999 +FB,2015-10-16,96.18,97.589996,95.349998,97.540001,25412900,97.540001 +FB,2015-10-19,97.18,98.57,96.919998,98.470001,23729900,98.470001 +FB,2015-10-20,98.730003,99.589996,96.559998,97,30700500,97 +FB,2015-10-21,97.370003,98.18,96.470001,97.110001,21917800,97.110001 +FB,2015-10-22,97.790001,99.730003,97.550003,99.669998,26392100,99.669998 +FB,2015-10-23,101.910004,102.849998,100.160004,102.190002,42809700,102.190002 +FB,2015-10-26,102.199997,103.809998,101.550003,103.769997,25961200,103.769997 +FB,2015-10-27,102.940002,104.099998,102.400002,103.699997,23795500,103.699997 +FB,2015-10-28,103.900002,104.480003,102.919998,104.199997,24081500,104.199997 +FB,2015-10-29,103.959999,105.120003,103.519997,104.879997,20316700,104.879997 +FB,2015-10-30,104.510002,104.720001,101.650002,101.970001,33487100,101.970001 +FB,2015-11-02,101.720001,103.470001,101.18,103.309998,24003900,103.309998 +FB,2015-11-03,103.220001,103.650002,102.400002,102.580002,21242300,102.580002 +FB,2015-11-04,103.190002,104.139999,102.480003,103.940002,43469300,103.940002 +FB,2015-11-05,108.800003,110.650002,107.949997,108.760002,63232900,108.760002 +FB,2015-11-06,108.040001,108.739998,105.910004,107.099998,35084300,107.099998 +FB,2015-11-09,107,108.25,105.860001,106.489998,26383500,106.489998 +FB,2015-11-10,105.959999,108.150002,105.239998,107.910004,25031700,107.910004 +FB,2015-11-11,108.269997,109.870003,107.110001,109.010002,25057100,109.010002 +FB,2015-11-12,108.480003,109.389999,108,108.019997,20924700,108.019997 +FB,2015-11-13,107.709999,108.25,103.830002,103.949997,30278400,103.949997 +FB,2015-11-16,103.32,104.169998,100.470001,104.040001,49309200,104.040001 +FB,2015-11-17,104.620003,106.199997,104.139999,105.129997,26807200,105.129997 +FB,2015-11-18,105.800003,107.879997,105.389999,107.769997,23836500,107.769997 +FB,2015-11-19,107.360001,107.730003,105.949997,106.260002,25520600,106.260002 +FB,2015-11-20,106.839996,107.870003,106.620003,107.32,22129600,107.32 +FB,2015-11-23,107.190002,107.470001,106.080002,106.949997,19897200,106.949997 +FB,2015-11-24,106,106.489998,104.389999,105.739998,23577300,105.739998 +FB,2015-11-25,106.330002,106.599998,105.099998,105.410004,15150800,105.410004 +FB,2015-11-27,105.779999,105.959999,104.860001,105.449997,5913100,105.449997 +FB,2015-11-30,105.839996,106.099998,103.75,104.239998,20383200,104.239998 +FB,2015-12-01,104.830002,107.150002,104.5,107.120003,22781900,107.120003 +FB,2015-12-02,107,107.919998,105.790001,106.07,24429100,106.07 +FB,2015-12-03,106.269997,106.849998,103.349998,104.379997,23236500,104.379997 +FB,2015-12-04,104.809998,107.730003,104.110001,106.18,21224700,106.18 +FB,2015-12-07,106.480003,106.830002,104.660004,105.610001,15474900,105.610001 +FB,2015-12-08,104,106.910004,103.949997,106.489998,20401800,106.489998 +FB,2015-12-09,106.18,106.440002,103.550003,104.599998,23517300,104.599998 +FB,2015-12-10,105.050003,106.400002,104.410004,105.419998,17414500,105.419998 +FB,2015-12-11,104.150002,104.339996,101.910004,102.120003,26427700,102.120003 +FB,2015-12-14,102.290001,104.739998,101.459999,104.660004,24648100,104.660004 +FB,2015-12-15,105.300003,105.800003,104.279999,104.550003,21764300,104.550003 +FB,2015-12-16,105.370003,107.089996,104.190002,106.790001,22680500,106.790001 +FB,2015-12-17,107.489998,107.75,106.129997,106.220001,21675700,106.220001 +FB,2015-12-18,106.080002,106.589996,103.970001,104.040001,35994200,104.040001 +FB,2015-12-21,104.910004,105.150002,103.599998,104.769997,16138800,104.769997 +FB,2015-12-22,105.220001,105.660004,104.809998,105.510002,14597100,105.510002 +FB,2015-12-23,105.889999,106.110001,103.860001,104.629997,19599700,104.629997 +FB,2015-12-24,104.739998,105.32,104.5,105.019997,6501800,105.019997 +FB,2015-12-28,105.019997,105.980003,104.529999,105.93,13069700,105.93 +FB,2015-12-29,106.419998,107.739998,106.25,107.260002,17179900,107.260002 +FB,2015-12-30,107,107.25,106.059998,106.220001,13115000,106.220001 +FB,2015-12-31,106,106.169998,104.620003,104.660004,18298700,104.660004 +FB,2016-01-04,101.949997,102.239998,99.75,102.220001,37912400,102.220001 +FB,2016-01-05,102.889999,103.709999,101.669998,102.730003,23258200,102.730003 +FB,2016-01-06,101.129997,103.769997,100.900002,102.970001,25096200,102.970001 +FB,2016-01-07,100.5,101.43,97.300003,97.919998,45172900,97.919998 +FB,2016-01-08,99.879997,100.5,97.029999,97.330002,35402300,97.330002 +FB,2016-01-11,97.910004,98.599998,95.389999,97.510002,29932400,97.510002 +FB,2016-01-12,99,99.959999,97.550003,99.370003,28395400,99.370003 +FB,2016-01-13,100.580002,100.580002,95.209999,95.440002,33410600,95.440002 +FB,2016-01-14,95.849998,98.870003,92.449997,98.370003,48658600,98.370003 +FB,2016-01-15,93.980003,96.379997,93.540001,94.970001,45935600,94.970001 +FB,2016-01-19,96.529999,97.419998,93.919998,95.260002,30998300,95.260002 +FB,2016-01-20,92.830002,95,89.370003,94.349998,59051400,94.349998 +FB,2016-01-21,94.910004,95.989998,92.620003,94.160004,30518900,94.160004 +FB,2016-01-22,96.410004,98.07,95.489998,97.940002,30495400,97.940002 +FB,2016-01-25,98.720001,99.480003,96.93,97.010002,32482000,97.010002 +FB,2016-01-26,97.760002,97.879997,95.660004,97.339996,26877100,97.339996 +FB,2016-01-27,97.790001,97.849998,94.230003,94.449997,58699400,94.449997 +FB,2016-01-28,107.199997,110.339996,104.809998,109.110001,107475300,109.110001 +FB,2016-01-29,108.989998,112.839996,108.839996,112.209999,62739500,112.209999 +FB,2016-02-01,112.269997,115.720001,112.010002,115.089996,46132700,115.089996 +FB,2016-02-02,114.800003,117.589996,113.199997,114.610001,59778600,114.610001 +FB,2016-02-03,115.269997,115.339996,109.75,112.690002,56919300,112.690002 +FB,2016-02-04,111.800003,111.940002,109.25,110.489998,38890200,110.489998 +FB,2016-02-05,109.510002,109.580002,103.18,104.07,76894700,104.07 +FB,2016-02-08,100.410004,102.68,97.459999,99.75,71229700,99.75 +FB,2016-02-09,97.139999,102.400002,96.82,99.540001,62709000,99.540001 +FB,2016-02-10,101.550003,103.25,100.239998,101,45179400,101 +FB,2016-02-11,99.599998,105.110001,98.879997,101.910004,43670600,101.910004 +FB,2016-02-12,103.739998,104.239998,101.089996,102.010002,36176800,102.010002 +FB,2016-02-16,103.800003,103.93,100.239998,101.610001,45687200,101.610001 +FB,2016-02-17,102.019997,105.720001,100.400002,105.199997,44073400,105.199997 +FB,2016-02-18,105.800003,106,103.029999,103.470001,29593500,103.470001 +FB,2016-02-19,102.550003,105.019997,102.059998,104.57,32404500,104.57 +FB,2016-02-22,105.489998,108.25,105.339996,107.160004,35709700,107.160004 +FB,2016-02-23,106.849998,107.470001,105.120003,105.459999,25319300,105.459999 +FB,2016-02-24,104.209999,106.949997,102.739998,106.879997,34412400,106.879997 +FB,2016-02-25,107.110001,108.07,105.610001,108.07,29906300,108.07 +FB,2016-02-26,108.699997,109.449997,107.160004,107.919998,26686200,107.919998 +FB,2016-02-29,107.599998,108.910004,106.75,106.919998,32779000,106.919998 +FB,2016-03-01,107.830002,109.82,107.599998,109.82,26817300,109.82 +FB,2016-03-02,109.68,110.550003,108.769997,109.949997,25670200,109.949997 +FB,2016-03-03,110.25,110.300003,108.540001,109.580002,21353100,109.580002 +FB,2016-03-04,110.050003,110.050003,107.93,108.389999,24938900,108.389999 +FB,2016-03-07,108.07,108.07,104.720001,105.730003,31436400,105.730003 +FB,2016-03-08,104.779999,107.370003,104.400002,105.93,25617000,105.93 +FB,2016-03-09,106.699997,107.510002,105.489998,107.510002,20493300,107.510002 +FB,2016-03-10,107.910004,108.660004,105.769997,107.32,24854300,107.32 +FB,2016-03-11,108.480003,109.419998,107.919998,109.410004,20697600,109.410004 +FB,2016-03-14,109.279999,110.330002,108.769997,109.889999,17249400,109.889999 +FB,2016-03-15,109.110001,110.830002,108.839996,110.669998,17618500,110.669998 +FB,2016-03-16,110.489998,112.5,110.099998,112.18,24744800,112.18 +FB,2016-03-17,112.150002,112.690002,110.730003,111.019997,24241200,111.019997 +FB,2016-03-18,111.559998,112.419998,110.269997,111.449997,36256900,111.449997 +FB,2016-03-21,111.660004,112.370003,111.029999,111.849998,18448000,111.849998 +FB,2016-03-22,111.360001,112.879997,111.169998,112.25,19001100,112.25 +FB,2016-03-23,112.010002,113.190002,112,112.540001,18562000,112.540001 +FB,2016-03-24,112.129997,113.089996,111.68,113.050003,17839100,113.050003 +FB,2016-03-28,113.32,114.589996,112.949997,113.690002,21351800,113.690002 +FB,2016-03-29,113.830002,116.32,113.639999,116.139999,29825300,116.139999 +FB,2016-03-30,116.730003,116.989998,114.360001,114.699997,33235200,114.699997 +FB,2016-03-31,114.699997,115.010002,113.769997,114.099998,21207500,114.099998 +FB,2016-04-01,113.75,116.169998,113.349998,116.059998,24760500,116.059998 +FB,2016-04-04,114.07,114.550003,111.610001,112.550003,48487900,112.550003 +FB,2016-04-05,112.110001,113.32,111.900002,112.220001,22962400,112.220001 +FB,2016-04-06,112.470001,113.809998,112.419998,113.709999,20814600,113.709999 +FB,2016-04-07,113.790001,114.889999,113.07,113.639999,20714500,113.639999 +FB,2016-04-08,114.25,114.330002,109.900002,110.629997,48497800,110.629997 +FB,2016-04-11,110.699997,110.910004,108.769997,108.989998,39762300,108.989998 +FB,2016-04-12,109.339996,111.160004,108.989998,110.610001,26248100,110.610001 +FB,2016-04-13,112.230003,112.650002,106.519997,110.510002,88227400,110.510002 +FB,2016-04-14,110.620003,112.040001,110.260002,110.839996,28473300,110.839996 +FB,2016-04-15,110.790001,110.970001,109.199997,109.639999,20922800,109.639999 +FB,2016-04-18,109.739998,110.809998,109.199997,110.449997,21092700,110.449997 +FB,2016-04-19,111.099998,112.449997,109.160004,112.290001,30210500,112.290001 +FB,2016-04-20,112.43,113.269997,111.559998,112.419998,21027900,112.419998 +FB,2016-04-21,112.550003,114.040001,112.309998,113.440002,20875200,113.440002 +FB,2016-04-22,111.209999,111.75,109.010002,110.559998,38458200,110.559998 +FB,2016-04-25,109.870003,110.669998,109.07,110.099998,21017900,110.099998 +FB,2016-04-26,110.489998,110.5,108.150002,108.760002,22521500,108.760002 +FB,2016-04-27,107.940002,108.940002,106.309998,108.889999,52213100,108.889999 +FB,2016-04-28,119.580002,120.790001,116.230003,116.730003,87110100,116.730003 +FB,2016-04-29,116.82,117.839996,115.839996,117.580002,37140600,117.580002 +FB,2016-05-02,117.830002,118.730003,116.57,118.57,28095200,118.57 +FB,2016-05-03,117.519997,118.160004,117.019997,117.43,24117500,117.43 +FB,2016-05-04,116.610001,118.300003,116.57,118.059998,23448400,118.059998 +FB,2016-05-05,118.040001,118.980003,117.25,117.809998,22056700,117.809998 +FB,2016-05-06,117.160004,119.639999,117.110001,119.489998,26216200,119.489998 +FB,2016-05-09,119.540001,120.279999,118.900002,119.239998,21138100,119.239998 +FB,2016-05-10,119.620003,120.5,119,120.5,23220000,120.5 +FB,2016-05-11,120.410004,121.080002,119.419998,119.519997,22038400,119.519997 +FB,2016-05-12,119.980003,120.839996,118.900002,120.279999,22035500,120.279999 +FB,2016-05-13,120.379997,120.639999,119.68,119.809998,18124300,119.809998 +FB,2016-05-16,119.379997,119.610001,117.349998,118.669998,31247800,118.669998 +FB,2016-05-17,118.82,119.010002,117.199997,117.349998,21328600,117.349998 +FB,2016-05-18,116.800003,118.269997,116.730003,117.650002,21642300,117.650002 +FB,2016-05-19,117.050003,117.489998,115.879997,116.809998,20544100,116.809998 +FB,2016-05-20,116.959999,117.989998,116.949997,117.349998,18944800,117.349998 +FB,2016-05-23,117.419998,117.599998,115.940002,115.970001,20441000,115.970001 +FB,2016-05-24,116.239998,117.730003,116.120003,117.699997,20183600,117.699997 +FB,2016-05-25,118.129997,118.669998,117.379997,117.889999,20019800,117.889999 +FB,2016-05-26,118.239998,119.760002,117.919998,119.470001,18481300,119.470001 +FB,2016-05-27,119.559998,119.849998,119.010002,119.379997,13464400,119.379997 +FB,2016-05-31,119.459999,120.099998,118.120003,118.809998,23547600,118.809998 +FB,2016-06-01,118.5,119.080002,117.82,118.779999,15029500,118.779999 +FB,2016-06-02,118.690002,119.440002,118.220001,118.93,13228300,118.93 +FB,2016-06-03,118.980003,118.980003,117.860001,118.470001,14135100,118.470001 +FB,2016-06-06,118.620003,119.43,118.360001,118.790001,12744700,118.790001 +FB,2016-06-07,119.239998,119.300003,117.669998,117.760002,17103000,117.760002 +FB,2016-06-08,117.760002,118.599998,117.269997,118.389999,14505600,118.389999 +FB,2016-06-09,118.129997,118.68,117.709999,118.559998,13859200,118.559998 +FB,2016-06-10,117.540001,118.110001,116.260002,116.620003,18510800,116.620003 +FB,2016-06-13,115,115.480003,113.309998,113.949997,31718200,113.949997 +FB,2016-06-14,114.07,114.949997,113.580002,114.940002,17618500,114.940002 +FB,2016-06-15,115.300003,115.440002,114.07,114.599998,19819400,114.599998 +FB,2016-06-16,113.870003,114.5,112.940002,114.389999,19236300,114.389999 +FB,2016-06-17,114.419998,114.43,112.559998,113.019997,24644300,113.019997 +FB,2016-06-20,113.769997,114.720001,112.75,113.370003,20785400,113.370003 +FB,2016-06-21,114.120003,115.209999,113.970001,114.379997,19166300,114.379997 +FB,2016-06-22,114.650002,114.739998,113.610001,113.910004,14846300,113.910004 +FB,2016-06-23,114.370003,115.089996,113.540001,115.080002,16176900,115.080002 +FB,2016-06-24,111.010002,113.68,111,112.080002,40643100,112.080002 +FB,2016-06-27,111.57,111.57,108.230003,108.970001,36130400,108.970001 +FB,2016-06-28,110.629997,112.75,110.550003,112.699997,26813800,112.699997 +FB,2016-06-29,113.370003,114.25,113.040001,114.160004,20968300,114.160004 +FB,2016-06-30,114.669998,115.18,113.669998,114.279999,23192700,114.279999 +FB,2016-07-01,114.199997,115.129997,113.809998,114.190002,14980000,114.190002 +FB,2016-07-05,113.940002,114.199997,112.970001,114.199997,14207000,114.199997 +FB,2016-07-06,113.360001,116.790001,112.970001,116.699997,24337600,116.699997 +FB,2016-07-07,116.629997,116.970001,115.360001,115.849998,16630200,115.849998 +FB,2016-07-08,116.43,117.5,115.849998,117.239998,18142600,117.239998 +FB,2016-07-11,117.709999,118.699997,117.5,117.870003,17711600,117.870003 +FB,2016-07-12,118.629997,118.720001,117.57,117.93,15217700,117.93 +FB,2016-07-13,118.389999,118.400002,116.68,116.779999,16207700,116.779999 +FB,2016-07-14,117.5,117.639999,116.699997,117.290001,14579700,117.290001 +FB,2016-07-15,117.739998,118.279999,116.580002,116.860001,16646000,116.860001 +FB,2016-07-18,117.32,119.610001,116.889999,119.370003,20868400,119.370003 +FB,2016-07-19,118.989998,120.849998,118.660004,120.610001,21541300,120.610001 +FB,2016-07-20,121.25,122.199997,120.559998,121.919998,20046500,121.919998 +FB,2016-07-21,121.919998,122.099998,120.25,120.610001,17801700,120.610001 +FB,2016-07-22,119.900002,121.010002,119.309998,121,18422400,121 +FB,2016-07-25,121.389999,121.849998,117.779999,121.629997,18487400,121.629997 +FB,2016-07-26,122,122.07,120.75,121.220001,17612000,121.220001 +FB,2016-07-27,122.419998,125,121.510002,123.339996,52654200,123.339996 +FB,2016-07-28,127.519997,128.330002,123.629997,125,78955800,125 +FB,2016-07-29,124.650002,125.839996,123.709999,123.940002,35058800,123.940002 +FB,2016-08-01,123.849998,124.580002,122.860001,124.309998,25006900,124.309998 +FB,2016-08-02,124.059998,124.800003,122.07,123.089996,23968400,123.089996 +FB,2016-08-03,123.089996,123.919998,122.309998,122.510002,18525300,122.510002 +FB,2016-08-04,122.940002,124.790001,122.510002,124.360001,21066000,124.360001 +FB,2016-08-05,124.980003,125.839996,124.620003,125.150002,20184000,125.150002 +FB,2016-08-08,125.25,125.449997,124.550003,125.260002,15233900,125.260002 +FB,2016-08-09,125.339996,126.089996,124.529999,125.059998,19621000,125.059998 +FB,2016-08-10,125.07,125.480003,124.540001,124.879997,10670100,124.879997 +FB,2016-08-11,125.199997,125.379997,124.75,124.900002,11729500,124.900002 +FB,2016-08-12,124.699997,125,124.18,124.879997,12159000,124.879997 +FB,2016-08-15,124.910004,124.919998,123.699997,123.900002,19295100,123.900002 +FB,2016-08-16,123.5,123.919998,122.779999,123.300003,14222400,123.300003 +FB,2016-08-17,123.660004,124.379997,122.849998,124.370003,13794200,124.370003 +FB,2016-08-18,124.010002,124.260002,123.639999,123.910004,12400800,123.910004 +FB,2016-08-19,123.599998,124.160004,123.279999,123.559998,11688300,123.559998 +FB,2016-08-22,123.330002,124.830002,123.110001,124.150002,14386400,124.150002 +FB,2016-08-23,124.510002,125.089996,124.25,124.370003,13309500,124.370003 +FB,2016-08-24,124.470001,124.690002,123.089996,123.480003,12243700,123.480003 +FB,2016-08-25,123.120003,124.370003,123.099998,123.889999,10730800,123.889999 +FB,2016-08-26,124.050003,125.190002,123.910004,124.959999,17504800,124.959999 +FB,2016-08-29,124.349998,126.730003,124.349998,126.540001,15925900,126.540001 +FB,2016-08-30,126.599998,126.599998,125.150002,125.839996,17804300,125.839996 +FB,2016-08-31,125.599998,126.220001,125.099998,126.120003,14200600,126.120003 +FB,2016-09-01,126.379997,126.629997,125.599998,126.169998,13536100,126.169998 +FB,2016-09-02,126.849998,126.860001,126,126.510002,12118800,126.510002 +FB,2016-09-06,126.669998,129.940002,126.470001,129.729996,26278400,129.729996 +FB,2016-09-07,130.039993,131.979996,129.949997,131.050003,27990800,131.050003 +FB,2016-09-08,130.919998,131.080002,129.809998,130.270004,15676600,130.270004 +FB,2016-09-09,129.710007,129.949997,127.099998,127.099998,27100700,127.099998 +FB,2016-09-12,125.959999,128.759995,125.75,128.690002,21252800,128.690002 +FB,2016-09-13,128.029999,128.350006,126.660004,127.209999,18016200,127.209999 +FB,2016-09-14,126.889999,128.800003,126.889999,127.769997,15691100,127.769997 +FB,2016-09-15,127.980003,129.100006,127.669998,128.350006,15077200,128.350006 +FB,2016-09-16,128.199997,129.179993,128.199997,129.070007,24119200,129.070007 +FB,2016-09-19,129.910004,129.940002,128.259995,128.649994,14958800,128.649994 +FB,2016-09-20,128.649994,129.169998,128.029999,128.639999,11083800,128.639999 +FB,2016-09-21,129.130005,130.009995,128.389999,129.940002,14068300,129.940002 +FB,2016-09-22,130.5,130.729996,129.559998,130.080002,15538300,130.080002 +FB,2016-09-23,127.559998,128.600006,127.300003,127.959999,28326300,127.959999 +FB,2016-09-26,127.370003,128.160004,126.800003,127.309998,15064900,127.309998 +FB,2016-09-27,127.610001,129.009995,127.43,128.690002,15637100,128.690002 +FB,2016-09-28,129.210007,129.470001,128.399994,129.229996,12047600,129.229996 +FB,2016-09-29,129.179993,129.289993,127.550003,128.089996,14532200,128.089996 +FB,2016-09-30,128.029999,128.589996,127.449997,128.270004,18402900,128.270004 +FB,2016-10-03,128.380005,129.089996,127.800003,128.770004,13156900,128.770004 +FB,2016-10-04,129.169998,129.279999,127.550003,128.190002,14307500,128.190002 +FB,2016-10-05,128.25,128.800003,127.830002,128.470001,12386800,128.470001 +FB,2016-10-06,128.429993,129.059998,128.080002,128.740005,11682700,128.740005 +FB,2016-10-07,129.039993,129.25,128.330002,128.990005,12804400,128.990005 +FB,2016-10-10,129.679993,130.699997,129.199997,130.240005,15138700,130.240005 +FB,2016-10-11,130.229996,130.639999,128.229996,128.880005,17537900,128.880005 +FB,2016-10-12,129.009995,129.660004,128.460007,129.050003,11073000,129.050003 +FB,2016-10-13,128.210007,128.25,126.75,127.82,17139300,127.82 +FB,2016-10-14,128.490005,128.949997,127.580002,127.879997,13345300,127.879997 +FB,2016-10-17,128.199997,128.470001,127.32,127.540001,11351700,127.540001 +FB,2016-10-18,128.679993,129.389999,128.009995,128.570007,13504000,128.570007 +FB,2016-10-19,128.740005,130.470001,128.600006,130.110001,16752300,130.110001 +FB,2016-10-20,130.070007,130.660004,129.5,130,13167500,130 +FB,2016-10-21,129.779999,132.130005,129.699997,132.070007,19088800,132.070007 +FB,2016-10-24,132.720001,133.410004,132.149994,133.279999,17470200,133.279999 +FB,2016-10-25,133.5,133.5,132.220001,132.289993,13336800,132.289993 +FB,2016-10-26,131.639999,132.259995,130.940002,131.039993,13084700,131.039993 +FB,2016-10-27,131.740005,131.800003,129.270004,129.690002,16741400,129.690002 +FB,2016-10-28,130.5,132.970001,129.929993,131.289993,24545500,131.289993 +FB,2016-10-31,132.009995,132.119995,130.880005,130.990005,15669000,130.990005 +FB,2016-11-01,131.410004,131.940002,128.649994,129.5,22077800,129.5 +FB,2016-11-02,130.229996,130.229996,126.279999,127.169998,39640900,127.169998 +FB,2016-11-03,122,123.279999,119.5,120,63766300,120 +FB,2016-11-04,119.589996,121.93,119.25,120.75,30545500,120.75 +FB,2016-11-07,122.830002,123.209999,121.349998,122.150002,23008900,122.150002 +FB,2016-11-08,122.029999,124.610001,121.540001,124.220001,19367800,124.220001 +FB,2016-11-09,121.5,123.809998,120.510002,123.18,31856100,123.18 +FB,2016-11-10,123.93,124.18,115.269997,120.800003,67822800,120.800003 +FB,2016-11-11,119.529999,120.699997,118.150002,119.019997,32804000,119.019997 +FB,2016-11-14,119.129997,119.129997,113.550003,115.080002,51247400,115.080002 +FB,2016-11-15,116.730003,118.489998,115.830002,117.199997,33270700,117.199997 +FB,2016-11-16,114.480003,117.879997,114.209999,116.339996,32345400,116.339996 +FB,2016-11-17,116.809998,117.790001,116.010002,117.790001,18556200,117.790001 +FB,2016-11-18,118.389999,119.129997,116.839996,117.019997,22051700,117.019997 +FB,2016-11-21,118.199997,121.949997,117.800003,121.769997,35288000,121.769997 +FB,2016-11-22,122.400002,122.980003,120.900002,121.470001,25992700,121.470001 +FB,2016-11-23,121.230003,121.309998,119.940002,120.839996,15592400,120.839996 +FB,2016-11-25,121.010002,121.139999,120.07,120.379997,8638400,120.379997 +FB,2016-11-28,120.120003,121.690002,119.82,120.410004,18073300,120.410004 +FB,2016-11-29,120.57,122.099998,120.400002,120.870003,18846600,120.870003 +FB,2016-11-30,120.32,121.790001,117.949997,118.419998,30035600,118.419998 +FB,2016-12-01,118.379997,118.449997,114,115.099998,43209700,115.099998 +FB,2016-12-02,115.110001,116.480003,114.300003,115.400002,25015200,115.400002 +FB,2016-12-05,115.949997,117.57,115.07,117.43,20095200,117.43 +FB,2016-12-06,117.690002,117.800003,116.330002,117.309998,19048500,117.309998 +FB,2016-12-07,117,117.949997,116.57,117.949997,21855600,117.949997 +FB,2016-12-08,117.980003,119.5,117.639999,118.910004,22404200,118.910004 +FB,2016-12-09,119.220001,119.940002,118.949997,119.68,17436000,119.68 +FB,2016-12-12,119.220001,119.239998,117.650002,117.769997,17769700,117.769997 +FB,2016-12-13,117.860001,121.519997,117.610001,120.309998,29558100,120.309998 +FB,2016-12-14,120,121.690002,118.849998,120.209999,25667800,120.209999 +FB,2016-12-15,120.080002,122.5,119.629997,120.57,20102900,120.57 +FB,2016-12-16,120.900002,121.5,119.269997,119.870003,25174600,119.870003 +FB,2016-12-19,119.849998,120.360001,118.510002,119.239998,15841700,119.239998 +FB,2016-12-20,119.5,119.769997,118.800003,119.089996,13528100,119.089996 +FB,2016-12-21,118.919998,119.199997,118.480003,119.040001,10735800,119.040001 +FB,2016-12-22,118.860001,118.989998,116.93,117.400002,16222400,117.400002 +FB,2016-12-23,117,117.559998,116.300003,117.269997,10877300,117.269997 +FB,2016-12-27,116.959999,118.68,116.860001,118.010002,12027700,118.010002 +FB,2016-12-28,118.190002,118.25,116.650002,116.919998,11980200,116.919998 +FB,2016-12-29,117,117.529999,116.059998,116.349998,9921400,116.349998 +FB,2016-12-30,116.599998,116.830002,114.769997,115.050003,18600100,115.050003 +AMZN,2013-01-02,256.079987,258.100006,253.259995,257.309998,3271000,257.309998 +AMZN,2013-01-03,257.269989,260.880005,256.369995,258.480011,2750900,258.480011 +AMZN,2013-01-04,257.579987,259.799988,256.649994,259.149994,1874200,259.149994 +AMZN,2013-01-07,262.970001,269.730011,262.670013,268.459991,4910000,268.459991 +AMZN,2013-01-08,267.070007,268.980011,263.570007,266.380005,3010700,266.380005 +AMZN,2013-01-09,268.170013,269.5,265.399994,266.350006,2265600,266.350006 +AMZN,2013-01-10,268.540009,268.73999,262.299988,265.339996,2863400,265.339996 +AMZN,2013-01-11,265.100006,268.429993,264.109985,267.940002,2413300,267.940002 +AMZN,2013-01-14,268,274.26001,267.540009,272.730011,4275000,272.730011 +AMZN,2013-01-15,270.679993,272.730011,269.299988,271.899994,2326900,271.899994 +AMZN,2013-01-16,270.529999,271.23999,267.829987,268.929993,2065600,268.929993 +AMZN,2013-01-17,271.5,271.970001,269.209991,270.480011,1884600,270.480011 +AMZN,2013-01-18,270.829987,274.5,269.600006,272.119995,2942000,272.119995 +AMZN,2013-01-22,271.619995,272.100006,269.230011,270.190002,2137700,270.190002 +AMZN,2013-01-23,270.570007,271.089996,266.649994,268.109985,2508900,268.109985 +AMZN,2013-01-24,269.369995,276.649994,269.369995,273.459991,3417000,273.459991 +AMZN,2013-01-25,275,284.720001,274.399994,283.98999,4968100,283.98999 +AMZN,2013-01-28,283.779999,284.480011,274.399994,276.040009,4321400,276.040009 +AMZN,2013-01-29,275.350006,275.459991,258.350006,260.350006,10172600,260.350006 +AMZN,2013-01-30,283,284.200012,267.109985,272.76001,13075400,272.76001 +AMZN,2013-01-31,271.040009,275.940002,263.700012,265.5,6772100,265.5 +AMZN,2013-02-01,268.929993,268.929993,262.799988,265,6115000,265 +AMZN,2013-02-04,262.779999,264.679993,259.070007,259.980011,3723600,259.980011 +AMZN,2013-02-05,262,268.029999,261.459991,266.890015,4012900,266.890015 +AMZN,2013-02-06,265.160004,266.890015,261.109985,262.220001,2770400,262.220001 +AMZN,2013-02-07,264.100006,264.100006,255.110001,260.230011,3975700,260.230011 +AMZN,2013-02-08,261.399994,265.25,260.549988,261.950012,3879200,261.950012 +AMZN,2013-02-11,263.200012,263.25,256.600006,257.209991,3403700,257.209991 +AMZN,2013-02-12,259.190002,260.160004,257,258.700012,2943700,258.700012 +AMZN,2013-02-13,261.529999,269.959991,260.299988,269.470001,5293000,269.470001 +AMZN,2013-02-14,267.369995,270.649994,265.399994,269.23999,3463000,269.23999 +AMZN,2013-02-15,267.630005,268.920013,263.109985,265.089996,3979900,265.089996 +AMZN,2013-02-19,265.910004,270.109985,264.5,269.75,2854200,269.75 +AMZN,2013-02-20,270.200012,274.299988,266.369995,266.410004,3528900,266.410004 +AMZN,2013-02-21,265.119995,269.480011,263.25,265.940002,3637400,265.940002 +AMZN,2013-02-22,266.619995,267.109985,261.609985,265.420013,3124800,265.420013 +AMZN,2013-02-25,266.940002,268.690002,259.649994,259.869995,3032400,259.869995 +AMZN,2013-02-26,260.890015,262.040009,255.729996,259.359985,3348600,259.359985 +AMZN,2013-02-27,259.399994,265.829987,256.859985,263.25,2908100,263.25 +AMZN,2013-02-28,261.809998,267,260.630005,264.269989,2667200,264.269989 +AMZN,2013-03-01,263.269989,266.600006,261.040009,265.73999,2957000,265.73999 +AMZN,2013-03-04,265.359985,273.299988,264.140015,273.109985,3453000,273.109985 +AMZN,2013-03-05,274,276.679993,269.98999,275.589996,3686200,275.589996 +AMZN,2013-03-06,275.76001,276.48999,271.829987,273.790009,2050700,273.790009 +AMZN,2013-03-07,274.100006,274.799988,271.850006,273.880005,1939000,273.880005 +AMZN,2013-03-08,275,275.440002,271.5,274.190002,1879800,274.190002 +AMZN,2013-03-11,273.429993,273.98999,270.399994,271.23999,1904900,271.23999 +AMZN,2013-03-12,271,277.399994,270.359985,274.130005,3246200,274.130005 +AMZN,2013-03-13,275.23999,276.5,272.640015,275.100006,1884200,275.100006 +AMZN,2013-03-14,269.670013,270,263.529999,265.73999,5226700,265.73999 +AMZN,2013-03-15,264.980011,267.26001,260.049988,261.820007,4865900,261.820007 +AMZN,2013-03-18,259.299988,261.48999,257.119995,257.890015,2720200,257.890015 +AMZN,2013-03-19,258.399994,259.5,252.619995,256.410004,3738500,256.410004 +AMZN,2013-03-20,258.049988,259.76001,254.550003,257.279999,2738900,257.279999 +AMZN,2013-03-21,256.109985,257,252.679993,253.389999,2806400,253.389999 +AMZN,2013-03-22,254.550003,257.769989,252.070007,257.75,3124600,257.75 +AMZN,2013-03-25,258.579987,259.429993,254.5,256.019989,2513900,256.019989 +AMZN,2013-03-26,257.049988,261.480011,256.279999,260.309998,2421000,260.309998 +AMZN,2013-03-27,258.75,265.929993,257.899994,265.299988,2874900,265.299988 +AMZN,2013-03-28,265.820007,267.380005,264.059998,266.48999,2473700,266.48999 +AMZN,2013-04-01,266.980011,267.399994,261.01001,261.609985,2524800,261.609985 +AMZN,2013-04-02,262.399994,265.890015,260.549988,263.320007,2631100,263.320007 +AMZN,2013-04-03,262.119995,263.670013,257.75,259.029999,2413800,259.029999 +AMZN,2013-04-04,259.230011,260.410004,256.119995,259.079987,1964400,259.079987 +AMZN,2013-04-05,255.720001,256.179993,253.669998,255.479996,2557400,255.479996 +AMZN,2013-04-08,255.919998,259.679993,255.630005,258.950012,2295600,258.950012 +AMZN,2013-04-09,258.850006,262.609985,257,261.140015,2156600,261.140015 +AMZN,2013-04-10,261.779999,265.980011,259.320007,264.769989,2322500,264.769989 +AMZN,2013-04-11,264.73999,270.970001,264.73999,269.850006,3090500,269.850006 +AMZN,2013-04-12,270.119995,273.269989,267.019989,272.869995,2866300,272.869995 +AMZN,2013-04-15,271.079987,275.119995,267.100006,267.720001,3326000,267.720001 +AMZN,2013-04-16,269.309998,272.799988,268.059998,272.339996,2137200,272.339996 +AMZN,2013-04-17,270.799988,270.850006,264.25,267.399994,3135100,267.399994 +AMZN,2013-04-18,266.809998,266.98999,256.600006,259.420013,3137600,259.420013 +AMZN,2013-04-19,258.160004,262.880005,257.5,260.320007,2602500,260.320007 +AMZN,2013-04-22,259.350006,264.600006,258.029999,263.549988,2119100,263.549988 +AMZN,2013-04-23,264.5,269.869995,264.5,268.899994,2270600,268.899994 +AMZN,2013-04-24,269.5,271.470001,266.809998,268.779999,1852800,268.779999 +AMZN,2013-04-25,271.529999,275.799988,270.5,274.700012,6116500,274.700012 +AMZN,2013-04-26,269.970001,272.019989,252.809998,254.809998,14030000,254.809998 +AMZN,2013-04-29,254.899994,257.01001,249.149994,249.740005,7117000,249.740005 +AMZN,2013-04-30,249.369995,254.679993,248.559998,253.809998,4248800,253.809998 +AMZN,2013-05-01,253.899994,254.199997,245.75,248.229996,4391400,248.229996 +AMZN,2013-05-02,248.940002,252.929993,245.779999,252.550003,3936200,252.550003 +AMZN,2013-05-03,256.140015,259.25,254.699997,258.049988,3514000,258.049988 +AMZN,2013-05-06,258.089996,259.5,253.419998,255.720001,2347800,255.720001 +AMZN,2013-05-07,256.309998,259.73999,252.910004,257.730011,3133700,257.730011 +AMZN,2013-05-08,256.869995,260.299988,255.330002,258.679993,2677000,258.679993 +AMZN,2013-05-09,258.730011,263.549988,256.880005,260.160004,2769300,260.160004 +AMZN,2013-05-10,260.880005,263.649994,260.209991,263.630005,3145300,263.630005 +AMZN,2013-05-13,262.769989,265.880005,262,264.51001,2149500,264.51001 +AMZN,2013-05-14,264.5,269.399994,264.029999,268.329987,2700000,268.329987 +AMZN,2013-05-15,267.070007,269.049988,264.559998,266.559998,2720500,266.559998 +AMZN,2013-05-16,265.959991,268.429993,263.850006,264.119995,1643500,264.119995 +AMZN,2013-05-17,265.829987,269.980011,265,269.899994,2527300,269.899994 +AMZN,2013-05-20,269,271.790009,266.5,267.630005,2209000,267.630005 +AMZN,2013-05-21,268.73999,270.769989,267.660004,268.859985,1741200,268.859985 +AMZN,2013-05-22,267.390015,267.589996,260.799988,262.959991,3332000,262.959991 +AMZN,2013-05-23,260.48999,263.170013,259.589996,261.799988,2000300,261.799988 +AMZN,2013-05-24,259.850006,261.929993,258.339996,261.73999,1696300,261.73999 +AMZN,2013-05-28,266.480011,271.100006,266,267.290009,3471000,267.290009 +AMZN,2013-05-29,265.459991,268.25,264.839996,265.529999,1903400,265.529999 +AMZN,2013-05-30,265.709991,268.570007,265.609985,266.829987,1667500,266.829987 +AMZN,2013-05-31,266,271.910004,265.940002,269.200012,3374300,269.200012 +AMZN,2013-06-03,268.959991,269.109985,262.950012,266.880005,2543900,266.880005 +AMZN,2013-06-04,267,268.880005,263.019989,265.700012,2088600,265.700012 +AMZN,2013-06-05,265.809998,271.660004,265.019989,267.170013,3512300,267.170013 +AMZN,2013-06-06,267.75,270.5,264.209991,267.829987,2476300,267.829987 +AMZN,2013-06-07,269.73999,280.100006,269.130005,276.869995,4632600,276.869995 +AMZN,2013-06-10,276.679993,282.470001,275.23999,281.070007,3086500,281.070007 +AMZN,2013-06-11,276,278.410004,274.23999,274.779999,3097800,274.779999 +AMZN,2013-06-12,276.600006,276.799988,270.450012,271.670013,2238900,271.670013 +AMZN,2013-06-13,271.5,276.799988,270.290009,275.790009,2649800,275.790009 +AMZN,2013-06-14,275,277.070007,273.440002,273.98999,2150800,273.98999 +AMZN,2013-06-17,276.350006,280.200012,275.649994,278.059998,2884000,278.059998 +AMZN,2013-06-18,279.079987,282.910004,278.109985,281.76001,2146100,281.76001 +AMZN,2013-06-19,281.26001,283.339996,277.869995,278.160004,2827500,278.160004 +AMZN,2013-06-20,275.140015,278.600006,272.390015,273.440002,2984000,273.440002 +AMZN,2013-06-21,274.570007,275.839996,269.790009,273.359985,4201000,273.359985 +AMZN,2013-06-24,271.290009,273.160004,265,270.609985,3863800,270.609985 +AMZN,2013-06-25,272.299988,273.470001,269,272.089996,2449600,272.089996 +AMZN,2013-06-26,273.980011,277.980011,273.5,277.570007,3029500,277.570007 +AMZN,2013-06-27,279.179993,280.200012,274.540009,277.549988,2519500,277.549988 +AMZN,2013-06-28,276.190002,279.829987,276.190002,277.690002,3193300,277.690002 +AMZN,2013-07-01,279,283.290009,277.160004,282.100006,2888200,282.100006 +AMZN,2013-07-02,281.040009,286.579987,280.589996,283.730011,3238200,283.730011 +AMZN,2013-07-03,282,285.399994,282,284.029999,1373000,284.029999 +AMZN,2013-07-05,285,286.380005,282.070007,285.880005,1985400,285.880005 +AMZN,2013-07-08,286.420013,291.670013,286.140015,290.589996,3046700,290.589996 +AMZN,2013-07-09,291,292.570007,288.01001,291.529999,2775600,291.529999 +AMZN,2013-07-10,291.410004,293.339996,289.399994,292.329987,1810200,292.329987 +AMZN,2013-07-11,294.98999,300.690002,292.100006,299.660004,4007300,299.660004 +AMZN,2013-07-12,298.690002,307.549988,298.5,307.549988,4539300,307.549988 +AMZN,2013-07-15,307.269989,307.98999,304.350006,306.570007,2245600,306.570007 +AMZN,2013-07-16,307.299988,309.390015,305.51001,306.869995,2660200,306.869995 +AMZN,2013-07-17,306.970001,308.799988,305.690002,308.690002,2029700,308.690002 +AMZN,2013-07-18,306.269989,306.339996,301.869995,304.109985,3063800,304.109985 +AMZN,2013-07-19,304.390015,305.790009,301.910004,305.230011,2973100,305.230011 +AMZN,2013-07-22,309.25,309.25,302,303.480011,2520700,303.480011 +AMZN,2013-07-23,303.160004,305.059998,300.559998,301.059998,1999600,301.059998 +AMZN,2013-07-24,303.019989,303.839996,298.040009,298.940002,2000500,298.940002 +AMZN,2013-07-25,299,304.5,296.75,303.399994,5405800,303.399994 +AMZN,2013-07-26,299.549988,313.619995,295.549988,312.01001,8817500,312.01001 +AMZN,2013-07-29,311.070007,313,305.899994,306.100006,3211800,306.100006 +AMZN,2013-07-30,307.720001,309.779999,301.570007,302.410004,3053400,302.410004 +AMZN,2013-07-31,303.910004,305.149994,301,301.220001,1891300,301.220001 +AMZN,2013-08-01,303.079987,306.209991,298.899994,305.570007,2971700,305.570007 +AMZN,2013-08-02,304.630005,305.329987,301.5,304.209991,2502600,304.209991 +AMZN,2013-08-05,303.399994,303.619995,298.299988,300.98999,2233200,300.98999 +AMZN,2013-08-06,300.51001,301.359985,297.519989,300.75,1849000,300.75 +AMZN,2013-08-07,300.149994,300.98999,296.149994,296.910004,1961000,296.910004 +AMZN,2013-08-08,298.519989,298.519989,292.549988,295.73999,2343400,295.73999 +AMZN,2013-08-09,295.679993,299.269989,294.299988,297.26001,1950300,297.26001 +AMZN,2013-08-12,295.790009,299.079987,295.26001,296.690002,1504500,296.690002 +AMZN,2013-08-13,295.880005,296.369995,290.670013,293.970001,2349900,293.970001 +AMZN,2013-08-14,294.290009,294.290009,290.540009,291.339996,1415000,291.339996 +AMZN,2013-08-15,288.790009,289.299988,285.149994,286.470001,2261400,286.470001 +AMZN,2013-08-16,286.549988,288.329987,284.5,284.820007,2422500,284.820007 +AMZN,2013-08-19,285.190002,289.559998,283.480011,285.570007,2477400,285.570007 +AMZN,2013-08-20,285.880005,289.51001,285.73999,287.089996,1586300,287.089996 +AMZN,2013-08-21,285.089996,288.5,283.829987,284.570007,1815300,284.570007 +AMZN,2013-08-22,284.799988,289.869995,284.799988,289.730011,1422600,289.730011 +AMZN,2013-08-23,291.209991,291.5,287.899994,290.01001,1961900,290.01001 +AMZN,2013-08-26,290.429993,291.049988,285.619995,286.209991,1711700,286.209991 +AMZN,2013-08-27,283.869995,285.279999,279.73999,280.929993,2476000,280.929993 +AMZN,2013-08-28,280.359985,283,279.329987,281.579987,1457100,281.579987 +AMZN,2013-08-29,281.450012,285.980011,280,283.980011,1566400,283.980011 +AMZN,2013-08-30,284.589996,284.869995,280,280.980011,1534700,280.980011 +AMZN,2013-09-03,284.730011,291.390015,284.170013,288.799988,2897600,288.799988 +AMZN,2013-09-04,288.329987,295.230011,287.579987,293.640015,2438600,293.640015 +AMZN,2013-09-05,293.630005,297,292.709991,294.100006,1816600,294.100006 +AMZN,2013-09-06,295.329987,298.880005,290.799988,295.859985,2292000,295.859985 +AMZN,2013-09-09,297.220001,299.959991,296.600006,299.709991,1643600,299.709991 +AMZN,2013-09-10,300.549988,301,297.220001,300.359985,1778400,300.359985 +AMZN,2013-09-11,298.910004,301.859985,297.839996,299.640015,1742600,299.640015 +AMZN,2013-09-12,299.390015,302,297.660004,298.859985,1606200,298.859985 +AMZN,2013-09-13,300.140015,300.220001,296.200012,297.920013,1350600,297.920013 +AMZN,2013-09-16,299.820007,301,295.26001,296.059998,1808400,296.059998 +AMZN,2013-09-17,297.630005,304.649994,296.01001,304.170013,2296500,304.170013 +AMZN,2013-09-18,304.059998,312.73999,302.910004,312.029999,2946400,312.029999 +AMZN,2013-09-19,313.769989,314.540009,311.040009,312.059998,2350900,312.059998 +AMZN,2013-09-20,312.540009,320.570007,312.410004,316.339996,5302300,316.339996 +AMZN,2013-09-23,314.01001,315.899994,308.769989,311.48999,1884900,311.48999 +AMZN,2013-09-24,312.429993,318.079987,311.279999,314.130005,2033600,314.130005 +AMZN,2013-09-25,314.529999,316.709991,310.75,312.649994,2008600,312.649994 +AMZN,2013-09-26,313.899994,319.369995,313.26001,318.119995,1989900,318.119995 +AMZN,2013-09-27,316.920013,317.209991,313.350006,316.01001,1657500,316.01001 +AMZN,2013-09-30,313.410004,315.309998,311.059998,312.640015,1623600,312.640015 +AMZN,2013-10-01,314.220001,321,313.649994,320.950012,2396400,320.950012 +AMZN,2013-10-02,318.040009,321.730011,317.519989,320.51001,2217400,320.51001 +AMZN,2013-10-03,320.390015,322.920013,313.019989,314.76001,2674800,314.76001 +AMZN,2013-10-04,315.130005,319.200012,312.619995,319.040009,1815000,319.040009 +AMZN,2013-10-07,315.23999,315.339996,309.73999,310.029999,2083200,310.029999 +AMZN,2013-10-08,311.5,311.549988,300.269989,303.230011,3166200,303.230011 +AMZN,2013-10-09,303.420013,303.5,296.5,298.230011,3247400,298.230011 +AMZN,2013-10-10,304.630005,306.700012,302.589996,305.170013,2555100,305.170013 +AMZN,2013-10-11,304.769989,310.929993,303.839996,310.890015,2163100,310.890015 +AMZN,2013-10-14,309.220001,311.649994,307,310.700012,1939100,310.700012 +AMZN,2013-10-15,309.869995,310.790009,305.26001,306.399994,2261100,306.399994 +AMZN,2013-10-16,308.380005,310.799988,305.549988,310.48999,2170700,310.48999 +AMZN,2013-10-17,307.070007,311,305.23999,310.769989,2648400,310.769989 +AMZN,2013-10-18,319.359985,331.890015,316.75,328.929993,5969800,328.929993 +AMZN,2013-10-21,329.890015,330,323.799988,326.440002,2522300,326.440002 +AMZN,2013-10-22,327.720001,337.109985,325.679993,332.540009,3935500,332.540009 +AMZN,2013-10-23,330.839996,331.720001,324.059998,326.76001,2818200,326.76001 +AMZN,2013-10-24,329.630005,332.649994,326.75,332.209991,5884700,332.209991 +AMZN,2013-10-25,358.600006,368.399994,352.619995,363.390015,12036800,363.390015 +AMZN,2013-10-28,359.920013,362.75,357.200012,358.160004,3635800,358.160004 +AMZN,2013-10-29,358.959991,362.890015,356.290009,362.700012,2185400,362.700012 +AMZN,2013-10-30,362.619995,365,358.649994,361.079987,4502200,361.079987 +AMZN,2013-10-31,361.730011,366,359,364.029999,2466800,364.029999 +AMZN,2013-11-01,365.630005,365.769989,356.100006,359,3331000,359 +AMZN,2013-11-04,360.119995,361,354.399994,358.73999,1938400,358.73999 +AMZN,2013-11-05,356.779999,360.170013,354.839996,358.890015,2007100,358.890015 +AMZN,2013-11-06,360.450012,362.869995,354.5,356.179993,2282300,356.179993 +AMZN,2013-11-07,355.859985,357.899994,341.880005,343.559998,4246300,343.559998 +AMZN,2013-11-08,345.950012,351.049988,344.040009,350.309998,2656900,350.309998 +AMZN,2013-11-11,350.589996,355.369995,348.059998,354.380005,2261700,354.380005 +AMZN,2013-11-12,352.98999,355.480011,347.279999,349.529999,2343100,349.529999 +AMZN,2013-11-13,347.399994,356.220001,345.679993,356.220001,2773300,356.220001 +AMZN,2013-11-14,357.390015,368.940002,356.429993,367.399994,4159800,367.399994 +AMZN,2013-11-15,367.630005,372.899994,365.549988,369.170013,4491600,369.170013 +AMZN,2013-11-18,370.279999,373.48999,364.670013,366.179993,2737400,366.179993 +AMZN,2013-11-19,365.820007,368.779999,362.5,364.940002,1904800,364.940002 +AMZN,2013-11-20,367.559998,367.559998,360.450012,362.570007,1771500,362.570007 +AMZN,2013-11-21,364.049988,369.25,363.299988,368.920013,1964600,368.920013 +AMZN,2013-11-22,370,374.5,366.309998,372.309998,2965500,372.309998 +AMZN,2013-11-25,373.820007,377.790009,373.179993,376.640015,2972300,376.640015 +AMZN,2013-11-26,377.609985,382.5,374.820007,381.369995,2724400,381.369995 +AMZN,2013-11-27,383.5,387,382.609985,386.709991,2269700,386.709991 +AMZN,2013-11-29,389.100006,394.100006,388.619995,393.619995,2406000,393.619995 +AMZN,2013-12-02,399,399,389.100006,392.299988,4714000,392.299988 +AMZN,2013-12-03,390.109985,390.950012,383.100006,384.660004,3702900,384.660004 +AMZN,2013-12-04,383.5,389.690002,381.48999,385.959991,2355300,385.959991 +AMZN,2013-12-05,386.649994,386.649994,381.369995,384.48999,1906500,384.48999 +AMZN,2013-12-06,388.350006,388.350006,383.829987,386.950012,1984700,386.950012 +AMZN,2013-12-09,388.109985,388.209991,382.570007,384.890015,2761800,384.890015 +AMZN,2013-12-10,383.73999,389.059998,383.019989,387.779999,2736800,387.779999 +AMZN,2013-12-11,387.339996,388.980011,382,382.190002,2451300,382.190002 +AMZN,2013-12-12,381.26001,385,379.5,381.25,2123700,381.25 +AMZN,2013-12-13,385.320007,389.420013,383.799988,384.23999,3025000,384.23999 +AMZN,2013-12-16,385.029999,391.700012,385,388.970001,2251700,388.970001 +AMZN,2013-12-17,390.649994,391.359985,386.5,387.649994,2343900,387.649994 +AMZN,2013-12-18,389.230011,396.299988,383.100006,395.959991,3489100,395.959991 +AMZN,2013-12-19,394.269989,397.290009,392.600006,395.190002,2427200,395.190002 +AMZN,2013-12-20,396.549988,404.720001,395.779999,402.200012,5033900,402.200012 +AMZN,2013-12-23,403.690002,405,399.200012,402.920013,2659500,402.920013 +AMZN,2013-12-24,402.519989,403.720001,396.369995,399.200012,1380400,399.200012 +AMZN,2013-12-26,401.790009,404.519989,396.809998,404.390015,1868500,404.390015 +AMZN,2013-12-27,404.649994,405.630005,396.25,398.079987,1986900,398.079987 +AMZN,2013-12-30,399.410004,399.920013,392.450012,393.369995,2487100,393.369995 +AMZN,2013-12-31,394.579987,398.829987,393.799988,398.790009,1996500,398.790009 +AMZN,2014-01-02,398.799988,399.359985,394.019989,397.970001,2137800,397.970001 +AMZN,2014-01-03,398.290009,402.709991,396.220001,396.440002,2210200,396.440002 +AMZN,2014-01-06,395.850006,397,388.420013,393.630005,3170600,393.630005 +AMZN,2014-01-07,395.040009,398.470001,394.290009,398.029999,1916000,398.029999 +AMZN,2014-01-08,398.470001,403,396.040009,401.920013,2316500,401.920013 +AMZN,2014-01-09,403.709991,406.890015,398.440002,401.01001,2103000,401.01001 +AMZN,2014-01-10,402.529999,403.76001,393.799988,397.660004,2679500,397.660004 +AMZN,2014-01-13,397.980011,399.779999,388.450012,390.980011,2844900,390.980011 +AMZN,2014-01-14,392.130005,398.630005,391.290009,397.540009,2340100,397.540009 +AMZN,2014-01-15,398.940002,399.309998,392.529999,395.869995,2678300,395.869995 +AMZN,2014-01-16,393.679993,399.290009,389.410004,395.799988,2601200,395.799988 +AMZN,2014-01-17,394.26001,403.48999,393.660004,399.609985,4505100,399.609985 +AMZN,2014-01-21,403,407.799988,401.600006,407.049988,3122100,407.049988 +AMZN,2014-01-22,408,408.059998,402,404.540009,2060500,404.540009 +AMZN,2014-01-23,401,406.170013,397.790009,399.869995,3025400,399.869995 +AMZN,2014-01-24,398.160004,400.200012,387.269989,387.600006,4458400,387.600006 +AMZN,2014-01-27,390.5,394.100006,380.48999,386.279999,3936800,386.279999 +AMZN,2014-01-28,387.399994,394.73999,387.119995,394.429993,2894500,394.429993 +AMZN,2014-01-29,392.160004,392.850006,383.23999,384.200012,3382300,384.200012 +AMZN,2014-01-30,393.769989,406.25,387.700012,403.01001,10473900,403.01001 +AMZN,2014-01-31,371.76001,375.450012,357.76001,358.690002,16154800,358.690002 +AMZN,2014-02-03,358.980011,360.850006,340.100006,346.149994,10280800,346.149994 +AMZN,2014-02-04,349.589996,354,344.019989,347.950012,4812900,347.950012 +AMZN,2014-02-05,346,349.369995,337.730011,346.450012,4435400,346.450012 +AMZN,2014-02-06,347.399994,354.820007,347.399994,354.589996,3335700,354.589996 +AMZN,2014-02-07,358.980011,361.799988,352.48999,361.079987,4330500,361.079987 +AMZN,2014-02-10,361.609985,365,359.350006,360.869995,3449700,360.869995 +AMZN,2014-02-11,361.839996,363.609985,356.25,361.790009,3222100,361.790009 +AMZN,2014-02-12,356.429993,357.75,346.320007,349.25,6587700,349.25 +AMZN,2014-02-13,347.700012,357.200012,346.5,357.200012,4175000,357.200012 +AMZN,2014-02-14,359.339996,359.339996,353.350006,357.350006,3520200,357.350006 +AMZN,2014-02-18,355.279999,355.730011,349.450012,353.649994,4998000,353.649994 +AMZN,2014-02-19,352.640015,354.540009,346.100006,347.380005,4168100,347.380005 +AMZN,2014-02-20,348.799988,350.459991,344.380005,349.799988,3492800,349.799988 +AMZN,2014-02-21,352.440002,354.140015,346.75,346.76001,4210000,346.76001 +AMZN,2014-02-24,345.190002,353,343.290009,351.779999,3644700,351.779999 +AMZN,2014-02-25,353,361.079987,351.579987,358.320007,3736400,358.320007 +AMZN,2014-02-26,359.859985,364.75,357.170013,359.799988,3622100,359.799988 +AMZN,2014-02-27,357.220001,360.589996,355.5,360.130005,3104900,360.130005 +AMZN,2014-02-28,360.600006,365.869995,357.079987,362.100006,3882000,362.100006 +AMZN,2014-03-03,358.73999,360.959991,354.480011,359.779999,2798300,359.779999 +AMZN,2014-03-04,363.899994,365.679993,362.459991,363.899994,2704400,363.899994 +AMZN,2014-03-05,364.130005,372.730011,363.899994,372.369995,3848300,372.369995 +AMZN,2014-03-06,374.049988,375.329987,368.899994,372.160004,2926600,372.160004 +AMZN,2014-03-07,374.579987,374.98999,369.529999,372.059998,2279800,372.059998 +AMZN,2014-03-10,372.690002,372.730011,367,370.529999,2105800,370.529999 +AMZN,2014-03-11,370.98999,372.799988,367.279999,368.820007,2246100,368.820007 +AMZN,2014-03-12,366.399994,371.160004,363.609985,370.640015,2216600,370.640015 +AMZN,2014-03-13,376.619995,383.109985,368.079987,371.51001,6829000,371.51001 +AMZN,2014-03-14,372.799988,378.570007,371.549988,373.73999,4402200,373.73999 +AMZN,2014-03-17,375.720001,378.850006,374.880005,375.040009,2303000,375.040009 +AMZN,2014-03-18,377.320007,379,375,378.769989,2483500,378.769989 +AMZN,2014-03-19,378.769989,379,369.420013,373.230011,2646700,373.230011 +AMZN,2014-03-20,370.640015,373,366.220001,368.970001,2558500,368.970001 +AMZN,2014-03-21,371,372.839996,358.399994,360.619995,5414100,360.619995 +AMZN,2014-03-24,360.089996,361.5,348.600006,351.850006,4873500,351.850006 +AMZN,2014-03-25,354.029999,358.970001,348.839996,354.709991,4445700,354.709991 +AMZN,2014-03-26,357.130005,357.600006,343.399994,343.410004,4120700,343.410004 +AMZN,2014-03-27,343.149994,344,330.880005,338.470001,5766400,338.470001 +AMZN,2014-03-28,340.049988,347,336.079987,338.290009,3986800,338.290009 +AMZN,2014-03-31,342.399994,346.290009,334.059998,336.369995,4297500,336.369995 +AMZN,2014-04-01,338.089996,344.429993,338,342.98999,3600100,342.98999 +AMZN,2014-04-02,345.98999,348.299988,340.380005,341.959991,4475500,341.959991 +AMZN,2014-04-03,341.820007,342.5,328.459991,333.619995,6399300,333.619995 +AMZN,2014-04-04,335.149994,335.440002,315.609985,323,12534600,323 +AMZN,2014-04-07,320.98999,324.940002,313.130005,317.76001,7077400,317.76001 +AMZN,2014-04-08,321.880005,328,318.440002,327.070007,6577600,327.070007 +AMZN,2014-04-09,328.470001,332.179993,322.5,331.809998,5056600,331.809998 +AMZN,2014-04-10,330.600006,331,316.5,317.109985,6126700,317.109985 +AMZN,2014-04-11,314,316.5,309.5,311.730011,7287500,311.730011 +AMZN,2014-04-14,317.670013,320.480011,311.279999,315.910004,4293500,315.910004 +AMZN,2014-04-15,316.700012,318.279999,305.5,316.079987,5398600,316.079987 +AMZN,2014-04-16,321.170013,324,314.709991,323.679993,4284900,323.679993 +AMZN,2014-04-17,319.76001,328.660004,319.76001,324.910004,4299200,324.910004 +AMZN,2014-04-21,323.970001,331.149994,322.309998,330.869995,2999400,330.869995 +AMZN,2014-04-22,332,337.5,328.940002,329.320007,3711600,329.320007 +AMZN,2014-04-23,333.059998,333.130005,323.390015,324.579987,3604600,324.579987 +AMZN,2014-04-24,329.670013,337.399994,322.950012,337.149994,9293700,337.149994 +AMZN,2014-04-25,316.25,316.48999,302.709991,303.829987,16180200,303.829987 +AMZN,2014-04-28,304,304.390015,288,296.579987,14479800,296.579987 +AMZN,2014-04-29,296.440002,301.839996,290.450012,300.380005,6509300,300.380005 +AMZN,2014-04-30,298.100006,304.559998,298.100006,304.130005,4088600,304.130005 +AMZN,2014-05-01,304.130005,310.480011,304,307.890015,4328600,307.890015 +AMZN,2014-05-02,310.420013,313.290009,304.309998,308.01001,3995100,308.01001 +AMZN,2014-05-05,306.369995,310.230011,305,310.049988,2519900,310.049988 +AMZN,2014-05-06,309.529999,309.809998,297.040009,297.380005,4682300,297.380005 +AMZN,2014-05-07,295.559998,296.399994,286.679993,292.709991,7015200,292.709991 +AMZN,2014-05-08,290.820007,295.880005,287.230011,288.320007,3848200,288.320007 +AMZN,2014-05-09,290.570007,293.679993,284.380005,292.23999,4063000,292.23999 +AMZN,2014-05-12,294.299988,303.339996,294.160004,302.859985,3729600,302.859985 +AMZN,2014-05-13,302.600006,305.600006,300.75,304.640015,3509900,304.640015 +AMZN,2014-05-14,302.5,304.640015,296.660004,297.619995,3323300,297.619995 +AMZN,2014-05-15,298.019989,299.200012,290.380005,295.190002,4295100,295.190002 +AMZN,2014-05-16,292.799988,298.880005,291.549988,297.700012,3636800,297.700012 +AMZN,2014-05-19,295.76001,299,293.809998,296.76001,2284200,296.76001 +AMZN,2014-05-20,297.100006,304.459991,296.75,301.190002,4095700,301.190002 +AMZN,2014-05-21,302.209991,305.959991,301.519989,305.01001,3408800,305.01001 +AMZN,2014-05-22,305.049988,308.540009,303.01001,304.910004,2576800,304.910004 +AMZN,2014-05-23,305.459991,312.350006,304.899994,312.23999,3052900,312.23999 +AMZN,2014-05-27,314.410004,314.630005,307.380005,310.820007,4862100,310.820007 +AMZN,2014-05-28,309.5,313.820007,307.420013,310.160004,2726000,310.160004 +AMZN,2014-05-29,310.420013,314.869995,310.200012,313.779999,2365500,313.779999 +AMZN,2014-05-30,314.429993,314.649994,307.570007,312.549988,4260200,312.549988 +AMZN,2014-06-02,312.589996,312.600006,307,308.839996,2203400,308.839996 +AMZN,2014-06-03,305.75,307.920013,305.070007,307.190002,2379200,307.190002 +AMZN,2014-06-04,306.850006,309.5,303.839996,306.779999,2107100,306.779999 +AMZN,2014-06-05,308.100006,327.940002,306.899994,323.570007,7796700,323.570007 +AMZN,2014-06-06,325,330.880005,324.929993,329.670013,5244000,329.670013 +AMZN,2014-06-09,331.570007,333,325.649994,327.5,3212200,327.5 +AMZN,2014-06-10,327.649994,335.5,327.5,332.410004,3663400,332.410004 +AMZN,2014-06-11,336,340.720001,333.880005,335.200012,4436800,335.200012 +AMZN,2014-06-12,335.549988,335.549988,324.660004,325.910004,4276300,325.910004 +AMZN,2014-06-13,327.049988,329.299988,323.529999,326.269989,2764800,326.269989 +AMZN,2014-06-16,324.859985,328.690002,323.519989,327.619995,2449800,327.619995 +AMZN,2014-06-17,327.540009,331.339996,325.230011,325.619995,2924100,325.619995 +AMZN,2014-06-18,328,335.75,325,334.380005,6401500,334.380005 +AMZN,2014-06-19,335.26001,338.899994,325.980011,327,5320600,327 +AMZN,2014-06-20,327.76001,328.220001,320.420013,324.200012,6054000,324.200012 +AMZN,2014-06-23,323.329987,327.549988,321.410004,327.23999,2604800,327.23999 +AMZN,2014-06-24,327.540009,329.730011,322.73999,324.160004,2626600,324.160004 +AMZN,2014-06-25,324.329987,328.149994,321.73999,327.440002,2327800,327.440002 +AMZN,2014-06-26,328.48999,328.649994,322.130005,325.690002,2699500,325.690002 +AMZN,2014-06-27,325.880005,326.519989,323.269989,324.570007,2416200,324.570007 +AMZN,2014-06-30,324.980011,326.980011,322.23999,324.779999,2671300,324.779999 +AMZN,2014-07-01,325.859985,333.200012,325.100006,332.390015,3173600,332.390015 +AMZN,2014-07-02,333.200012,336.76001,331.660004,332.850006,2681300,332.850006 +AMZN,2014-07-03,334.829987,338.299988,333.079987,337.48999,1944300,337.48999 +AMZN,2014-07-07,337.5,337.549988,332.519989,333.549988,2128900,333.549988 +AMZN,2014-07-08,333.100006,333.73999,321.399994,323.809998,4271600,323.809998 +AMZN,2014-07-09,324.709991,330.200012,323.149994,329.970001,3166100,329.970001 +AMZN,2014-07-10,324.339996,329.980011,322.649994,327.920013,2665000,327.920013 +AMZN,2014-07-11,334.709991,347,334.709991,346.200012,8300800,346.200012 +AMZN,2014-07-14,347.029999,355.769989,345.359985,355.320007,5609900,355.320007 +AMZN,2014-07-15,353.720001,355.589996,349.399994,354.440002,4170900,354.440002 +AMZN,2014-07-16,355.619995,359.320007,353,355.899994,3503600,355.899994 +AMZN,2014-07-17,353.440002,356.959991,351.380005,352.450012,3636000,352.450012 +AMZN,2014-07-18,354.399994,359.679993,352.079987,358.660004,3407400,358.660004 +AMZN,2014-07-21,358.100006,361.709991,356.720001,359.76001,2278400,359.76001 +AMZN,2014-07-22,355.25,362.929993,355.25,360.839996,2888900,360.839996 +AMZN,2014-07-23,359.049988,360.630005,356.619995,358.140015,2687300,358.140015 +AMZN,2014-07-24,359.980011,364.850006,358.519989,358.609985,7088700,358.609985 +AMZN,2014-07-25,317.299988,324.869995,314.76001,324.01001,17846500,324.01001 +AMZN,2014-07-28,324.25,324.820007,316.5,320.410004,5932000,320.410004 +AMZN,2014-07-29,321.980011,322.899994,319.5,320,2883800,320 +AMZN,2014-07-30,321.450012,322.730011,318.5,322.51001,3969000,322.51001 +AMZN,2014-07-31,320.01001,320.679993,311.859985,312.98999,5192000,312.98999 +AMZN,2014-08-01,313.690002,315.829987,304.589996,307.059998,7441500,307.059998 +AMZN,2014-08-04,308.839996,316.179993,308.5,313.649994,4200900,313.649994 +AMZN,2014-08-05,313.299988,314.549988,310.059998,312.320007,2852100,312.320007 +AMZN,2014-08-06,310.829987,315.779999,310.200012,313.890015,2296900,313.890015 +AMZN,2014-08-07,315.209991,315.880005,309.649994,311.450012,2935600,311.450012 +AMZN,2014-08-08,311.940002,317.320007,310.660004,316.799988,2705900,316.799988 +AMZN,2014-08-11,318.480011,320.380005,316.880005,318.329987,2468600,318.329987 +AMZN,2014-08-12,318.890015,321.309998,316.950012,319.320007,1915800,319.320007 +AMZN,2014-08-13,327.600006,331.720001,326.140015,326.279999,4939100,326.279999 +AMZN,2014-08-14,327.799988,334.089996,326.709991,333.209991,3420400,333.209991 +AMZN,2014-08-15,334,335,328.320007,333.630005,3896700,333.630005 +AMZN,2014-08-18,335.480011,337.799988,333.769989,334.529999,2485400,334.529999 +AMZN,2014-08-19,334.869995,335.809998,333.01001,335.130005,1713800,335.130005 +AMZN,2014-08-20,334.679993,337.160004,334.019989,335.779999,1810500,335.779999 +AMZN,2014-08-21,336.480011,336.579987,332.230011,332.910004,1971100,332.910004 +AMZN,2014-08-22,332.98999,334.079987,330.799988,331.589996,2211200,331.589996 +AMZN,2014-08-25,333.209991,336.769989,332.709991,334.019989,1957700,334.019989 +AMZN,2014-08-26,337,344.359985,334.549988,341.829987,3654700,341.829987 +AMZN,2014-08-27,342.089996,346.670013,341.339996,343.179993,2961600,343.179993 +AMZN,2014-08-28,340,341.790009,338.799988,340.019989,2252700,340.019989 +AMZN,2014-08-29,341.76001,341.820007,337.679993,339.040009,1939500,339.040009 +AMZN,2014-09-02,339.980011,342.5,337.160004,342.380005,2326000,342.380005 +AMZN,2014-09-03,342.540009,343.269989,337.549988,339,1993700,339 +AMZN,2014-09-04,343.690002,349.380005,343.579987,345.950012,3965600,345.950012 +AMZN,2014-09-05,346.299988,346.829987,342.5,346.380005,2107000,346.380005 +AMZN,2014-09-08,344.540009,345.809998,339.040009,342.339996,2955300,342.339996 +AMZN,2014-09-09,341.609985,341.76001,329.179993,329.75,4646800,329.75 +AMZN,2014-09-10,334.299988,334.980011,328.820007,331.329987,3797400,331.329987 +AMZN,2014-09-11,329.940002,333.01001,326.390015,330.519989,2720200,330.519989 +AMZN,2014-09-12,329.559998,332.890015,328.790009,331.190002,3429300,331.190002 +AMZN,2014-09-15,330.910004,331.329987,319,323.890015,4000400,323.890015 +AMZN,2014-09-16,321.070007,329.480011,320.100006,327.76001,3259900,327.76001 +AMZN,2014-09-17,327.76001,328,321.519989,324,4136000,324 +AMZN,2014-09-18,325.440002,327.100006,323.709991,325,2576900,325 +AMZN,2014-09-19,327.600006,332.76001,325.570007,331.320007,6886200,331.320007 +AMZN,2014-09-22,328.48999,329.48999,321.059998,324.5,3109700,324.5 +AMZN,2014-09-23,322.459991,327.600006,321.25,323.630005,2352600,323.630005 +AMZN,2014-09-24,324.170013,329.440002,319.559998,328.209991,2642200,328.209991 +AMZN,2014-09-25,327.98999,328.540009,321.399994,321.929993,2928800,321.929993 +AMZN,2014-09-26,320.600006,323.5,317.640015,323.209991,3638000,323.209991 +AMZN,2014-09-29,320.5,323.75,319,321.820007,1924600,321.820007 +AMZN,2014-09-30,321.359985,323.429993,318.51001,322.440002,2636200,322.440002 +AMZN,2014-10-01,322.040009,322.170013,315.549988,317.459991,3089100,317.459991 +AMZN,2014-10-02,316.920013,318.529999,311.309998,318.410004,3553900,318.410004 +AMZN,2014-10-03,320.359985,325.160004,319.529999,322.73999,3037400,322.73999 +AMZN,2014-10-06,323.5,324.130005,319.600006,322.200012,2290300,322.200012 +AMZN,2014-10-07,319.429993,322,316.670013,316.980011,2365400,316.980011 +AMZN,2014-10-08,316.579987,324.109985,314.140015,322.700012,3452800,322.700012 +AMZN,2014-10-09,321.48999,322.269989,314.519989,315.369995,3587900,315.369995 +AMZN,2014-10-10,314.019989,317.769989,311.380005,311.390015,3681900,311.390015 +AMZN,2014-10-13,309.869995,313.200012,303.470001,306.450012,4363900,306.450012 +AMZN,2014-10-14,308,312.23999,305.75,308.309998,3385800,308.309998 +AMZN,2014-10-15,304.350006,307.899994,299.100006,305.970001,5343900,305.970001 +AMZN,2014-10-16,293.829987,306.820007,293.829987,302.859985,4731300,302.859985 +AMZN,2014-10-17,307.149994,309.200012,302.720001,303.640015,4405100,303.640015 +AMZN,2014-10-20,302.950012,306.529999,302.019989,306.209991,3234500,306.209991 +AMZN,2014-10-21,309.899994,315.640015,307.070007,315.329987,3559300,315.329987 +AMZN,2014-10-22,315.429993,318.980011,312.640015,312.970001,3125900,312.970001 +AMZN,2014-10-23,313.399994,316.799988,311.399994,313.179993,9038200,313.179993 +AMZN,2014-10-24,284.399994,293.809998,284,287.059998,19801100,287.059998 +AMZN,2014-10-27,285.700012,290.420013,285.019989,289.970001,5950600,289.970001 +AMZN,2014-10-28,289.76001,298,289.76001,295.589996,5572600,295.589996 +AMZN,2014-10-29,299.109985,299.609985,293.070007,294.119995,4881900,294.119995 +AMZN,2014-10-30,293.980011,299.73999,292.359985,299.070007,4055200,299.070007 +AMZN,2014-10-31,305.149994,305.720001,301.5,305.459991,4550700,305.459991 +AMZN,2014-11-03,306.23999,308.01001,303.23999,305.720001,3242500,305.720001 +AMZN,2014-11-04,303.98999,304.25,300.170013,302.809998,3427400,302.809998 +AMZN,2014-11-05,303.01001,304,294.160004,296.519989,4674500,296.519989 +AMZN,2014-11-06,296.690002,297,292.290009,296.640015,3758100,296.640015 +AMZN,2014-11-07,297.820007,299.98999,296.290009,299.859985,2647400,299.859985 +AMZN,2014-11-10,300,305.799988,300,305.109985,2809100,305.109985 +AMZN,2014-11-11,305.940002,312.380005,303.649994,312.01001,3803600,312.01001 +AMZN,2014-11-12,310.75,312.579987,308.790009,311.51001,2183000,311.51001 +AMZN,2014-11-13,312,317.890015,311.51001,316.480011,3686400,316.480011 +AMZN,2014-11-14,317.119995,332.880005,316.399994,327.820007,8877800,327.820007 +AMZN,2014-11-17,326.440002,328,318.029999,323.049988,4784900,323.049988 +AMZN,2014-11-18,323.98999,329.559998,323.25,324.929993,3549500,324.929993 +AMZN,2014-11-19,327.25,328.399994,324.019989,326.540009,3281600,326.540009 +AMZN,2014-11-20,324,332.670013,323.329987,330.540009,3436700,330.540009 +AMZN,2014-11-21,335.420013,338.329987,331.470001,332.630005,4466600,332.630005 +AMZN,2014-11-24,334.779999,337.390015,333.600006,335.640015,2754200,335.640015 +AMZN,2014-11-25,335.269989,336.329987,331.279999,335.040009,2565000,335.040009 +AMZN,2014-11-26,333.779999,334.649994,331.75,333.570007,1983600,333.570007 +AMZN,2014-11-28,336.029999,341.26001,336.029999,338.640015,3051800,338.640015 +AMZN,2014-12-01,338.119995,340.640015,325.929993,326,4944900,326 +AMZN,2014-12-02,327.5,327.929993,323.25,326.309998,2790300,326.309998 +AMZN,2014-12-03,325.730011,326.769989,314.359985,316.5,5681000,316.5 +AMZN,2014-12-04,315.529999,318.589996,313.470001,316.929993,3290300,316.929993 +AMZN,2014-12-05,316.799988,316.929993,310.839996,312.630005,3265200,312.630005 +AMZN,2014-12-08,311.570007,316.559998,304.820007,306.640015,3639200,306.640015 +AMZN,2014-12-09,302.98999,313.640015,301.140015,312.5,4049500,312.5 +AMZN,2014-12-10,312,313.190002,304.679993,305.839996,3245900,305.839996 +AMZN,2014-12-11,307.890015,312.640015,306.01001,307.359985,3262900,307.359985 +AMZN,2014-12-12,303.98999,310.640015,303.01001,307.320007,3153500,307.320007 +AMZN,2014-12-15,308.869995,310.859985,302.149994,306.070007,3841600,306.070007 +AMZN,2014-12-16,304.350006,304.48999,295.01001,295.059998,6501300,295.059998 +AMZN,2014-12-17,296.369995,299.670013,293.029999,298.880005,4433500,298.880005 +AMZN,2014-12-18,304.01001,304.5,293.25,297.730011,7738100,297.730011 +AMZN,2014-12-19,296.910004,301.540009,295.519989,299.899994,8709100,299.899994 +AMZN,2014-12-22,301.940002,307.359985,301.940002,306.540009,4003800,306.540009 +AMZN,2014-12-23,306.980011,307.48999,303.25,306.290009,2713700,306.290009 +AMZN,2014-12-24,306.380005,307,302.880005,303.029999,1513800,303.029999 +AMZN,2014-12-26,305,310.779999,303.809998,309.089996,2893800,309.089996 +AMZN,2014-12-29,307.850006,314.269989,306.579987,312.040009,3009000,312.040009 +AMZN,2014-12-30,309.910004,313.940002,309.339996,310.299988,2093000,310.299988 +AMZN,2014-12-31,311.549988,312.980011,310.01001,310.350006,2048000,310.350006 +AMZN,2015-01-02,312.579987,314.75,306.959991,308.519989,2783200,308.519989 +AMZN,2015-01-05,307.01001,308.380005,300.850006,302.190002,2774200,302.190002 +AMZN,2015-01-06,302.23999,303,292.380005,295.290009,3519000,295.290009 +AMZN,2015-01-07,297.5,301.279999,295.329987,298.420013,2640300,298.420013 +AMZN,2015-01-08,300.320007,303.140015,296.109985,300.459991,3088400,300.459991 +AMZN,2015-01-09,301.480011,302.869995,296.679993,296.929993,2592400,296.929993 +AMZN,2015-01-12,297.559998,298.51001,289.279999,291.410004,3421400,291.410004 +AMZN,2015-01-13,297.480011,301.5,293.230011,294.73999,4136400,294.73999 +AMZN,2015-01-14,291.929993,295.910004,286.5,293.269989,5464600,293.269989 +AMZN,2015-01-15,294,296,286.820007,286.950012,4419200,286.950012 +AMZN,2015-01-16,286.279999,290.790009,285.25,290.73999,3478200,290.73999 +AMZN,2015-01-20,292.589996,293.359985,286.390015,289.440002,3075100,289.440002 +AMZN,2015-01-21,289.640015,306,287.26001,297.25,10065100,297.25 +AMZN,2015-01-22,300,312.25,300,310.320007,5362600,310.320007 +AMZN,2015-01-23,308.079987,316.929993,307.720001,312.390015,4496400,312.390015 +AMZN,2015-01-26,311.820007,313,307.519989,309.660004,3169700,309.660004 +AMZN,2015-01-27,306.299988,310.23999,302.630005,306.75,2920300,306.75 +AMZN,2015-01-28,309.809998,311.51001,303.799988,303.910004,3063800,303.910004 +AMZN,2015-01-29,304.730011,312.799988,299.329987,311.779999,8656600,311.779999 +AMZN,2015-01-30,346.320007,359.5,340.73999,354.529999,23856100,354.529999 +AMZN,2015-02-02,350.049988,365,350.01001,364.470001,10231900,364.470001 +AMZN,2015-02-03,360.290009,367.820007,360.209991,363.549988,6212600,363.549988 +AMZN,2015-02-04,358.380005,367.5,358.230011,364.75,4169900,364.75 +AMZN,2015-02-05,366,378.799988,365.899994,373.890015,7247600,373.890015 +AMZN,2015-02-06,374.869995,375.98999,371.01001,374.279999,3892400,374.279999 +AMZN,2015-02-09,371,374.410004,367.200012,370.559998,2724600,370.559998 +AMZN,2015-02-10,371.190002,374.299988,368.51001,373,2287200,373 +AMZN,2015-02-11,371.230011,377.100006,371.100006,375.140015,2786500,375.140015 +AMZN,2015-02-12,375.100006,378.51001,373.149994,377.170013,2791100,377.170013 +AMZN,2015-02-13,378.410004,383,377.01001,381.829987,3475100,381.829987 +AMZN,2015-02-17,377.720001,379.98999,372.670013,375.429993,3673200,375.429993 +AMZN,2015-02-18,373.779999,376.73999,372.850006,373.369995,2650600,373.369995 +AMZN,2015-02-19,373.48999,381.880005,373.429993,379,2953800,379 +AMZN,2015-02-20,378.619995,383.700012,375.839996,383.660004,3258000,383.660004 +AMZN,2015-02-23,383.440002,384.540009,378,380.140015,2177000,380.140015 +AMZN,2015-02-24,378.649994,380.480011,376.160004,378.589996,1920800,378.589996 +AMZN,2015-02-25,377.269989,387.850006,376.540009,385.369995,3174500,385.369995 +AMZN,2015-02-26,384.070007,389.369995,383.279999,384.799988,2687100,384.799988 +AMZN,2015-02-27,384,385.98999,379.790009,380.160004,2532300,380.160004 +AMZN,2015-03-02,380.850006,385.899994,379.480011,385.660004,2139200,385.660004 +AMZN,2015-03-03,383.950012,386.100006,381.600006,384.609985,1946500,384.609985 +AMZN,2015-03-04,385.709991,387.899994,382.190002,382.720001,2259100,382.720001 +AMZN,2015-03-05,385.609985,388.420013,383.890015,387.829987,2693500,387.829987 +AMZN,2015-03-06,385.519989,387,378.880005,380.089996,2627000,380.089996 +AMZN,2015-03-09,378.399994,379.329987,375.279999,378.559998,2311400,378.559998 +AMZN,2015-03-10,377.450012,377.769989,369.179993,369.51001,3121000,369.51001 +AMZN,2015-03-11,370.609985,373.350006,366.26001,366.369995,2495100,366.369995 +AMZN,2015-03-12,368.820007,375.5,367.519989,374.23999,2810000,374.23999 +AMZN,2015-03-13,371.519989,373.98999,366.679993,370.579987,2611700,370.579987 +AMZN,2015-03-16,370.380005,373.940002,366.720001,373.350006,2354100,373.350006 +AMZN,2015-03-17,371.109985,374.5,369.640015,371.920013,2037000,371.920013 +AMZN,2015-03-18,369.970001,375.98999,366.700012,375.140015,2654100,375.140015 +AMZN,2015-03-19,373.869995,377.109985,372.190002,373.23999,1915700,373.23999 +AMZN,2015-03-20,376.290009,379.369995,375.920013,378.48999,3763600,378.48999 +AMZN,2015-03-23,378.070007,381.769989,374.940002,375.109985,2239300,375.109985 +AMZN,2015-03-24,373.98999,375.23999,372.269989,374.089996,2228200,374.089996 +AMZN,2015-03-25,375.170013,380.5,370.290009,370.959991,3429500,370.959991 +AMZN,2015-03-26,369.589996,371.399994,365.649994,367.350006,2930000,367.350006 +AMZN,2015-03-27,367.109985,373.170013,366.570007,370.559998,2609800,370.559998 +AMZN,2015-03-30,371.869995,376.119995,371.549988,374.589996,1820900,374.589996 +AMZN,2015-03-31,373.23999,377.700012,371.51001,372.100006,2506100,372.100006 +AMZN,2015-04-01,372.100006,373.160004,368.339996,370.26001,2458100,370.26001 +AMZN,2015-04-02,370.5,373.279999,369,372.25,1875300,372.25 +AMZN,2015-04-06,370.100006,380.200012,369.359985,377.040009,3050700,377.040009 +AMZN,2015-04-07,376.149994,379.309998,374.029999,374.410004,1954900,374.410004 +AMZN,2015-04-08,374.660004,381.579987,374.649994,381.200012,2636400,381.200012 +AMZN,2015-04-09,380.660004,384.420013,378.799988,383.540009,2392300,383.540009 +AMZN,2015-04-10,384.309998,387.119995,381.320007,382.649994,2573500,382.649994 +AMZN,2015-04-13,383.529999,385.279999,380.140015,382.359985,1894500,382.359985 +AMZN,2015-04-14,383.51001,387.809998,381.209991,385.109985,2583600,385.109985 +AMZN,2015-04-15,384.649994,385.779999,381.640015,383.450012,1933200,383.450012 +AMZN,2015-04-16,383.690002,387.450012,383.549988,386.040009,2080400,386.040009 +AMZN,2015-04-17,382.630005,383.559998,374.399994,375.559998,3839700,375.559998 +AMZN,2015-04-20,378.549988,391.940002,377,389.51001,5016100,389.51001 +AMZN,2015-04-21,391.309998,394.600006,386.799988,391.179993,4643500,391.179993 +AMZN,2015-04-22,391.910004,394.279999,388,389.799988,3474700,389.799988 +AMZN,2015-04-23,390.209991,391.880005,386.149994,389.98999,7980000,389.98999 +AMZN,2015-04-24,439,452.649994,439,445.100006,17176900,445.100006 +AMZN,2015-04-27,443.859985,446.98999,437.410004,438.559998,5430900,438.559998 +AMZN,2015-04-28,438.51001,439,428.040009,429.309998,4140500,429.309998 +AMZN,2015-04-29,426.75,434.23999,426.029999,429.369995,3621700,429.369995 +AMZN,2015-04-30,427.109985,431.75,419.23999,421.779999,3647900,421.779999 +AMZN,2015-05-01,423.820007,425.640015,416,422.869995,3565800,422.869995 +AMZN,2015-05-04,424.799988,429.769989,422.420013,423.040009,2270400,423.040009 +AMZN,2015-05-05,422.850006,427.51001,421.019989,421.190002,2856400,421.190002 +AMZN,2015-05-06,421.429993,422.720001,414.549988,419.100006,2552500,419.100006 +AMZN,2015-05-07,424.149994,428.5,422.850006,426.880005,2766100,426.880005 +AMZN,2015-05-08,430.75,435.200012,430.170013,433.690002,2908800,433.690002 +AMZN,2015-05-11,432.51001,439,431.369995,432.850006,2393700,432.850006 +AMZN,2015-05-12,431.079987,433.25,426.709991,431.019989,1947800,431.019989 +AMZN,2015-05-13,429.980011,433.529999,425.799988,426.869995,1996300,426.869995 +AMZN,2015-05-14,429.450012,433,427.01001,432.279999,1888500,432.279999 +AMZN,2015-05-15,428,430.399994,424.299988,426,4240300,426 +AMZN,2015-05-18,426,427.269989,421.459991,425.23999,2390200,425.23999 +AMZN,2015-05-19,424.869995,428.23999,420.630005,421.709991,2464200,421.709991 +AMZN,2015-05-20,420.600006,427.100006,418.359985,423.859985,2196200,423.859985 +AMZN,2015-05-21,428,436.899994,428,431.630005,4121400,431.630005 +AMZN,2015-05-22,431.549988,432.440002,427.609985,427.630005,2020600,427.630005 +AMZN,2015-05-26,426.200012,427,422,425.470001,2244200,425.470001 +AMZN,2015-05-27,427.450012,431.850006,425.01001,431.420013,2231100,431.420013 +AMZN,2015-05-28,429.709991,431.350006,425.470001,426.570007,1912400,426.570007 +AMZN,2015-05-29,427.230011,432.5,427.230011,429.230011,3016100,429.230011 +AMZN,2015-06-01,430.399994,433.160004,426.200012,430.920013,2253300,430.920013 +AMZN,2015-06-02,430.070007,433.230011,426.25,430.98999,1668900,430.98999 +AMZN,2015-06-03,434.399994,438.390015,432.75,436.589996,2720800,436.589996 +AMZN,2015-06-04,434.399994,436.76001,429.26001,430.779999,2510800,430.779999 +AMZN,2015-06-05,429.660004,430.799988,426.5,426.950012,1907900,426.950012 +AMZN,2015-06-08,425.619995,426.799988,421.429993,423.5,2172500,423.5 +AMZN,2015-06-09,422.959991,427.48999,419.140015,425.480011,2288700,425.480011 +AMZN,2015-06-10,426.459991,432.200012,425.660004,430.769989,2172300,430.769989 +AMZN,2015-06-11,432.290009,438.890015,431.470001,432.970001,2922500,432.970001 +AMZN,2015-06-12,431.25,432.359985,428.26001,429.920013,2054400,429.920013 +AMZN,2015-06-15,427.660004,428.049988,422.640015,423.670013,2051000,423.670013 +AMZN,2015-06-16,424.149994,427.970001,422.670013,427.26001,2296400,427.26001 +AMZN,2015-06-17,428.359985,431.350006,424.75,427.809998,2185900,427.809998 +AMZN,2015-06-18,430.299988,439.730011,429.410004,439.390015,3378400,439.390015 +AMZN,2015-06-19,440.26001,444.98999,433.23999,434.920013,4495100,434.920013 +AMZN,2015-06-22,437,439.23999,434.179993,436.290009,1823600,436.290009 +AMZN,2015-06-23,435.589996,447.040009,433.690002,445.98999,3245000,445.98999 +AMZN,2015-06-24,444.970001,446.470001,440.230011,440.839996,2620800,440.839996 +AMZN,2015-06-25,438.070007,443.470001,436.390015,440.100006,2237500,440.100006 +AMZN,2015-06-26,441.76001,443.48999,435.059998,438.100006,2624500,438.100006 +AMZN,2015-06-29,434.980011,437,429,429.859985,2753200,429.859985 +AMZN,2015-06-30,434.200012,435.570007,430.459991,434.089996,2596900,434.089996 +AMZN,2015-07-01,439.350006,440,435.579987,437.390015,1987100,437.390015 +AMZN,2015-07-02,437,438.200012,433.480011,437.709991,1343400,437.709991 +AMZN,2015-07-06,435.230011,439.730011,433.519989,436.040009,1903200,436.040009 +AMZN,2015-07-07,435.679993,437.730011,425.570007,436.720001,3454200,436.720001 +AMZN,2015-07-08,434.350006,435.98999,428.829987,429.700012,2383100,429.700012 +AMZN,2015-07-09,434.899994,438.720001,434.149994,434.390015,2262900,434.390015 +AMZN,2015-07-10,440.48999,444.720001,439,443.51001,2401000,443.51001 +AMZN,2015-07-13,448.290009,457.869995,447.540009,455.570007,3956800,455.570007 +AMZN,2015-07-14,462.320007,469.600006,458.160004,465.570007,4736200,465.570007 +AMZN,2015-07-15,463.040009,464.700012,460.200012,461.190002,2987400,461.190002 +AMZN,2015-07-16,465.5,475.880005,464.799988,475.480011,4095600,475.480011 +AMZN,2015-07-17,477.700012,485.420013,477.25,483.01001,4932200,483.01001 +AMZN,2015-07-20,492.570007,493.200012,485.399994,488.100006,4752500,488.100006 +AMZN,2015-07-21,487.899994,488.880005,482.549988,488,3181800,488 +AMZN,2015-07-22,485.98999,492.5,484.899994,488.269989,3114900,488.269989 +AMZN,2015-07-23,491.660004,491.660004,475.700012,482.179993,9374400,482.179993 +AMZN,2015-07-24,578.98999,580.570007,529.349976,529.419983,21909400,529.419983 +AMZN,2015-07-27,527.75,544.950012,526.599976,531.409973,7491000,531.409973 +AMZN,2015-07-28,536,536.390015,523.119995,526.030029,5273100,526.030029 +AMZN,2015-07-29,530.919983,532.969971,525.02002,529,3752600,529 +AMZN,2015-07-30,527.650024,539.200012,524.289978,536.76001,3743100,536.76001 +AMZN,2015-07-31,539.090027,542.840027,534.52002,536.150024,3025600,536.150024 +AMZN,2015-08-03,537.450012,540.440002,529.359985,535.030029,3014200,535.030029 +AMZN,2015-08-04,529.690002,536.950012,529.159973,531.900024,2934600,531.900024 +AMZN,2015-08-05,538.799988,539.140015,534.119995,537.01001,2889400,537.01001 +AMZN,2015-08-06,539.299988,542.73999,527.52002,529.460022,3820500,529.460022 +AMZN,2015-08-07,529.159973,529.460022,518.210022,522.619995,3969200,522.619995 +AMZN,2015-08-10,528.52002,532.280029,523,524,2615900,524 +AMZN,2015-08-11,523.650024,528.97998,522,527.460022,2676600,527.460022 +AMZN,2015-08-12,523.75,527.5,513.059998,525.909973,3962300,525.909973 +AMZN,2015-08-13,527.369995,534.659973,525.48999,529.659973,2895200,529.659973 +AMZN,2015-08-14,528.25,534.109985,528.25,531.52002,1994800,531.52002 +AMZN,2015-08-17,531.289978,538.73999,527.119995,535.219971,2581700,535.219971 +AMZN,2015-08-18,535.039978,539.48999,533,535.02002,2071300,535.02002 +AMZN,2015-08-19,533.73999,537.25,529,532.919983,2313500,532.919983 +AMZN,2015-08-20,530.390015,533.25,515.77002,515.780029,4408000,515.780029 +AMZN,2015-08-21,507.359985,512.330017,494.470001,494.470001,6706500,494.470001 +AMZN,2015-08-24,463.579987,476.579987,451,463.369995,10097600,463.369995 +AMZN,2015-08-25,487.48999,489.440002,466.25,466.369995,5679300,466.369995 +AMZN,2015-08-26,484.019989,503.720001,478.76001,500.769989,6358600,500.769989 +AMZN,2015-08-27,513.710022,522.690002,507.26001,518.369995,6114500,518.369995 +AMZN,2015-08-28,517.5,521.5,513.039978,518.01001,2746700,518.01001 +AMZN,2015-08-31,516.440002,519.409973,509.070007,512.890015,3002300,512.890015 +AMZN,2015-09-01,499.140015,510,493.429993,496.540009,3864500,496.540009 +AMZN,2015-09-02,505.089996,510.859985,497.720001,510.549988,3707100,510.549988 +AMZN,2015-09-03,514.5,515.840027,502.570007,504.720001,3149700,504.720001 +AMZN,2015-09-04,497.649994,502.850006,495.640015,499,2692500,499 +AMZN,2015-09-08,508.690002,518.349976,508.51001,517.539978,3810700,517.539978 +AMZN,2015-09-09,524,529.950012,515.059998,516.890015,4370700,516.890015 +AMZN,2015-09-10,515.150024,526.130005,514.780029,522.23999,2576000,522.23999 +AMZN,2015-09-11,521.070007,529.440002,520.609985,529.440002,3227900,529.440002 +AMZN,2015-09-14,529.440002,532.450012,518.580017,521.380005,3130200,521.380005 +AMZN,2015-09-15,523.25,527.919983,517.200012,522.369995,2865900,522.369995 +AMZN,2015-09-16,521.97998,528.299988,518.52002,527.390015,2252800,527.390015 +AMZN,2015-09-17,526.97998,546.969971,526.570007,538.869995,4169500,538.869995 +AMZN,2015-09-18,534.619995,546.23999,531.349976,540.26001,6160100,540.26001 +AMZN,2015-09-21,544.330017,549.780029,539.590027,548.390015,3283300,548.390015 +AMZN,2015-09-22,539.710022,543.549988,532.659973,538.400024,3841700,538.400024 +AMZN,2015-09-23,538.299988,541.210022,534,536.070007,2237600,536.070007 +AMZN,2015-09-24,530.549988,534.559998,522.869995,533.75,3501000,533.75 +AMZN,2015-09-25,542.570007,542.799988,521.400024,524.25,4031000,524.25 +AMZN,2015-09-28,520.02002,520.280029,494.329987,504.059998,5434500,504.059998 +AMZN,2015-09-29,506,511.480011,490.5,496.070007,4457500,496.070007 +AMZN,2015-09-30,505.440002,512.799988,501.670013,511.890015,4004700,511.890015 +AMZN,2015-10-01,511,520.799988,506,520.719971,3768500,520.719971 +AMZN,2015-10-02,512.98999,532.599976,508.100006,532.539978,4597800,532.539978 +AMZN,2015-10-05,536.98999,545.909973,536,543.679993,3391400,543.679993 +AMZN,2015-10-06,545.5,551.5,533.330017,537.47998,4502800,537.47998 +AMZN,2015-10-07,541.789978,542,529,541.940002,3812100,541.940002 +AMZN,2015-10-08,536.710022,539.390015,519.890015,533.159973,4676400,533.159973 +AMZN,2015-10-09,534.47998,541.789978,530.27002,539.799988,3537400,539.799988 +AMZN,2015-10-12,539.960022,550.820007,539.799988,550.190002,2776100,550.190002 +AMZN,2015-10-13,546.26001,553.200012,543.099976,548.900024,2938000,548.900024 +AMZN,2015-10-14,551.340027,552.25,539.679993,544.830017,3582100,544.830017 +AMZN,2015-10-15,547.75,563,547,562.440002,4937000,562.440002 +AMZN,2015-10-16,565.27002,570.940002,560.309998,570.76001,4315800,570.76001 +AMZN,2015-10-19,570.76001,579,567.380005,573.150024,4375400,573.150024 +AMZN,2015-10-20,572,573,555.280029,560.880005,4327900,560.880005 +AMZN,2015-10-21,563.869995,565.25,552.52002,555.77002,3343600,555.77002 +AMZN,2015-10-22,562.700012,569.150024,556.669983,563.909973,7779400,563.909973 +AMZN,2015-10-23,617.679993,619.450012,595.359985,599.030029,10692700,599.030029 +AMZN,2015-10-26,602.299988,609.849976,596.289978,608.609985,4269700,608.609985 +AMZN,2015-10-27,608.599976,614.710022,605.530029,611.01001,3787100,611.01001 +AMZN,2015-10-28,612.299988,617.22998,609.5,617.099976,3926200,617.099976 +AMZN,2015-10-29,617.700012,627.539978,615.390015,626.549988,3896000,626.549988 +AMZN,2015-10-30,626.01001,630.719971,625.280029,625.900024,3874400,625.900024 +AMZN,2015-11-02,627.130005,628.630005,620.409973,628.349976,2816500,628.349976 +AMZN,2015-11-03,629.530029,629.890015,622,625.309998,3246900,625.309998 +AMZN,2015-11-04,627.76001,645.929993,627.349976,640.950012,4840500,640.950012 +AMZN,2015-11-05,647.099976,657,643.090027,655.650024,4723800,655.650024 +AMZN,2015-11-06,655,662.26001,652,659.369995,4092200,659.369995 +AMZN,2015-11-09,658.650024,661.960022,647.849976,655.48999,4048800,655.48999 +AMZN,2015-11-10,651.01001,660,647.26001,659.679993,3489500,659.679993 +AMZN,2015-11-11,663.25,675.960022,663.25,673.25,5387300,673.25 +AMZN,2015-11-12,673,675.640015,664.219971,665.599976,4284700,665.599976 +AMZN,2015-11-13,663.570007,667,640.450012,642.349976,6261100,642.349976 +AMZN,2015-11-16,640.919983,649.98999,622.289978,647.809998,7435900,647.809998 +AMZN,2015-11-17,650.650024,653.25,641,643.299988,4320200,643.299988 +AMZN,2015-11-18,646.51001,664.880005,646.369995,663.539978,4469800,663.539978 +AMZN,2015-11-19,664.98999,672.859985,659,661.27002,4705200,661.27002 +AMZN,2015-11-20,667.940002,668.869995,657.570007,668.450012,3896100,668.450012 +AMZN,2015-11-23,671.5,682.77002,670.119995,678.98999,4385100,678.98999 +AMZN,2015-11-24,674.140015,675.799988,661.210022,671.150024,4543400,671.150024 +AMZN,2015-11-25,675,679.700012,671.23999,675.340027,2697900,675.340027 +AMZN,2015-11-27,680.799988,680.98999,672.099976,673.26001,1966800,673.26001 +AMZN,2015-11-30,675.900024,681.289978,664.599976,664.799988,5693200,664.799988 +AMZN,2015-12-01,673.75,681,667.859985,679.059998,4751200,679.059998 +AMZN,2015-12-02,681,684.820007,674.25,676.01001,4273500,676.01001 +AMZN,2015-12-03,679.440002,682.789978,661.47998,666.25,5064700,666.25 +AMZN,2015-12-04,666,674.780029,661.400024,672.640015,4534800,672.640015 +AMZN,2015-12-07,674.73999,675.460022,660.5,669.830017,3732800,669.830017 +AMZN,2015-12-08,663.130005,679.98999,659.789978,677.330017,3651900,677.330017 +AMZN,2015-12-09,678,679,655.679993,664.789978,5158200,664.789978 +AMZN,2015-12-10,665.590027,668.530029,659.559998,662.320007,3440200,662.320007 +AMZN,2015-12-11,651.22998,657.880005,639.619995,640.150024,5474400,640.150024 +AMZN,2015-12-14,641.75,658.590027,635.27002,657.909973,4329700,657.909973 +AMZN,2015-12-15,665.030029,671.5,657.349976,658.640015,4753400,658.640015 +AMZN,2015-12-16,663.559998,677.349976,659.320007,675.77002,3964500,675.77002 +AMZN,2015-12-17,680,682.5,670.650024,670.650024,3681600,670.650024 +AMZN,2015-12-18,668.650024,676.840027,664.130005,664.140015,6841300,664.140015 +AMZN,2015-12-21,668.5,669.900024,658.929993,664.51001,3250900,664.51001 +AMZN,2015-12-22,666.830017,668.48999,659.26001,663.150024,2667800,663.150024 +AMZN,2015-12-23,666.5,666.599976,656.630005,663.700012,2722900,663.700012 +AMZN,2015-12-24,663.349976,664.679993,660.599976,662.789978,1091200,662.789978 +AMZN,2015-12-28,665.559998,675.5,665.5,675.200012,3783600,675.200012 +AMZN,2015-12-29,677.97998,696.440002,677.890015,693.969971,5735000,693.969971 +AMZN,2015-12-30,691.890015,695.48999,686.380005,689.070007,3519000,689.070007 +AMZN,2015-12-31,686.080017,687.75,675.890015,675.890015,3718200,675.890015 +AMZN,2016-01-04,656.289978,657.719971,627.51001,636.98999,9314500,636.98999 +AMZN,2016-01-05,646.859985,646.909973,627.650024,633.789978,5822600,633.789978 +AMZN,2016-01-06,622,639.789978,620.309998,632.650024,5329200,632.650024 +AMZN,2016-01-07,621.799988,630,605.210022,607.940002,7074900,607.940002 +AMZN,2016-01-08,619.659973,624.140015,606,607.049988,5512900,607.049988 +AMZN,2016-01-11,612.47998,619.849976,598.570007,617.73999,4891600,617.73999 +AMZN,2016-01-12,625.25,625.98999,612.23999,617.890015,4724100,617.890015 +AMZN,2016-01-13,620.880005,620.880005,579.159973,581.809998,7655200,581.809998 +AMZN,2016-01-14,580.25,602.25,569.880005,593,7238000,593 +AMZN,2016-01-15,572.23999,584.619995,565.299988,570.179993,7754500,570.179993 +AMZN,2016-01-19,577.090027,584,566.450012,574.47998,4807200,574.47998 +AMZN,2016-01-20,564.359985,578.450012,547.179993,571.77002,7966400,571.77002 +AMZN,2016-01-21,573.580017,588.809998,568.219971,575.02002,4952200,575.02002 +AMZN,2016-01-22,588.72998,600.099976,584.109985,596.380005,5120100,596.380005 +AMZN,2016-01-25,597.98999,608.5,594.559998,596.530029,4396100,596.530029 +AMZN,2016-01-26,603.450012,604.5,590.380005,601.25,3765700,601.25 +AMZN,2016-01-27,601.98999,603.390015,578.780029,583.349976,5152900,583.349976 +AMZN,2016-01-28,608.369995,638.059998,597.549988,635.349976,14015200,635.349976 +AMZN,2016-01-29,571.97998,593,570,587,14677600,587 +AMZN,2016-02-01,578.150024,581.799988,570.309998,574.809998,6355100,574.809998 +AMZN,2016-02-02,570,571.559998,550.090027,552.099976,6312000,552.099976 +AMZN,2016-02-03,553.5,556,521.900024,531.070007,10048700,531.070007 +AMZN,2016-02-04,525,538.98999,519.219971,536.26001,6199100,536.26001 +AMZN,2016-02-05,529.280029,529.450012,499.190002,502.130005,9708900,502.130005 +AMZN,2016-02-08,486.470001,493.5,475.209991,488.100006,9825500,488.100006 +AMZN,2016-02-09,478.01001,498.380005,474,482.070007,7077900,482.070007 +AMZN,2016-02-10,491.76001,504.660004,486,490.480011,6786200,490.480011 +AMZN,2016-02-11,491.170013,509.299988,484,503.820007,7397400,503.820007 +AMZN,2016-02-12,510.700012,516.75,501.48999,507.079987,5384800,507.079987 +AMZN,2016-02-16,519.47998,524.450012,511.660004,521.099976,5118500,521.099976 +AMZN,2016-02-17,528.73999,537.47998,519.390015,534.099976,4824000,534.099976 +AMZN,2016-02-18,541.190002,541.200012,523.72998,525,4735000,525 +AMZN,2016-02-19,520.710022,535.950012,515.349976,534.900024,4974700,534.900024 +AMZN,2016-02-22,542.200012,560.650024,541.080017,559.5,5566600,559.5 +AMZN,2016-02-23,555.549988,556.909973,545.330017,552.940002,4050800,552.940002 +AMZN,2016-02-24,545.75,554.27002,533.150024,554.039978,6231700,554.039978 +AMZN,2016-02-25,555.52002,559.390015,545.289978,555.150024,4525500,555.150024 +AMZN,2016-02-26,560.119995,562.5,553.169983,555.22998,4877000,555.22998 +AMZN,2016-02-29,554,564.809998,552.51001,552.52002,4145400,552.52002 +AMZN,2016-03-01,556.289978,579.25,556,579.039978,5038500,579.039978 +AMZN,2016-03-02,581.75,585,573.700012,580.210022,4582200,580.210022 +AMZN,2016-03-03,577.960022,579.869995,573.109985,577.48999,2741300,577.48999 +AMZN,2016-03-04,581.070007,581.400024,571.070007,575.140015,3416500,575.140015 +AMZN,2016-03-07,573.539978,573.630005,555.549988,562.799988,4926900,562.799988 +AMZN,2016-03-08,557.869995,571.349976,554.73999,560.26001,4730000,560.26001 +AMZN,2016-03-09,559.559998,560.349976,550.130005,559.469971,4377300,559.469971 +AMZN,2016-03-10,566.73999,567,547.900024,558.929993,3919900,558.929993 +AMZN,2016-03-11,566.950012,570.059998,562.72998,569.609985,3771300,569.609985 +AMZN,2016-03-14,567,576.890015,563.049988,573.369995,3454200,573.369995 +AMZN,2016-03-15,571,581.52002,567,577.02002,3876800,577.02002 +AMZN,2016-03-16,576.640015,581.320007,571.140015,574.27002,3537700,574.27002 +AMZN,2016-03-17,569.51001,571.400024,555.01001,559.440002,5928100,559.440002 +AMZN,2016-03-18,560.940002,562.330017,546.090027,552.080017,7296900,552.080017 +AMZN,2016-03-21,548.909973,555.23999,538.580017,553.97998,5155700,553.97998 +AMZN,2016-03-22,545.109985,562.76001,545.049988,560.47998,4000600,560.47998 +AMZN,2016-03-23,561,572.47998,558.099976,569.630005,3983700,569.630005 +AMZN,2016-03-24,567.109985,583.549988,567.080017,582.950012,5185500,582.950012 +AMZN,2016-03-28,584.400024,584.75,575.559998,579.869995,3121500,579.869995 +AMZN,2016-03-29,580.150024,595.849976,576.5,593.859985,4392600,593.859985 +AMZN,2016-03-30,596.710022,603.23999,595,598.690002,3890500,598.690002 +AMZN,2016-03-31,599.280029,600.75,592.210022,593.640015,2681800,593.640015 +AMZN,2016-04-01,590.48999,599.030029,588.299988,598.5,2917400,598.5 +AMZN,2016-04-04,599,599.5,590.549988,593.190002,2470800,593.190002 +AMZN,2016-04-05,590.77002,593.469971,585.25,586.140015,2308900,586.140015 +AMZN,2016-04-06,587.52002,602.390015,587.5,602.080017,2849900,602.080017 +AMZN,2016-04-07,598.76001,599.599976,589.080017,591.429993,3189000,591.429993 +AMZN,2016-04-08,594.320007,597.859985,589,594.599976,2591900,594.599976 +AMZN,2016-04-11,596.140015,604,594.909973,595.929993,2704300,595.929993 +AMZN,2016-04-12,598.400024,604.059998,592.309998,603.169983,2641100,603.169983 +AMZN,2016-04-13,607.679993,616.809998,605.289978,614.820007,4228300,614.820007 +AMZN,2016-04-14,615.070007,624.380005,615.070007,620.75,3512100,620.75 +AMZN,2016-04-15,621.919983,626.77002,618.109985,625.890015,2887700,625.890015 +AMZN,2016-04-18,625.349976,637.640015,624.960022,635.349976,4336400,635.349976 +AMZN,2016-04-19,637.140015,638.01001,620.799988,627.900024,4055900,627.900024 +AMZN,2016-04-20,630,636.549988,623,632.98999,2609400,632.98999 +AMZN,2016-04-21,631,637.820007,628.5,631,2596300,631 +AMZN,2016-04-22,624.469971,628.25,611.559998,620.5,5083900,620.5 +AMZN,2016-04-25,616.609985,626.97998,616.25,626.200012,2682900,626.200012 +AMZN,2016-04-26,626.169983,626.75,614.880005,616.880005,2521400,616.880005 +AMZN,2016-04-27,611.799988,615.950012,601.280029,606.570007,4068800,606.570007 +AMZN,2016-04-28,615.539978,626.799988,599.200012,602,7872600,602 +AMZN,2016-04-29,666,669.97998,654,659.590027,10310700,659.590027 +AMZN,2016-05-02,663.919983,685.5,662.030029,683.849976,6578500,683.849976 +AMZN,2016-05-03,677.359985,680.299988,670.429993,671.320007,4923400,671.320007 +AMZN,2016-05-04,662.590027,674,662.140015,670.900024,4635500,670.900024 +AMZN,2016-05-05,673.309998,676.48999,656,659.090027,4884100,659.090027 +AMZN,2016-05-06,656.049988,676.950012,656.01001,673.950012,4347200,673.950012 +AMZN,2016-05-09,673.950012,686.97998,671.409973,679.75,3982200,679.75 +AMZN,2016-05-10,694,704.549988,693.5,703.070007,6105600,703.070007 +AMZN,2016-05-11,705.789978,719,701.650024,713.22998,7338200,713.22998 +AMZN,2016-05-12,717.380005,722.450012,711.51001,717.929993,5048200,717.929993 +AMZN,2016-05-13,714.640015,719.25,706.51001,709.919983,4763400,709.919983 +AMZN,2016-05-16,710.130005,713.25,700.280029,710.659973,5432900,710.659973 +AMZN,2016-05-17,709.900024,714.469971,693.909973,695.27002,5121400,695.27002 +AMZN,2016-05-18,689.559998,702.539978,688.76001,697.450012,4283200,697.450012 +AMZN,2016-05-19,691.880005,699.400024,689.559998,698.52002,3025600,698.52002 +AMZN,2016-05-20,701.049988,707.23999,700,702.799988,2916200,702.799988 +AMZN,2016-05-23,704.25,706,696.419983,696.75,2595100,696.75 +AMZN,2016-05-24,698.01001,707.5,698,704.200012,3033800,704.200012 +AMZN,2016-05-25,708,710.859985,705.52002,708.349976,3267700,708.349976 +AMZN,2016-05-26,708.330017,715,707.289978,714.909973,2446700,714.909973 +AMZN,2016-05-27,715,716.599976,711.099976,712.23999,2246400,712.23999 +AMZN,2016-05-31,712.330017,724.22998,711.320007,722.789978,3618300,722.789978 +AMZN,2016-06-01,720.900024,726.429993,718.219971,719.440002,3263100,719.440002 +AMZN,2016-06-02,720.969971,728.280029,715.5,728.23999,3026600,728.23999 +AMZN,2016-06-03,726.73999,727,718.429993,725.539978,3367300,725.539978 +AMZN,2016-06-06,726.5,731.5,724.419983,726.72998,2704800,726.72998 +AMZN,2016-06-07,729.890015,730,720.549988,723.73999,2732500,723.73999 +AMZN,2016-06-08,726.400024,729.419983,721.599976,726.640015,2223400,726.640015 +AMZN,2016-06-09,723.099976,728.909973,722.299988,727.650024,2170300,727.650024 +AMZN,2016-06-10,722.349976,724.97998,714.210022,717.909973,3425700,717.909973 +AMZN,2016-06-13,714.01001,721.98999,711.159973,715.23999,3352200,715.23999 +AMZN,2016-06-14,712.330017,720.809998,712.27002,719.299988,2506900,719.299988 +AMZN,2016-06-15,722,722.559998,713.349976,714.26001,2709400,714.26001 +AMZN,2016-06-16,712.049988,718,705.299988,717.51001,3098000,717.51001 +AMZN,2016-06-17,718.190002,718.200012,699.179993,706.390015,5897800,706.390015 +AMZN,2016-06-20,713.5,721.309998,710.809998,714.01001,3677200,714.01001 +AMZN,2016-06-21,715.719971,718.400024,712.719971,715.820007,2137500,715.820007 +AMZN,2016-06-22,716.580017,717,707.570007,710.599976,2260500,710.599976 +AMZN,2016-06-23,715.5,722.119995,712.5,722.080017,2825000,722.080017 +AMZN,2016-06-24,693,712.530029,692.200012,698.960022,7632500,698.960022 +AMZN,2016-06-27,692.01001,696.820007,682.119995,691.359985,5568000,691.359985 +AMZN,2016-06-28,700,708,698.169983,707.950012,4037000,707.950012 +AMZN,2016-06-29,715.75,719.5,713.539978,715.599976,3070100,715.599976 +AMZN,2016-06-30,717.200012,719.369995,712.539978,715.619995,2855100,715.619995 +AMZN,2016-07-01,717.320007,728,716.539978,725.679993,2920400,725.679993 +AMZN,2016-07-05,722.799988,729.559998,719.609985,728.099976,2431400,728.099976 +AMZN,2016-07-06,725.710022,737.77002,722.580017,737.609985,3938200,737.609985 +AMZN,2016-07-07,739.330017,739.549988,731.630005,736.570007,2945800,736.570007 +AMZN,2016-07-08,740.140015,746.099976,738,745.809998,3429200,745.809998 +AMZN,2016-07-11,750,755.900024,747,753.780029,3195300,753.780029 +AMZN,2016-07-12,756.859985,757.340027,740.330017,748.210022,5623700,748.210022 +AMZN,2016-07-13,746.76001,756.869995,741.25,742.630005,4142300,742.630005 +AMZN,2016-07-14,748.859985,749.039978,739.02002,741.200012,2390500,741.200012 +AMZN,2016-07-15,746.549988,746.549988,734.049988,735.440002,3121400,735.440002 +AMZN,2016-07-18,735.48999,741.599976,728.719971,736.070007,2954900,736.070007 +AMZN,2016-07-19,732.5,743.330017,732.309998,739.950012,2216800,739.950012 +AMZN,2016-07-20,744,746.25,740.700012,745.719971,2214000,745.719971 +AMZN,2016-07-21,747.5,749.359985,742.789978,744.429993,2317100,744.429993 +AMZN,2016-07-22,747.789978,751.280029,743.530029,744.859985,2277700,744.859985 +AMZN,2016-07-25,746.549988,748.5,735.349976,739.609985,2679300,739.609985 +AMZN,2016-07-26,742.710022,743.130005,732.75,735.590027,2529700,735.590027 +AMZN,2016-07-27,737.969971,740.940002,733.859985,736.669983,2913100,736.669983 +AMZN,2016-07-28,745.97998,753.359985,739.700012,752.609985,7617600,752.609985 +AMZN,2016-07-29,765,766,755,758.809998,6777100,758.809998 +AMZN,2016-08-01,759.869995,770.5,757.059998,767.73999,3578200,767.73999 +AMZN,2016-08-02,763.809998,765.01001,757.02002,760.580017,3603300,760.580017 +AMZN,2016-08-03,757.059998,758.890015,752.25,754.640015,3581500,754.640015 +AMZN,2016-08-04,753.700012,765,750.349976,760.77002,3178200,760.77002 +AMZN,2016-08-05,764.809998,768.469971,763.090027,765.97998,2704400,765.97998 +AMZN,2016-08-08,766.809998,767,761.02002,766.559998,1986300,766.559998 +AMZN,2016-08-09,767.390015,772.599976,766.900024,768.309998,1876100,768.309998 +AMZN,2016-08-10,769.799988,772.099976,766.190002,768.559998,1604300,768.559998 +AMZN,2016-08-11,769.940002,773.75,769.119995,771.23999,2019700,771.23999 +AMZN,2016-08-12,768.460022,773.150024,768.419983,772.559998,1563300,772.559998 +AMZN,2016-08-15,771.900024,772.039978,767.710022,768.48999,2118500,768.48999 +AMZN,2016-08-16,768.619995,768.72998,763.820007,764.039978,1604600,764.039978 +AMZN,2016-08-17,764.409973,765.219971,759.200012,764.630005,1891100,764.630005 +AMZN,2016-08-18,764,765.169983,760.599976,764.460022,1458800,764.460022 +AMZN,2016-08-19,761.900024,762.48999,756.890015,757.309998,2343200,757.309998 +AMZN,2016-08-22,757.5,759.849976,752.099976,759.47998,1679300,759.47998 +AMZN,2016-08-23,763.309998,764.700012,761,762.450012,1524100,762.450012 +AMZN,2016-08-24,763,763.409973,755.359985,757.25,1744100,757.25 +AMZN,2016-08-25,756,760.559998,754.73999,759.219971,1623000,759.219971 +AMZN,2016-08-26,760.049988,770,759.799988,769,2776800,769 +AMZN,2016-08-29,768.719971,774.97998,768.599976,771.289978,2198600,771.289978 +AMZN,2016-08-30,771.049988,771.840027,765.559998,767.580017,1709200,767.580017 +AMZN,2016-08-31,766.599976,769.640015,764,769.159973,1633800,769.159973 +AMZN,2016-09-01,770.900024,772.039978,766.75,770.619995,1792300,770.619995 +AMZN,2016-09-02,774.109985,776,771.700012,772.440002,2181800,772.440002 +AMZN,2016-09-06,774.039978,789.47998,770.219971,788.869995,3719800,788.869995 +AMZN,2016-09-07,789.530029,790.789978,784.330017,784.47998,2424600,784.47998 +AMZN,2016-09-08,783.890015,786.5,781.440002,784.059998,2030500,784.059998 +AMZN,2016-09-09,779.359985,781,760.109985,760.140015,4257300,760.140015 +AMZN,2016-09-12,757.349976,772.659973,756,771.48999,3124700,771.48999 +AMZN,2016-09-13,768.77002,769.890015,759.049988,761.01001,3117200,761.01001 +AMZN,2016-09-14,762.200012,767.5,758.849976,761.090027,2523000,761.090027 +AMZN,2016-09-15,762,770.869995,757.580017,769.690002,3034000,769.690002 +AMZN,2016-09-16,773.280029,780.460022,771.659973,778.52002,5499200,778.52002 +AMZN,2016-09-19,779.969971,781.940002,771,775.099976,2297200,775.099976 +AMZN,2016-09-20,776,781.369995,776,780.219971,1937200,780.219971 +AMZN,2016-09-21,783.25,790.690002,779.01001,789.73999,2718600,789.73999 +AMZN,2016-09-22,794.27002,805.890015,794.27002,804.700012,4078900,804.700012 +AMZN,2016-09-23,803.130005,807.75,802.119995,805.75,2353500,805.75 +AMZN,2016-09-26,801.799988,805.929993,797.150024,799.159973,2651400,799.159973 +AMZN,2016-09-27,801.849976,816.640015,801.109985,816.109985,3819600,816.109985 +AMZN,2016-09-28,818,830.140015,817.030029,828.719971,4422100,828.719971 +AMZN,2016-09-29,828.26001,837.5,824.630005,829.049988,4922200,829.049988 +AMZN,2016-09-30,832.609985,839.950012,832.400024,837.309998,4430600,837.309998 +AMZN,2016-10-03,836,839.859985,831.25,836.73999,2769400,836.73999 +AMZN,2016-10-04,840.909973,842.369995,830.26001,834.030029,2950300,834.030029 +AMZN,2016-10-05,838,845.669983,836.119995,844.359985,3469100,844.359985 +AMZN,2016-10-06,843.700012,847.210022,840.599976,841.659973,2684000,841.659973 +AMZN,2016-10-07,845.789978,845.950012,837.450012,839.429993,2426200,839.429993 +AMZN,2016-10-10,843.25,845.200012,840.27002,841.710022,1827100,841.710022 +AMZN,2016-10-11,841.02002,841.289978,828.349976,831,3588200,831 +AMZN,2016-10-12,834,837.669983,830.099976,834.090027,2380400,834.090027 +AMZN,2016-10-13,829,831.799988,821.210022,829.280029,3091400,829.280029 +AMZN,2016-10-14,835.080017,835.73999,822.960022,822.960022,2999800,822.960022 +AMZN,2016-10-17,821.5,822,811.679993,812.950012,3361500,812.950012 +AMZN,2016-10-18,822.109985,823.26001,815.02002,817.650024,2512500,817.650024 +AMZN,2016-10-19,820.400024,820.669983,815.169983,817.690002,2090700,817.690002 +AMZN,2016-10-20,813.98999,815.710022,803.099976,810.320007,3152000,810.320007 +AMZN,2016-10-21,809.359985,819.419983,809,818.98999,2793000,818.98999 +AMZN,2016-10-24,824.950012,838.299988,822.210022,838.090027,4060900,838.090027 +AMZN,2016-10-25,839.299988,843.090027,833.219971,835.179993,3248400,835.179993 +AMZN,2016-10-26,832.76001,833.440002,820,822.590027,3975000,822.590027 +AMZN,2016-10-27,831.23999,831.719971,815.429993,818.359985,6737800,818.359985 +AMZN,2016-10-28,782,789.48999,774.609985,776.320007,10815500,776.320007 +AMZN,2016-10-31,781.030029,793.700012,780.109985,789.820007,5401600,789.820007 +AMZN,2016-11-01,799,800.840027,776.710022,785.409973,5295000,785.409973 +AMZN,2016-11-02,783.929993,784.75,763.549988,765.559998,5026500,765.559998 +AMZN,2016-11-03,765.049988,777,764,767.030029,3872500,767.030029 +AMZN,2016-11-04,762.789978,766,753.22998,755.049988,5122100,755.049988 +AMZN,2016-11-07,771.640015,787.72998,770.940002,784.929993,5984400,784.929993 +AMZN,2016-11-08,784.969971,791.73999,779.099976,787.75,3412600,787.75 +AMZN,2016-11-09,764,777.5,760.090027,771.880005,8550400,771.880005 +AMZN,2016-11-10,778.809998,778.830017,717.700012,742.380005,12742300,742.380005 +AMZN,2016-11-11,735.72998,743.26001,728.900024,739.01001,6594400,739.01001 +AMZN,2016-11-14,745.51001,746,710.099976,719.070007,7283200,719.070007 +AMZN,2016-11-15,730,746.780029,725.98999,743.23999,6744600,743.23999 +AMZN,2016-11-16,739.880005,749.869995,735.609985,746.48999,3601400,746.48999 +AMZN,2016-11-17,749.320007,757.5,748,756.400024,3651300,756.400024 +AMZN,2016-11-18,761,767.73999,757.640015,760.159973,4301300,760.159973 +AMZN,2016-11-21,766,780.349976,765.109985,780,4595600,780 +AMZN,2016-11-22,788.169983,792.400024,781,785.330017,5304900,785.330017 +AMZN,2016-11-23,781.72998,781.75,773.119995,780.119995,3522500,780.119995 +AMZN,2016-11-25,786.5,786.75,777.900024,780.369995,1832300,780.369995 +AMZN,2016-11-28,776.98999,777,764.23999,766.77002,4380900,766.77002 +AMZN,2016-11-29,768,769.890015,761.320007,762.52002,3266500,762.52002 +AMZN,2016-11-30,762,768.090027,750.25,750.570007,4580100,750.570007 +AMZN,2016-12-01,752.409973,753.369995,738.030029,743.650024,4626500,743.650024 +AMZN,2016-12-02,743.400024,748.48999,736.700012,740.340027,3499200,740.340027 +AMZN,2016-12-05,745,761.48999,742,759.359985,4298200,759.359985 +AMZN,2016-12-06,763.98999,768.23999,757.25,764.719971,3788300,764.719971 +AMZN,2016-12-07,764.549988,770.419983,755.820007,770.419983,3655300,770.419983 +AMZN,2016-12-08,771.869995,773.789978,765.190002,767.330017,3185700,767.330017 +AMZN,2016-12-09,770,770.25,765.340027,768.659973,2458800,768.659973 +AMZN,2016-12-12,766.400024,766.890015,757.200012,760.119995,2956900,760.119995 +AMZN,2016-12-13,764.960022,782.460022,762,774.340027,5244700,774.340027 +AMZN,2016-12-14,778.25,780.859985,762.809998,768.820007,5406500,768.820007 +AMZN,2016-12-15,766.280029,769.099976,760.309998,761,3794200,761 +AMZN,2016-12-16,765,765.130005,754,757.77002,4828700,757.77002 +AMZN,2016-12-19,758.890015,770.5,756.159973,766,3103200,766 +AMZN,2016-12-20,768.650024,774.390015,767.710022,771.219971,2667900,771.219971 +AMZN,2016-12-21,770,771.219971,765.700012,770.599976,2040400,770.599976 +AMZN,2016-12-22,768.119995,771.210022,763.02002,766.340027,2518300,766.340027 +AMZN,2016-12-23,764.549988,766.5,757.98999,760.590027,1976900,760.590027 +AMZN,2016-12-27,763.400024,774.650024,761.200012,771.400024,2627400,771.400024 +AMZN,2016-12-28,776.25,780,770.5,772.130005,3279100,772.130005 +AMZN,2016-12-29,772.400024,773.400024,760.849976,765.150024,3153500,765.150024 +AMZN,2016-12-30,766.469971,767.400024,748.280029,749.869995,4125300,749.869995 +NFLX,2013-01-02,95.210003,95.810003,90.69,92.010003,19431300,13.144286 +NFLX,2013-01-03,91.970002,97.919998,91.529999,96.590001,27912500,13.798572 +NFLX,2013-01-04,96.54,97.71,95.539997,95.98,17761100,13.711429 +NFLX,2013-01-07,96.390003,101.749999,96.119997,99.200001,45550400,14.171429 +NFLX,2013-01-08,100.009999,100.990002,96.799999,97.160001,24714900,13.88 +NFLX,2013-01-09,97.12,97.949999,94.550001,95.909999,20223000,13.701428 +NFLX,2013-01-10,96.570001,99.919997,95.700001,98,26117700,14 +NFLX,2013-01-11,98.179997,101.920003,98,101.290002,29851500,14.47 +NFLX,2013-01-14,100.990002,104.500002,100.559999,103.449998,23473100,14.778571 +NFLX,2013-01-15,103.020001,104.359999,101.050003,101.689998,17068100,14.527143 +NFLX,2013-01-16,101.820001,102.299998,96.759998,97.480001,28014700,13.925714 +NFLX,2013-01-17,98.090002,98.6,95.750002,97.7,16221100,13.957143 +NFLX,2013-01-18,100.380001,101.939997,98.680002,99.17,35999600,14.167143 +NFLX,2013-01-22,99.649998,99.649998,96.590001,97.810002,22773100,13.972857 +NFLX,2013-01-23,97.13,103.83,97.019998,103.26,74235000,14.751429 +NFLX,2013-01-24,143.98999800000001,149.169996,139.620005,146.859997,118805400,20.98 +NFLX,2013-01-25,145.669996,172.68,145.609995,169.559996,191445800,24.222857 +NFLX,2013-01-28,172.509996,177.249998,160.789995,162.109999,109104800,23.158571 +NFLX,2013-01-29,158.130001,169.880003,156.629993,169.119999,59542000,24.16 +NFLX,2013-01-30,173.490005,175.499998,162.659998,167.700006,48062700,23.957144 +NFLX,2013-01-31,167.100006,168.999996,160.319998,165.240004,35601300,23.605715 +NFLX,2013-02-01,170.000006,172.999994,163.879999,164.799994,50358000,23.542856 +NFLX,2013-02-04,162.780001,175.130003,162.780001,174.739994,50969100,24.962856 +NFLX,2013-02-05,172.379993,177.889999,171.000002,174.389999,57056300,24.912857 +NFLX,2013-02-06,175,185.349997,174.550003,184.410002,67190900,26.344286 +NFLX,2013-02-07,185.750006,188.879997,178.540001,181.959999,53086600,25.994286 +NFLX,2013-02-08,181.739994,183.960005,180.009995,180.970003,25657800,25.852858 +NFLX,2013-02-11,178.979998,182.050001,174.799995,177.889999,29325100,25.412857 +NFLX,2013-02-12,180.659996,183.559996,175.710003,177.950001,34399400,25.421429 +NFLX,2013-02-13,180.900002,186.399994,179.66,186.270004,40929000,26.610001 +NFLX,2013-02-14,187.290001,189.850006,184.689995,187.400003,31979500,26.771429 +NFLX,2013-02-15,188.570004,189.999996,186.260004,189.509998,26652500,27.072857 +NFLX,2013-02-19,191.000006,197.17,190.15,196.449997,34138300,28.064285 +NFLX,2013-02-20,197.579996,197.619997,186.499996,187.119997,34996500,26.731428 +NFLX,2013-02-21,185.999998,192.200006,182.499998,187.149998,36894200,26.735714 +NFLX,2013-02-22,183.719999,183.790001,178.429998,179.860004,38971100,25.694286 +NFLX,2013-02-25,180.990004,187.099997,175.449997,179.320005,52164700,25.617144 +NFLX,2013-02-26,180.599995,185.219994,175.6,184.089994,33882100,26.298571 +NFLX,2013-02-27,183.579996,185.999998,180.559994,184.32,22626800,26.331429 +NFLX,2013-02-28,183.810001,192.130005,183.509995,188.080006,34293700,26.868572 +NFLX,2013-03-01,187.109997,190.340004,186.210003,189.369995,21451500,27.052856 +NFLX,2013-03-04,188.680006,190.079998,176.659998,181.209995,47824000,25.887142 +NFLX,2013-03-05,184.669994,185.309996,178.080004,181.729994,32326700,25.961428 +NFLX,2013-03-06,182.150003,184.960001,179.579998,182.939995,17435600,26.134285 +NFLX,2013-03-07,179.999994,182.499998,176.16,181.560003,28695800,25.937143 +NFLX,2013-03-08,182.449997,185.849995,180.709997,184.699995,23513000,26.385714 +NFLX,2013-03-11,184.000006,184.520004,179.009998,180.450005,21015400,25.778572 +NFLX,2013-03-12,179.360006,184.169996,179.250004,182.110003,21151900,26.015715 +NFLX,2013-03-13,187.400003,195.189995,186.750002,192.359997,53898600,27.48 +NFLX,2013-03-14,192.690004,192.690004,187.069996,188.369999,28450800,26.91 +NFLX,2013-03-15,189.250006,189.989996,184.550005,184.849998,20667500,26.407143 +NFLX,2013-03-18,181.379999,186.770002,180.549994,185.590002,18073300,26.512857 +NFLX,2013-03-19,185.999998,186.750002,179.250004,181.369999,19873700,25.91 +NFLX,2013-03-20,182.620001,183.850002,180.430004,183.049997,11132100,26.15 +NFLX,2013-03-21,182.399996,187.400003,181.969999,181.99,18804100,25.998571 +NFLX,2013-03-22,183.099998,183.860003,179.499996,181.299997,14189000,25.9 +NFLX,2013-03-25,182.429996,184.839998,179.770002,180.789999,15024800,25.827143 +NFLX,2013-03-26,184.000006,192.640003,183.599997,190.609997,46817400,27.23 +NFLX,2013-03-27,189.640001,197.059998,188.329998,190.240002,40475400,27.177143 +NFLX,2013-03-28,190.75,192.899996,188.600004,189.280006,19588100,27.040001 +NFLX,2013-04-01,190.950005,191.500004,181.470001,182.429996,22947400,26.061428 +NFLX,2013-04-02,183.900003,185.180006,176.099998,176.689999,32280500,25.241428 +NFLX,2013-04-03,177.049994,178.329996,164.259995,169.74,75357800,24.248571 +NFLX,2013-04-04,167.369999,170.129995,163.809998,166.689997,34460300,23.812857 +NFLX,2013-04-05,163.520004,170.500004,162.529995,164.660004,32512900,23.522858 +NFLX,2013-04-08,165.830004,166.300001,158.999994,163.059994,31745000,23.294285 +NFLX,2013-04-09,163.490004,171.369997,162.049997,169.360004,34045900,24.194286 +NFLX,2013-04-10,168,169.450006,164.909996,166.069996,29709400,23.724285 +NFLX,2013-04-11,168.830006,173.400003,168.820005,173.009995,33056100,24.715714 +NFLX,2013-04-12,176.990005,177.639994,171.200006,173.199999,37797900,24.742857 +NFLX,2013-04-15,175.559999,182.349995,174.799995,176.499994,46529000,25.214285 +NFLX,2013-04-16,174.969999,177.729996,172.270004,175.850006,29711500,25.121429 +NFLX,2013-04-17,174.339998,177.390001,168.270006,169.360004,27545700,24.194286 +NFLX,2013-04-18,171.000002,171.899996,161.800005,163.819998,23121000,23.402857 +NFLX,2013-04-19,165.499996,169.17,163.030006,163.370001,20163500,23.338572 +NFLX,2013-04-22,165.720001,176.499994,165.720001,174.369999,84870100,24.91 +NFLX,2013-04-23,215.569994,219.380001,209.510002,216.99,114860900,30.998571 +NFLX,2013-04-24,217.6,224.300007,213.219994,216.719994,46898600,30.959999 +NFLX,2013-04-25,216.98,218.790001,213.269995,213.750006,29274000,30.535715 +NFLX,2013-04-26,217,217.130003,212.520004,215.549994,21790300,30.792856 +NFLX,2013-04-29,216.610004,217.730003,212.010006,215.009995,20787200,30.715714 +NFLX,2013-04-30,214.599998,219.749996,214.240004,216.070005,25071200,30.867144 +NFLX,2013-05-01,215.920002,217.389996,211.649998,212.91,18359600,30.415714 +NFLX,2013-05-02,213.239994,215.450005,210.190004,214.489996,18328800,30.641428 +NFLX,2013-05-03,215.779999,218.230001,212.699995,213.449999,15431500,30.492857 +NFLX,2013-05-06,209.630005,212.450003,204.019997,210.690002,31731000,30.098572 +NFLX,2013-05-07,208.779999,210.519999,205.600006,206.249994,17079300,29.464285 +NFLX,2013-05-08,204.930004,210.399996,204.529995,208.609995,17623200,29.801428 +NFLX,2013-05-09,208.029995,218.880003,206.52,216.41,36108800,30.915714 +NFLX,2013-05-10,216.41,219.749996,214.559998,217.690002,18844700,31.098572 +NFLX,2013-05-13,217.170004,229.69001,217.140003,229.37999,41357400,32.76857 +NFLX,2013-05-14,231.990009,236.590008,230.799995,233.970001,38535700,33.424286 +NFLX,2013-05-15,239.469994,245.429996,237.830009,243.39999,36029700,34.771427 +NFLX,2013-05-16,246.950005,248.849995,235.199989,237.029991,28053200,33.861427 +NFLX,2013-05-17,238.529999,242.749989,236.000008,238.999996,20141100,34.142857 +NFLX,2013-05-20,238.44001,241.64999,236.759998,239.549995,14765800,34.221428 +NFLX,2013-05-21,240.039993,240.900013,235.000011,237.089993,11491200,33.869999 +NFLX,2013-05-22,234.399998,238.200005,226.640007,228.559998,21769300,32.651428 +NFLX,2013-05-23,225.700012,228.199989,221.549997,226.179996,16198000,32.311428 +NFLX,2013-05-24,225.229988,229.000008,224.500011,228.740002,11808300,32.677143 +NFLX,2013-05-28,231.750004,235.960007,212.980001,214.190002,39525500,30.598572 +NFLX,2013-05-29,214.549997,221.379993,209.909998,215.340002,34101900,30.762857 +NFLX,2013-05-30,216.030005,223.000004,211.549995,222.659996,24087700,31.808571 +NFLX,2013-05-31,225.240002,229.579994,224.049988,226.250011,25416300,32.32143 +NFLX,2013-06-03,227.050003,227.5,217.57,221.969994,21270900,31.709999 +NFLX,2013-06-04,220.120005,227.549988,218.569996,225.30999,23006900,32.187141 +NFLX,2013-06-05,223.189995,228.000011,218.400005,223.460001,33096000,31.922857 +NFLX,2013-06-06,222.119997,225.400005,213.999998,217.740004,26069400,31.105715 +NFLX,2013-06-07,218.639997,220.819994,215.649996,220.219994,15299200,31.459999 +NFLX,2013-06-10,223.030005,223.329998,216.060005,220.929996,13812400,31.561428 +NFLX,2013-06-11,217.850006,220.269995,213.799994,214.459995,14213500,30.637142 +NFLX,2013-06-12,215.83,215.83,206.869995,207.639999,19108600,29.662857 +NFLX,2013-06-13,207.989994,215.549994,205.749996,215.390003,18511500,30.77 +NFLX,2013-06-14,214.770002,217.290007,212.32,213.98999800000001,12495700,30.57 +NFLX,2013-06-17,225.540009,230.499989,223.749994,229.23,35851200,32.747143 +NFLX,2013-06-18,230.240009,231,226.400002,228.82999,17476900,32.689999 +NFLX,2013-06-19,228.000011,235.880005,227.609989,232.30999,22353100,33.187141 +NFLX,2013-06-20,229.470005,231,220.540001,223.520002,21116200,31.931429 +NFLX,2013-06-21,225.050011,226.380001,214.200003,216.899998,23398200,30.985714 +NFLX,2013-06-24,213.000002,219.079994,209.000004,215.599995,17896200,30.799999 +NFLX,2013-06-25,211.970005,213.5,207.559998,212.9,20918800,30.414286 +NFLX,2013-06-26,214.549997,218.250002,210.820005,212.099995,18834200,30.299999 +NFLX,2013-06-27,212.91,216.729994,209.600004,214.969994,18326700,30.709999 +NFLX,2013-06-28,214.270004,216.299997,210.050001,211.089998,19581100,30.155714 +NFLX,2013-07-01,213.620003,225.32999,212.000006,224.280006,24517500,32.040001 +NFLX,2013-07-02,225.229988,227.470013,217.999996,221.459995,17730300,31.637142 +NFLX,2013-07-03,222.119997,224,218.950005,220.909996,8625400,31.558571 +NFLX,2013-07-05,222.089996,225.249989,219.33,225.099998,9957500,32.157143 +NFLX,2013-07-08,226.979988,235.23999,225.509995,233.099995,24289300,33.299999 +NFLX,2013-07-09,235.040012,247.409988,234.869995,247.380001,35509600,35.34 +NFLX,2013-07-10,245.549999,246.89999,239.209988,243.82,22578500,34.831429 +NFLX,2013-07-11,247.999989,249.199989,240.820011,244.169994,21146300,34.881428 +NFLX,2013-07-12,245.830006,257.430004,245.750004,257.259987,34238400,36.751427 +NFLX,2013-07-15,259.400009,259.850006,252.12999,257.980003,20612900,36.854286 +NFLX,2013-07-16,257.290001,266.369995,256.700001,260.480007,33356400,37.21143 +NFLX,2013-07-17,261.239998,268.259998,258.670006,267.919991,19510400,38.274284 +NFLX,2013-07-18,270.310005,270.310005,264.000008,266.409996,20487600,38.058571 +NFLX,2013-07-19,267.429993,267.950005,263.179989,264.579994,18120200,37.797142 +NFLX,2013-07-22,266.850006,268.749996,257.12001,261.959988,47313700,37.422855 +NFLX,2013-07-23,251.400013,262.230007,246.200001,250.259987,76829200,35.751427 +NFLX,2013-07-24,249.720001,252.249992,240.199997,241.299995,33409600,34.471428 +NFLX,2013-07-25,240.560005,247.660007,239.910004,246.740013,19634300,35.248573 +NFLX,2013-07-26,244.619991,246.979992,240.809998,246.30999,17826900,35.187141 +NFLX,2013-07-29,246.059998,250.67001,242.499996,244.959999,13215300,34.994286 +NFLX,2013-07-30,245.400009,247.91,241.809994,243.759998,10890600,34.822857 +NFLX,2013-07-31,243.410004,247.099995,241.94001,244.479988,13120800,34.925713 +NFLX,2013-08-01,246.540009,250.000008,244.570004,249.119987,14139300,35.58857 +NFLX,2013-08-02,249.339993,249.339993,244.799995,246.18,13879600,35.168571 +NFLX,2013-08-05,243.909988,253.89999,241.379997,253.839989,22962100,36.262856 +NFLX,2013-08-06,253.950005,257.599995,250.10001,255.900009,20413400,36.557144 +NFLX,2013-08-07,254.360001,257.470005,248.660004,249.210003,16328900,35.601429 +NFLX,2013-08-08,251.87001,253.89999,248.450012,250.39999,14800100,35.771427 +NFLX,2013-08-09,249.989994,253.709999,249.800003,252.750004,12322800,36.107143 +NFLX,2013-08-12,251.28001,257.000008,250.419991,256.599998,17804500,36.657143 +NFLX,2013-08-13,258.650005,262.199993,253.260002,259.189991,21940800,37.027142 +NFLX,2013-08-14,258.300011,263.789989,258.020004,261.809998,17399900,37.401428 +NFLX,2013-08-15,259,260.489994,251.360012,253.409992,16629200,36.201427 +NFLX,2013-08-16,253.209988,260.150013,251.129993,258.87001,21354200,36.98143 +NFLX,2013-08-19,258.000004,263.499996,257.750011,259.779991,15497300,37.111427 +NFLX,2013-08-20,262.929996,273.540012,262.5,273.289993,30140600,39.041428 +NFLX,2013-08-21,272.890011,274.649998,267.500008,270.370007,21258300,38.624287 +NFLX,2013-08-22,272.519989,273.460011,268.230011,269.749992,9961700,38.535713 +NFLX,2013-08-23,270.049999,278.390003,269.019989,278.359989,22285200,39.765713 +NFLX,2013-08-26,276.110004,289.939987,274.039997,282.720009,31017700,40.388573 +NFLX,2013-08-27,279.149994,285.880001,274.500008,276.039989,23138500,39.434284 +NFLX,2013-08-28,278.659996,285.000008,276.399998,283.359997,19355700,40.48 +NFLX,2013-08-29,284.029999,290.230007,283.840008,287.850006,19059600,41.121429 +NFLX,2013-08-30,288.249989,288.830002,282.950001,283.909996,15149400,40.558571 +NFLX,2013-09-03,287.429996,290.709991,284.550011,288.999992,19969600,41.285713 +NFLX,2013-09-04,288.839989,293.060005,286.990013,292.430004,19701500,41.775715 +NFLX,2013-09-05,296.800011,298.929993,294.42001,295.110012,19072200,42.158573 +NFLX,2013-09-06,296.330013,296.509991,290.199993,291.539997,17698800,41.648571 +NFLX,2013-09-09,292.750011,295.300003,290.279995,294.14999,13840400,42.021427 +NFLX,2013-09-10,297.5,313.240013,296.809998,313.060009,36682100,44.722858 +NFLX,2013-09-11,313.739998,314.180008,303.880013,308.300007,29940400,44.042858 +NFLX,2013-09-12,301.839993,306.450005,298.350006,301.409996,21947800,43.058571 +NFLX,2013-09-13,301.999996,306.000008,299.189999,305.650013,15029700,43.664288 +NFLX,2013-09-16,309.999992,310.19001,301.799992,302.16,14055300,43.165714 +NFLX,2013-09-17,302.039997,303.259998,297.700005,299.550007,18200700,42.792858 +NFLX,2013-09-18,298.960007,307.679993,298.119987,306.920002,13739600,43.845715 +NFLX,2013-09-19,308.369995,308.750004,304.010002,305.499996,17449600,43.642857 +NFLX,2013-09-20,305.840004,315.890007,305.619999,313.830013,30791600,44.832859 +NFLX,2013-09-23,320.390003,320.390003,299.519993,302.039997,32030600,43.148571 +NFLX,2013-09-24,301.300007,309.400005,300.349998,306.490005,18780300,43.784286 +NFLX,2013-09-25,308.200005,310.800011,304.05999,307.140007,14639100,43.877144 +NFLX,2013-09-26,308.040001,314.490002,307.499989,313.510006,12460700,44.787144 +NFLX,2013-09-27,310.76001,313.519993,309.700012,312.399994,8299200,44.628571 +NFLX,2013-09-30,307.719994,312.150002,305.199989,309.209988,12528600,44.172855 +NFLX,2013-10-01,314.770008,324.700008,314.000004,324.620007,29693300,46.374287 +NFLX,2013-10-02,322.089989,333.599998,321.619991,330.73,30583700,47.247143 +NFLX,2013-10-03,331.010006,334.499992,318.050003,321.719994,24613400,45.959999 +NFLX,2013-10-04,323.680012,328.300011,318.540001,327.259987,16814000,46.751427 +NFLX,2013-10-07,324.039993,326.969994,318.150005,318.159992,14634900,45.451427 +NFLX,2013-10-08,319.290005,321.519989,299.570007,302.320004,28678300,43.188572 +NFLX,2013-10-09,300.22999600000003,300.57999,282.800011,288.429993,41948900,41.204285 +NFLX,2013-10-10,301,307.43,296.400002,303.990002,30695000,43.427143 +NFLX,2013-10-11,304.310009,307.610004,300.129993,300.85001,19200300,42.978573 +NFLX,2013-10-14,310.609993,325.270008,306.000008,324.360001,45659600,46.337143 +NFLX,2013-10-15,325.099991,327.330002,319.339993,321.690006,26848500,45.955715 +NFLX,2013-10-16,320.109997,325.5,318.259995,322.879993,18843300,46.125713 +NFLX,2013-10-17,322.209991,330.209988,319.66,330.099998,19272400,47.157143 +NFLX,2013-10-18,334.000008,336.480011,327.599995,333.499996,25454800,47.642857 +NFLX,2013-10-21,342.919998,355.419991,340.099987,354.989994,65090200,50.712856 +NFLX,2013-10-22,387.840012,389.159988,321.499989,322.520012,181099800,46.074287 +NFLX,2013-10-23,317.32,335.189995,316.999992,330.240002,58376500,47.177143 +NFLX,2013-10-24,331.440002,336.850006,323.660011,331.219997,33559400,47.317142 +NFLX,2013-10-25,330.999992,337.200001,325.909996,328.029991,24062500,46.861427 +NFLX,2013-10-28,325.010002,330.959991,311.809994,314.000004,34260800,44.857143 +NFLX,2013-10-29,318.569988,327.370003,309.200001,327.299988,30936500,46.757141 +NFLX,2013-10-30,328.719994,328.930012,315.619987,318.139992,21640500,45.44857 +NFLX,2013-10-31,318.110004,326.650013,315.699989,322.480011,18489800,46.068573 +NFLX,2013-11-01,328.830009,333.499996,325.900009,329.269993,22020600,47.03857 +NFLX,2013-11-04,330.950005,337.790001,325.150005,337.60001,21919100,48.228573 +NFLX,2013-11-05,335.539989,342.400013,333.049999,341.499992,17289300,48.785713 +NFLX,2013-11-06,339.490013,344.369991,332.789993,335.630005,20733300,47.947144 +NFLX,2013-11-07,338.999989,339.669991,325.159992,326.860004,20007400,46.694286 +NFLX,2013-11-08,326.920006,335.599991,325.52,334.900002,19448800,47.842857 +NFLX,2013-11-11,332.749992,339.5,328.619991,337.910004,16815400,48.272858 +NFLX,2013-11-12,336.180004,339.5,331.349987,333.729988,12231800,47.675713 +NFLX,2013-11-13,333.21999,335.459988,329.100002,335.28001,11967900,47.897144 +NFLX,2013-11-14,335.790009,343.999996,335.120007,342.570004,20104700,48.938572 +NFLX,2013-11-15,344.60001,349.890011,343.080002,349.759995,20152300,49.965714 +NFLX,2013-11-18,350,350.489998,339.5,341.770012,20247500,48.824287 +NFLX,2013-11-19,340.769989,346.820007,334.240013,337.289989,17057600,48.184284 +NFLX,2013-11-20,343.349995,346.35001,337.649998,339.52,19481700,48.502857 +NFLX,2013-11-21,342.240009,348.679996,341.67001,348.499992,15989400,49.785713 +NFLX,2013-11-22,348.830013,350.599987,343.999996,347.849991,14202300,49.692856 +NFLX,2013-11-25,346.900009,352.93,345.010006,350.240005,13984600,50.034286 +NFLX,2013-11-26,350.500011,356.459988,347.570011,355.200012,14683200,50.742859 +NFLX,2013-11-27,357.109989,363.85001,353.540001,362.490005,16832900,51.784286 +NFLX,2013-11-29,364.049988,367.800007,363.009991,365.799988,8388100,52.257141 +NFLX,2013-12-02,364.879993,367.960011,359.609993,363.919998,11675300,51.988571 +NFLX,2013-12-03,361.889992,363.57999,356.499989,362.940002,13400800,51.848572 +NFLX,2013-12-04,360.589989,368.650013,356.249996,356.269997,19395600,50.895714 +NFLX,2013-12-05,357.799992,361.130001,353.390011,358.059998,13793500,51.151428 +NFLX,2013-12-06,361.040012,361.330006,351.999992,354.439995,12075700,50.634285 +NFLX,2013-12-09,355.169998,359.869999,353.609989,355.67001,11718700,50.810001 +NFLX,2013-12-10,355.000008,364.44001,353.319996,363.100006,14089600,51.871429 +NFLX,2013-12-11,364.369995,371.160004,362.220013,363.98,20066900,51.997143 +NFLX,2013-12-12,363.670006,374.840008,363.550003,373.330013,21318500,53.332859 +NFLX,2013-12-13,376.149998,377.000004,368.80999,368.969994,17854900,52.709999 +NFLX,2013-12-16,369.980003,371,364.249992,366.310013,13911100,52.330002 +NFLX,2013-12-17,366.749996,377.699993,366.270012,374.869995,18448500,53.552856 +NFLX,2013-12-18,373.860012,377.000004,366.509991,376.240013,19881400,53.748573 +NFLX,2013-12-19,374.199993,379.859989,373.349987,376.739998,13849500,53.82 +NFLX,2013-12-20,376.499992,379.689999,374.339996,375.669987,18817400,53.667141 +NFLX,2013-12-23,378.690002,383.430004,376.630009,380.580006,12624500,54.368572 +NFLX,2013-12-24,380.76001,383.960003,377.479988,378.389996,5577600,54.055714 +NFLX,2013-12-26,378.109989,380.91,375.82999,376.929989,12268900,53.847141 +NFLX,2013-12-27,377.109993,378.750004,365.810001,367.5,16948400,52.5 +NFLX,2013-12-30,367.620003,369.539993,359.039993,366.990002,15075200,52.427143 +NFLX,2013-12-31,365.500008,369.149998,363.630005,368.170002,10516800,52.595715 +NFLX,2014-01-02,366.809998,367.580002,360.800007,362.82,12325600,51.831429 +NFLX,2014-01-03,364,367.470013,362.900002,363.100006,10817100,51.871429 +NFLX,2014-01-06,363.22999600000003,364.309994,353.330009,359.569992,15501500,51.367142 +NFLX,2014-01-07,347.789989,347.889992,337.070011,339.5,36167600,48.5 +NFLX,2014-01-08,336.730003,345.979988,336.520012,340.989994,20001100,48.712856 +NFLX,2014-01-09,341.770012,343.97999600000003,335.000004,337.050011,17007200,48.150002 +NFLX,2014-01-10,338.070007,338.640007,330.529995,332.139992,16237900,47.44857 +NFLX,2014-01-13,331.130009,348.67001,331.130009,336.810005,27237000,48.115715 +NFLX,2014-01-14,341.439991,341.599995,332.569988,337.959991,19740000,48.279999 +NFLX,2014-01-15,335.000004,338.569992,319.07,330.380005,40432000,47.197144 +NFLX,2014-01-16,328.41,333.869991,322.02,331.680008,21135800,47.382858 +NFLX,2014-01-17,332.070004,334.82,328.240009,330.039997,16417100,47.148571 +NFLX,2014-01-21,332.230007,332.470013,320.25,328.710007,25220300,46.958572 +NFLX,2014-01-22,329.500011,334.439991,327.350002,333.729988,48342000,47.675713 +NFLX,2014-01-23,387.400002,395.62999,377.490002,388.720005,91280000,55.531429 +NFLX,2014-01-24,383.679996,390.699997,383.37999,386.079998,35466900,55.154285 +NFLX,2014-01-27,387.389988,391.499989,370.55999,381.230007,32526900,54.46143 +NFLX,2014-01-28,381.319996,407.409992,380.76001,406.770004,43590400,58.110001 +NFLX,2014-01-29,403.119987,407.340004,398.049992,400.420006,28968100,57.202858 +NFLX,2014-01-30,407.099998,409.190006,401.509991,404.67001,18379200,57.810001 +NFLX,2014-01-31,402.310009,412.400013,402.299995,409.330009,23625000,58.475716 +NFLX,2014-02-03,411.900002,412.149994,400.720013,404.37999,20145300,57.76857 +NFLX,2014-02-04,405.450001,408.529991,397.009995,405.910011,18066300,57.987144 +NFLX,2014-02-05,403.150002,407.75,398.000004,404.419991,16762900,57.774284 +NFLX,2014-02-06,406.42001,410.909992,400.420006,407.910004,12852000,58.272858 +NFLX,2014-02-07,413.44001,430.5,410.559998,429.979988,32921000,61.425713 +NFLX,2014-02-10,429.429989,432.370003,424.279991,430.439999,13812400,61.491428 +NFLX,2014-02-11,429.959988,435.759987,425.510006,433.990013,13667500,61.998573 +NFLX,2014-02-12,434.779991,434.899994,425.539993,428.930004,15673000,61.275715 +NFLX,2014-02-13,425.69001,439.490005,425.000008,436.549992,18700500,62.364285 +NFLX,2014-02-14,437.05999,437.700005,431.689987,435.509995,11985400,62.215714 +NFLX,2014-02-18,436.959988,441.240005,427.999996,436.849998,15507800,62.407143 +NFLX,2014-02-19,431.669987,436.250011,427.970009,428.229988,16031400,61.175713 +NFLX,2014-02-20,430.35001,437.769993,429.159996,434.950008,11965100,62.135715 +NFLX,2014-02-21,438.700001,438.700001,429.649994,432.23,13483400,61.747143 +NFLX,2014-02-24,435.469994,449.690025,428.500008,447.000004,26043500,63.857143 +NFLX,2014-02-25,449.999992,457.790024,445.000011,453.030022,18700500,64.718575 +NFLX,2014-02-26,455.899994,456.000023,446.000008,448.789978,15010100,64.112854 +NFLX,2014-02-27,447.839996,454.13002,447.839996,452.230003,10304700,64.604286 +NFLX,2014-02-28,453.129997,454.199982,441,445.630013,15751400,63.66143 +NFLX,2014-03-03,441.189991,445.749989,438.099987,445.590012,13528200,63.655716 +NFLX,2014-03-04,450.920013,455,445.590012,454.980026,12387900,64.997147 +NFLX,2014-03-05,453.98999,456.839989,451.909996,453.499992,10868900,64.785713 +NFLX,2014-03-06,454.940025,458.000015,448.989983,450.510017,11809000,64.358574 +NFLX,2014-03-07,454.069992,454.540016,445.51001,448.369995,11573800,64.052856 +NFLX,2014-03-10,448.470024,448.779991,432.10001,439.949989,15439200,62.849998 +NFLX,2014-03-11,442.640011,446.679996,435.649998,437.48,10448200,62.497143 +NFLX,2014-03-12,433.679993,439.499992,429.680008,436.580006,12134500,62.368572 +NFLX,2014-03-13,439.710011,440.28001,428.280003,430.05999,11390400,61.437141 +NFLX,2014-03-14,427.730003,434.990009,422.999989,424.490009,14989100,60.64143 +NFLX,2014-03-17,428.189987,430.800007,422.310013,422.720009,10695300,60.388573 +NFLX,2014-03-18,422.369987,426.26001,416.5,420.249992,14688100,60.035713 +NFLX,2014-03-19,419.87001,425.450005,417.060013,420.089989,10531500,60.012856 +NFLX,2014-03-20,419.670006,432.200012,419.499989,424.270004,14494900,60.610001 +NFLX,2014-03-21,426.100006,428.340004,405.739994,405.990013,26770800,57.998573 +NFLX,2014-03-24,405.490002,406.449997,368.599998,378.899994,42483700,54.128571 +NFLX,2014-03-25,378.999996,384.930012,365.75,370.839996,30356900,52.977142 +NFLX,2014-03-26,373.010006,377.450001,366.569992,372.280003,27152300,53.182858 +NFLX,2014-03-27,371.009987,377.830009,361.53001,364.180004,28672000,52.025715 +NFLX,2014-03-28,360.219994,369.000008,355.750011,358.870003,24699500,51.267143 +NFLX,2014-03-31,361.51001,366.860012,349.879997,352.030006,22125600,50.290001 +NFLX,2014-04-01,351.75,365.249989,351.740013,364.690002,21338800,52.098572 +NFLX,2014-04-02,365.660011,371.049988,358.300003,362.880001,24194100,51.84 +NFLX,2014-04-03,361.330006,365.099998,350.100002,354.689987,21983500,50.669998 +NFLX,2014-04-04,355.450005,356.000004,335.879997,337.30999,34958000,48.187141 +NFLX,2014-04-07,340.51001,348.189999,331.110008,337.999992,37351300,48.285713 +NFLX,2014-04-08,340.049999,350.790005,338.389988,348.889988,25761400,49.841427 +NFLX,2014-04-09,351.03001,353.900009,343.14999,353.030003,20511400,50.432858 +NFLX,2014-04-10,354.47999600000003,357.480011,334.009995,334.730011,24871000,47.818573 +NFLX,2014-04-11,330.799988,334.82,323.609997,326.709988,30146200,46.672855 +NFLX,2014-04-14,332.889996,335.000004,325.540001,331.580006,17994200,47.368572 +NFLX,2014-04-15,329.080002,331.569992,312.099987,326.270004,30799300,46.610001 +NFLX,2014-04-16,331.050007,333.969994,323.360004,331.409988,16114700,47.344284 +NFLX,2014-04-17,336.759991,349.730007,332.5,345.740009,32116000,49.39143 +NFLX,2014-04-21,349.300011,349.400013,338.299999,348.490005,47892600,49.784286 +NFLX,2014-04-22,376.630009,380.880013,364.830006,372.89999,64702400,53.271427 +NFLX,2014-04-23,362.730011,367.5,352.999989,353.5,40285000,50.5 +NFLX,2014-04-24,352.500004,355.900002,334.799999,344.070011,30639000,49.152859 +NFLX,2014-04-25,337.460007,341.410004,322,322.080002,33071500,46.011429 +NFLX,2014-04-28,318.050003,320.900002,299.499992,314.209995,47123300,44.887142 +NFLX,2014-04-29,312.23999,324.629993,312.029999,319.869991,23132900,45.695713 +NFLX,2014-04-30,317.919987,322.400009,310.250011,322.040001,23618700,46.005714 +NFLX,2014-05-01,324.050007,345.689995,323.050011,336.520012,37001300,48.074287 +NFLX,2014-05-02,337.509995,343.899994,334.049995,340.650013,26194700,48.664288 +NFLX,2014-05-05,338.070007,345.480003,336.100002,344.380005,20330800,49.197144 +NFLX,2014-05-06,343.71999,347.720001,325.640003,326.190002,22722700,46.598572 +NFLX,2014-05-07,326.130001,327.84,315.209991,320.539993,25680900,45.791428 +NFLX,2014-05-08,317.159996,331.720009,314.360012,321.659992,21168700,45.951427 +NFLX,2014-05-09,322.080002,329.939995,317.349987,328.550003,17968300,46.935715 +NFLX,2014-05-12,330.859989,345.529991,330.520008,345.449989,21395500,49.349998 +NFLX,2014-05-13,344.449993,354.270004,340.740002,347.139988,20832000,49.591427 +NFLX,2014-05-14,347.049999,354.399994,346.05999,351.87999,19891900,50.26857 +NFLX,2014-05-15,350.850006,351.790001,339.379997,344.189987,23370200,49.169998 +NFLX,2014-05-16,345.46999,349.970013,339.840008,349.879997,19072200,49.982857 +NFLX,2014-05-19,347.000011,367.219994,346.549988,364.500011,25393200,52.07143 +NFLX,2014-05-20,365.01001,372.700012,362.39999,371.670002,28828100,53.095715 +NFLX,2014-05-21,375.119987,390.69001,373.349987,390.599995,39939900,55.799999 +NFLX,2014-05-22,390.880001,397.499992,387.500004,391.799995,33222700,55.971428 +NFLX,2014-05-23,391.639992,402.470013,389.66,402.35001,22122100,57.478573 +NFLX,2014-05-27,401.999989,402.219994,393.150013,398.810009,26735100,56.972858 +NFLX,2014-05-28,397.200012,405.200008,393.500008,401.239998,19873700,57.32 +NFLX,2014-05-29,403.399994,415.990002,399.549999,415.199997,22844500,59.314285 +NFLX,2014-05-30,415.179996,421.740013,411.610008,417.82999,29248800,59.689999 +NFLX,2014-06-02,419.479988,422.91,412.499989,422.059994,20480600,60.294285 +NFLX,2014-06-03,419.990013,425.599995,417.049999,417.570011,17133200,59.652859 +NFLX,2014-06-04,416.760006,424.499996,413.300007,423.210007,17432800,60.458572 +NFLX,2014-06-05,423.749992,429.400002,418.570007,428.349991,18930800,61.192856 +NFLX,2014-06-06,430.010002,434.890007,428.360004,430.130005,15730400,61.447144 +NFLX,2014-06-09,429.500004,430.64999,420.089989,423.090004,16678900,60.441429 +NFLX,2014-06-10,425.519993,436.039993,425.020008,428.289989,22920100,61.184284 +NFLX,2014-06-11,425.23,432.599995,425.000008,429.999989,13745900,61.42857 +NFLX,2014-06-12,429.070007,430.250008,420.500011,422.449989,15803200,60.349998 +NFLX,2014-06-13,422.999989,427.899994,417.210003,427.710003,15778700,61.101429 +NFLX,2014-06-16,426.530003,431.210003,423.419998,430.259995,12506200,61.465714 +NFLX,2014-06-17,438.040012,448.089989,437.769993,443.649994,28996100,63.378571 +NFLX,2014-06-18,443.669994,450.819984,440.249996,448.680016,18786600,64.097145 +NFLX,2014-06-19,449.429993,449.490021,438.060013,441.389996,17308200,63.055714 +NFLX,2014-06-20,441.200005,442.87999,434.97999600000003,440.180008,13222300,62.882858 +NFLX,2014-06-23,439.359989,441.859993,435.549995,439.519993,10672900,62.78857 +NFLX,2014-06-24,438.049999,449.940018,435.500008,436.360001,20367200,62.337143 +NFLX,2014-06-25,434.999996,444.760006,433.329998,444.210007,15752100,63.458572 +NFLX,2014-06-26,440.790009,442.139999,436.749996,439.610008,14237300,62.80143 +NFLX,2014-06-27,438.319992,443.19001,437.399998,442.079998,15587600,63.154285 +NFLX,2014-06-30,442.859989,446.869987,439.69001,440.599991,10588900,62.942856 +NFLX,2014-07-01,456.229988,473.68,455.29998,473.100014,37995300,67.585716 +NFLX,2014-07-02,473.47999600000003,475.87001,466.039986,466.739975,17309600,66.677139 +NFLX,2014-07-03,470.160027,472.620003,468.87001,472.349983,11359600,67.478569 +NFLX,2014-07-07,472.099991,472.22998,460.000008,460.619995,18296600,65.802856 +NFLX,2014-07-08,459.649986,460.999977,439.279987,445.049999,26182800,63.578571 +NFLX,2014-07-09,446.180012,449.340004,439.730011,442.999992,21011200,63.285713 +NFLX,2014-07-10,434.389996,444.190006,428.200001,438.550011,24388700,62.650002 +NFLX,2014-07-11,441.460011,444.130005,437.150005,439.960003,14219100,62.851429 +NFLX,2014-07-14,443.299999,455.480011,439.000008,452.580025,17433500,64.654289 +NFLX,2014-07-15,450.689995,451.37001,442.269989,449.090012,13505800,64.155716 +NFLX,2014-07-16,454.069992,455.699989,443.400002,444.439999,13438600,63.491428 +NFLX,2014-07-17,443.279999,448.850006,438.290005,439.359989,13266400,62.765713 +NFLX,2014-07-18,440.810009,444.299995,435.75,444.170006,11760700,63.452858 +NFLX,2014-07-21,451.690018,457.499977,447.619991,451.949997,34671000,64.564285 +NFLX,2014-07-22,442.979992,444.669991,425.060009,431.09,57174600,61.584286 +NFLX,2014-07-23,430.410011,435.409992,426.510002,427.899994,17267600,61.128571 +NFLX,2014-07-24,429.46999,430.210007,419.020004,425.37999,18621400,60.76857 +NFLX,2014-07-25,425.000008,428.169987,420.400009,421.859989,11610200,60.265713 +NFLX,2014-07-28,422.210011,425.909988,418.519993,424.66,11960900,60.665714 +NFLX,2014-07-29,423.210007,428.389992,423.210007,424.279991,9282000,60.611427 +NFLX,2014-07-30,424.749989,435.289989,424.310005,434.360008,15263500,62.05143 +NFLX,2014-07-31,430.259995,432.96999,421.289989,422.720009,13820100,60.388573 +NFLX,2014-08-01,421.759987,427.730003,412.510002,425.39999,18947600,60.771427 +NFLX,2014-08-04,427.200005,429.999989,420.779991,422.700008,10686900,60.385715 +NFLX,2014-08-05,421.300003,427.999996,420.309994,422.849998,10653300,60.407143 +NFLX,2014-08-06,420.999996,434.899994,420.549999,430.299995,15835400,61.471428 +NFLX,2014-08-07,435.300003,449.950005,434.549999,449.669998,27313300,64.238571 +NFLX,2014-08-08,450.199997,450.970001,442.050011,445.849991,15495200,63.692856 +NFLX,2014-08-11,449.220001,457.649994,448.709976,451.540001,13246800,64.505714 +NFLX,2014-08-12,451.349983,453.000008,443.409988,446.410004,10845100,63.772858 +NFLX,2014-08-13,448.600014,454.220009,446.82,451.530014,9058000,64.504288 +NFLX,2014-08-14,452.209976,455,448.219978,450.870026,6676600,64.410004 +NFLX,2014-08-15,451.490013,462,448.600014,459.089973,22036700,65.584282 +NFLX,2014-08-18,462.059975,469.499985,461.250023,465.999985,13496000,66.571426 +NFLX,2014-08-19,467.089996,470.500008,462.430023,468.149994,10897600,66.878571 +NFLX,2014-08-20,467.000008,473.750015,464.539978,472.18998,12163900,67.455711 +NFLX,2014-08-21,471.279999,476.150017,467.669983,472.050003,11746700,67.435715 +NFLX,2014-08-22,470.940018,479.549988,470.050011,479.18998,13735400,68.455711 +NFLX,2014-08-25,481.54998,485.300026,477.530022,480.929993,13484800,68.704285 +NFLX,2014-08-26,478.499977,481.850014,474.54998,479.360023,10137400,68.480003 +NFLX,2014-08-27,479.400024,480.249977,473.630013,474.699997,10394300,67.814285 +NFLX,2014-08-28,472.650017,477.47998,470.809975,475.210022,7584500,67.887146 +NFLX,2014-08-29,476.850006,480.500023,474.139984,477.639984,9838500,68.234283 +NFLX,2014-09-02,478.499977,478.790024,474.589981,476.600014,8806700,68.085716 +NFLX,2014-09-03,480.519997,487.599998,476.529999,477.389992,16219000,68.19857 +NFLX,2014-09-04,479.109978,481.69001,472.130005,472.669991,11958800,67.524284 +NFLX,2014-09-05,473.230003,477.349991,470.069984,475.679993,11953200,67.954285 +NFLX,2014-09-08,474.400017,480.599998,474.200012,479.330009,7668500,68.475716 +NFLX,2014-09-09,486.299995,489.290024,476.400009,479.010002,19737900,68.43 +NFLX,2014-09-10,480.199989,484.75,477.040024,484.389992,9104900,69.19857 +NFLX,2014-09-11,482.569977,484.359978,479.669991,481.56002,7865200,68.794289 +NFLX,2014-09-12,483.650002,484.889977,476.120003,476.550026,13425300,68.078575 +NFLX,2014-09-15,477.540009,477.540009,456.849976,457.750023,20617100,65.39286 +NFLX,2014-09-16,448.400009,458.139992,445.599998,456.910004,26838700,65.272858 +NFLX,2014-09-17,456.910004,458.869995,451.290009,454.529976,12133100,64.932854 +NFLX,2014-09-18,457.470016,461.359985,453.320015,459.010025,10630200,65.572861 +NFLX,2014-09-19,460.999977,461.330025,454.170021,457.520004,11960900,65.360001 +NFLX,2014-09-22,456.269989,456.950005,438.880005,442.779987,16169300,63.254284 +NFLX,2014-09-23,441.229992,448.009987,440.499989,443.900013,11471600,63.414288 +NFLX,2014-09-24,444.459999,451.660004,442.540009,450.560005,9551500,64.365715 +NFLX,2014-09-25,449.900017,452.350006,442.420006,443.48999,9839900,63.355713 +NFLX,2014-09-26,445.000011,450.640007,443.889999,448.749977,10404800,64.10714 +NFLX,2014-09-29,444.070004,450.539978,442.019997,449.559982,9516500,64.222855 +NFLX,2014-09-30,452.300018,457.19001,449.799988,451.179993,12472600,64.454285 +NFLX,2014-10-01,448.690002,449.999992,437.290009,438.800003,15416100,62.685715 +NFLX,2014-10-02,438.900005,450.48999,437.880009,449.980019,18450600,64.28286 +NFLX,2014-10-03,453.190025,460.600021,452.51001,459.540024,15290100,65.648575 +NFLX,2014-10-06,462,467.209999,460.999977,463.47998,13709500,66.211426 +NFLX,2014-10-07,461.100006,466.279991,456.000023,456.250015,13759200,65.178574 +NFLX,2014-10-08,456.650024,467.600021,451.379997,466.859978,14332500,66.694283 +NFLX,2014-10-09,466.630013,467.98999,459.559998,461.620018,14928200,65.945717 +NFLX,2014-10-10,459.800003,464.840012,451.440025,452.079987,19110700,64.582855 +NFLX,2014-10-13,451.250008,452.470009,433.000004,438.579998,20216700,62.654285 +NFLX,2014-10-14,445.51001,451.989998,438.130001,449.120026,16747500,64.160004 +NFLX,2014-10-15,444.470013,450.979988,430.179993,448.589973,59927700,64.084282 +NFLX,2014-10-16,332.729992,366.17001,330.999992,361.700001,92304800,51.671429 +NFLX,2014-10-17,359.809998,360.070004,341.499992,357.089989,79160900,51.012856 +NFLX,2014-10-20,356.000004,369.189999,355.550007,359.219997,33529300,51.317142 +NFLX,2014-10-21,362.259987,366.789997,355.439991,365.990005,19365500,52.284286 +NFLX,2014-10-22,368.989994,381.980011,363.200008,374.64999,32150300,53.521427 +NFLX,2014-10-23,380.520004,385.770004,378.249992,383.040009,19916400,54.720001 +NFLX,2014-10-24,382.579998,386.999992,380.809998,385.02,14657300,55.002857 +NFLX,2014-10-27,383.900002,384.499989,376.699997,379.400005,14944300,54.200001 +NFLX,2014-10-28,379.75,386.870003,378.349995,386.220001,11736900,55.174286 +NFLX,2014-10-29,386.220001,386.680012,377.770008,378.100002,12507600,54.014286 +NFLX,2014-10-30,377.510002,382.339993,374.600002,379.01001,10593800,54.144287 +NFLX,2014-10-31,384.400013,393.77,384.000004,392.770004,20470100,56.110001 +NFLX,2014-11-03,393.229988,395.52,385.109989,388.410011,17581200,55.487144 +NFLX,2014-11-04,386.919991,387.250011,378.770004,382.780003,11389700,54.682858 +NFLX,2014-11-05,385.610001,387.840012,376.390003,380.380001,13645800,54.34 +NFLX,2014-11-06,378,385.329994,377.349998,383.299988,9991800,54.757141 +NFLX,2014-11-07,383.439991,385.249992,379.300003,384.160007,9303700,54.880001 +NFLX,2014-11-10,383.000008,389.450008,378.999996,387.270012,9711100,55.324287 +NFLX,2014-11-11,387.270012,394.099995,381.809994,382.550011,14838600,54.650002 +NFLX,2014-11-12,381.130005,385.959995,377.040005,383.860001,10958500,54.837143 +NFLX,2014-11-13,384.459988,385.049988,377.530003,379.409992,10490200,54.201427 +NFLX,2014-11-14,379.380005,387.219997,378.57,386.039997,10988600,55.148571 +NFLX,2014-11-17,385.380009,389.499996,380.749996,381.139992,9225300,54.44857 +NFLX,2014-11-18,380.999989,384.899998,380.529991,381.030003,7921200,54.432858 +NFLX,2014-11-19,383.209999,387.050007,362.659996,363.100006,24515400,51.871429 +NFLX,2014-11-20,363.089993,373.259998,361.000011,368.139988,15425200,52.591427 +NFLX,2014-11-21,372.480007,373.250011,359.500004,360.279995,17878000,51.468571 +NFLX,2014-11-24,360.560001,363.459988,355.39999,356.470001,17864000,50.924286 +NFLX,2014-11-25,351.019997,352.429989,343.999996,348.98999,28100800,49.855713 +NFLX,2014-11-26,351.079998,353.689991,348.220013,351.16,10063200,50.165714 +NFLX,2014-11-28,353.589989,354.000011,345.990002,346.589989,6702500,49.512856 +NFLX,2014-12-01,344.999992,347.000011,337.640011,341.810013,11964400,48.830002 +NFLX,2014-12-02,341.299988,353.339996,340.840004,352.310013,14271600,50.330002 +NFLX,2014-12-03,351.549995,355.12001,344.269989,355.12001,13819400,50.73143 +NFLX,2014-12-04,352.999989,357.950008,349.360012,350.599987,11853800,50.085712 +NFLX,2014-12-05,351.03001,354.499996,348.129997,350.919994,9930200,50.131428 +NFLX,2014-12-08,349.169994,349.879997,338.030006,339.48,13621300,48.497143 +NFLX,2014-12-09,334.739998,345.360001,329.02,343.779991,17976700,49.111427 +NFLX,2014-12-10,343.14999,344.73,333.66,334.319988,12644800,47.759998 +NFLX,2014-12-11,336.089989,340.900005,333.590012,334.630009,11769100,47.804287 +NFLX,2014-12-12,331.919987,338.259998,328.859997,334.479992,13521200,47.782856 +NFLX,2014-12-15,336.389996,338.93,326.330006,327.040009,12019000,46.720001 +NFLX,2014-12-16,324.990002,329.489998,315.999996,316.440006,16947700,45.205715 +NFLX,2014-12-17,317.629993,335.069992,315.540012,333.650013,20192900,47.664288 +NFLX,2014-12-18,338.800011,342.499989,330.629997,334.419991,15639400,47.774284 +NFLX,2014-12-19,335.300011,341.040009,333.350006,340.119987,15047900,48.58857 +NFLX,2014-12-22,339.800007,344.680012,334.240013,336.679989,7994000,48.097141 +NFLX,2014-12-23,338.010006,338.999989,332.310009,336.429996,8291500,48.061428 +NFLX,2014-12-24,336.509998,343.489998,335.990013,342.100006,5411000,48.871429 +NFLX,2014-12-26,341.909988,346.390011,339.740005,340.049999,8847300,48.578571 +NFLX,2014-12-29,335.790009,343.730003,333.570011,341.929989,8588300,48.847141 +NFLX,2014-12-30,341.000008,343.97999600000003,339.769993,343.229992,7011200,49.032856 +NFLX,2014-12-31,343.229992,345.740009,341.510006,341.610008,8627500,48.80143 +NFLX,2015-01-02,344.059998,352.32,341.12001,348.940002,13475000,49.848572 +NFLX,2015-01-05,344.810001,344.810001,330.03001,331.179996,18165000,47.311428 +NFLX,2015-01-06,331.429989,333.47999600000003,319.630013,325.509987,16037700,46.501427 +NFLX,2015-01-07,331.429989,331.950001,323.89999,327.200012,9849700,46.742859 +NFLX,2015-01-08,329.839993,334.849987,325.35001,334.459991,9601900,47.779999 +NFLX,2015-01-09,333.419994,336.140003,328.289997,329.289993,9578100,47.041428 +NFLX,2015-01-12,329.630001,330.389992,316.850002,318.829994,12944400,45.547142 +NFLX,2015-01-13,322.14999,329.340008,321.300011,323.790001,18721500,46.255714 +NFLX,2015-01-14,329.500011,331.589993,319.760002,324.239998,19871600,46.32 +NFLX,2015-01-15,325.829994,327.499992,320.909988,323.759987,11669000,46.251427 +NFLX,2015-01-16,328.000004,337.75,324.669994,337.340004,19696600,48.191429 +NFLX,2015-01-20,340.000011,350,334.000008,348.799999,40551000,49.828571 +NFLX,2015-01-21,414.640011,414.680012,401.869999,409.279995,66902500,58.468571 +NFLX,2015-01-22,410.000011,429.620007,404.799999,428.440006,33319300,61.205715 +NFLX,2015-01-23,426.919998,439.200012,426.169994,437.459999,26784100,62.494286 +NFLX,2015-01-26,438.000011,447.289997,433.699993,446.559994,21268800,63.794285 +NFLX,2015-01-27,441.610001,457.379974,441.349995,454.170021,24612700,64.881432 +NFLX,2015-01-28,453.190025,453.749985,441.57,442.460007,24532900,63.208572 +NFLX,2015-01-29,442.429993,447.490002,437.5,443.800011,15127700,63.400002 +NFLX,2015-01-30,441.930008,447.890011,438.590012,441.799992,13215300,63.114285 +NFLX,2015-02-02,439.900002,443.999989,433.690006,441.069988,12990600,63.009998 +NFLX,2015-02-03,443.239998,458.269981,439.109997,456.919991,16440200,65.274284 +NFLX,2015-02-04,455.289993,456.220001,447.22999600000003,448.709976,12450900,64.101425 +NFLX,2015-02-05,451.789993,455.970009,445.66,448.909981,14248500,64.129997 +NFLX,2015-02-06,449.75,451.000015,442.229988,444.359997,8898400,63.48 +NFLX,2015-02-09,442.389992,446.499992,438.459995,443.070007,8173200,63.295715 +NFLX,2015-02-10,444.219994,456.099998,441.710003,453.949989,15418900,64.849998 +NFLX,2015-02-11,453.810013,462.989983,451.900009,454.889984,13953100,64.984283 +NFLX,2015-02-12,455.409996,459.249977,451.160019,456.730026,8464400,65.247147 +NFLX,2015-02-13,458.000015,466.409981,457.960014,466.100014,12968900,66.585716 +NFLX,2015-02-17,465.610016,471.600006,461.609978,469.960022,11170600,67.137146 +NFLX,2015-02-18,469.160004,476.489998,466.519997,475.060005,10316600,67.865715 +NFLX,2015-02-19,474.999977,481.000008,473.020012,474.600021,10432100,67.800003 +NFLX,2015-02-20,475.649979,478.61998,473.460022,478.199997,9422000,68.314285 +NFLX,2015-02-23,478.100021,478.199997,470.000023,471.840012,9031400,67.405716 +NFLX,2015-02-24,471.609993,476.589973,471.48999,474.879974,6075300,67.839996 +NFLX,2015-02-25,474.650009,481.56002,474.650009,478.329987,6854400,68.332855 +NFLX,2015-02-26,480.38002,486.5,479.010002,483.030014,10852800,69.004288 +NFLX,2015-02-27,483.57,486.000015,474.730011,474.909988,11516400,67.844284 +NFLX,2015-03-02,474.000008,480.249977,470.639984,480.249977,10187100,68.60714 +NFLX,2015-03-03,478.409988,479.20002,472.549988,474.709984,7426300,67.815712 +NFLX,2015-03-04,472.709991,475.479988,463.279976,469.770004,17453800,67.110001 +NFLX,2015-03-05,472.000015,472.250008,464.939987,467.650009,11244800,66.807144 +NFLX,2015-03-06,466.500023,468.479988,453.909988,454.11998,12888400,64.874283 +NFLX,2015-03-09,454.929985,455.650002,439.799999,445.630013,18970700,63.66143 +NFLX,2015-03-10,441.109989,443.460003,433.879997,435.059998,17947300,62.151428 +NFLX,2015-03-11,435.680012,447.57999,435.680012,440.189995,16363200,62.884285 +NFLX,2015-03-12,443.429989,452.079987,443.380001,448.320007,14654500,64.045715 +NFLX,2015-03-13,447.349998,448.400009,436.569992,438.399994,10161200,62.628571 +NFLX,2015-03-16,430.829994,430.829994,417.339993,421.970005,26796000,60.281429 +NFLX,2015-03-17,417.989994,424.860004,415.689995,418.519993,18428200,59.78857 +NFLX,2015-03-18,418.169998,424.550011,415.099995,423.119991,14634900,60.445713 +NFLX,2015-03-19,423.219994,428.480007,421.790001,425.209999,11449900,60.744286 +NFLX,2015-03-20,429.360001,432.499992,426.269997,428.300003,13641600,61.185715 +NFLX,2015-03-23,426.22999600000003,428.090012,422.310013,425.000008,7664300,60.714287 +NFLX,2015-03-24,427.950008,441.690002,427.830006,438.279991,16888900,62.611427 +NFLX,2015-03-25,438.789989,438.840004,421.709999,421.75,21652400,60.25 +NFLX,2015-03-26,417.399994,423.130005,415.72999600000003,418.259987,16039100,59.751427 +NFLX,2015-03-27,415.310013,418.929989,410.009998,414.77,15852200,59.252857 +NFLX,2015-03-30,418.009995,423.949997,415.549992,422.569992,13272700,60.367142 +NFLX,2015-03-31,420.770004,422.939987,416.190006,416.689991,14248500,59.527142 +NFLX,2015-04-01,417.499996,418.499992,410.920006,413.120003,14639800,59.017143 +NFLX,2015-04-02,413.500011,417.250004,412.029991,414.079998,9864400,59.154285 +NFLX,2015-04-06,411.37999,423.130005,409.250008,422.310013,10730300,60.330002 +NFLX,2015-04-07,423.48,425.940002,420.300007,423.459999,9977100,60.494286 +NFLX,2015-04-08,428.409992,441.750004,428.289989,441.349995,22327900,63.049999 +NFLX,2015-04-09,441,441.950008,434.799992,439.499992,13455400,62.785713 +NFLX,2015-04-10,450.779984,454.969986,447.630005,454.569977,22367100,64.938568 +NFLX,2015-04-13,470.679985,484.999992,469.400009,474.680023,44436700,67.811432 +NFLX,2015-04-14,481.999977,484.000023,471.949974,478.710022,28641900,68.387146 +NFLX,2015-04-15,480.929993,480.929993,471.550018,475.460014,42528500,67.922859 +NFLX,2015-04-16,532,568.75,530.000008,562.04998,104500900,80.292854 +NFLX,2015-04-17,558.450005,575.000023,558.000008,571.550011,58306500,81.650002 +NFLX,2015-04-20,572.499992,576.129982,562.670021,567.390022,30766400,81.055717 +NFLX,2015-04-21,568.639984,570.389984,558.600021,560.44001,15925700,80.062859 +NFLX,2015-04-22,561.47998,564.990021,556.81002,557.68,12089700,79.668571 +NFLX,2015-04-23,557.590012,562.400002,552.68998,559.060005,12687500,79.865715 +NFLX,2015-04-24,561.210014,565.659996,556.549988,558.400017,11045300,79.771431 +NFLX,2015-04-27,562.04998,572.499992,561.610023,566.079979,15246700,80.868568 +NFLX,2015-04-28,564.129974,568.950005,559.609978,563.05999,8826300,80.437141 +NFLX,2015-04-29,560.489998,567.390022,557.51001,562.849998,9534700,80.407143 +NFLX,2015-04-30,561.660011,565.850014,553.86998,556.5,10565100,79.5 +NFLX,2015-05-01,558.98999,559.769981,552.26001,557.029999,8906100,79.575714 +NFLX,2015-05-04,556.999985,558.000008,552.300011,554.900017,7967400,79.271431 +NFLX,2015-05-05,568.669998,577.099991,565.299988,565.54998,27116600,80.792854 +NFLX,2015-05-06,567.200005,568.500008,556.650017,560.539986,11504500,80.077141 +NFLX,2015-05-07,560.800018,565.56002,556.20002,565.240013,10220700,80.748573 +NFLX,2015-05-08,567.289993,575.069984,566.750008,574.600014,13828500,82.085716 +NFLX,2015-05-11,576.270012,593.999977,575.300003,589.950005,23882600,84.278572 +NFLX,2015-05-12,586.659996,586.659996,580.950012,583.640007,11907000,83.377144 +NFLX,2015-05-13,583.830025,589.380005,578.840004,580.109993,11155900,82.872856 +NFLX,2015-05-14,582.999992,587.470001,576.310013,586.850014,8898400,83.835716 +NFLX,2015-05-15,604.550018,618.440002,600.290001,613.249977,37053100,87.60714 +NFLX,2015-05-18,612.81002,619.740005,609.169991,617.870003,14812000,88.267143 +NFLX,2015-05-19,622.220009,628.499992,614.669983,616.480011,19101600,88.068573 +NFLX,2015-05-20,617.500008,623.760017,611.539978,621.530006,12756800,88.790001 +NFLX,2015-05-21,623.57,626.999985,617.269989,623.019974,12767300,89.002853 +NFLX,2015-05-22,624.250015,625.849998,620.849991,621.869987,7466200,88.83857 +NFLX,2015-05-26,622.11998,623.430023,614.499992,615.950012,9646000,87.992859 +NFLX,2015-05-27,617.000023,629.349998,615.500015,628.999977,10506300,89.85714 +NFLX,2015-05-28,628.000008,628.98999,622.510002,626.549988,7821800,89.507141 +NFLX,2015-05-29,626.309982,631.43998,622.68998,624.059998,12712000,89.151428 +NFLX,2015-06-01,621.860001,623.850006,615.609978,623.019974,9926000,89.002853 +NFLX,2015-06-02,620.97998,627.750015,618.840012,623.909981,7529200,89.129997 +NFLX,2015-06-03,624.700012,628.129997,620.51001,621.659996,6223700,88.808571 +NFLX,2015-06-04,618.649994,626.000015,616.29998,625.440002,10074400,89.348572 +NFLX,2015-06-05,624.500008,633.780006,623.88002,633.219994,11624200,90.459999 +NFLX,2015-06-08,635.000008,635.709984,622.969986,627.230003,11148900,89.604286 +NFLX,2015-06-09,625.339973,649.000008,625.339973,647.149979,22024800,92.449997 +NFLX,2015-06-10,653.769997,692.790009,652.580009,671.100006,57121400,95.871429 +NFLX,2015-06-11,678.229996,678.43,658.610001,665.659988,26623100,95.094284 +NFLX,2015-06-12,664.410027,667.400002,658.86998,660.93,10278800,94.418571 +NFLX,2015-06-15,649.999977,655.140015,641.609985,654.019989,19054000,93.431427 +NFLX,2015-06-16,659.700012,669.249977,655.840004,666.910004,16043300,95.272858 +NFLX,2015-06-17,665.930008,665.930008,657.70002,659.900017,9905000,94.271431 +NFLX,2015-06-18,662.559998,667.390015,660.579979,663.200012,8962800,94.742859 +NFLX,2015-06-19,673.700012,674.93,656.749985,657.100006,19814900,93.871429 +NFLX,2015-06-22,665.29998,676.849991,659.319977,674.899986,16732800,96.414284 +NFLX,2015-06-23,674.350014,681.729996,670.25,681.19001,15626100,97.312859 +NFLX,2015-06-24,700.099976,706.239983,674.779984,678.609978,77138600,96.944283 +NFLX,2015-06-25,668.37001,672,654.210007,664.239983,41623400,94.891426 +NFLX,2015-06-26,667.100021,667.199997,651.619987,651.619987,30314900,93.08857 +NFLX,2015-06-29,640.540001,650.389999,637.819992,645.62001,24575600,92.23143 +NFLX,2015-06-30,653.499977,660.48999,649.499992,656.940002,16880500,93.848572 +NFLX,2015-07-01,663.640022,666.669998,652.530022,655.449982,14699300,93.635712 +NFLX,2015-07-02,657.990013,659.389992,652.500008,658.31002,11053000,94.044289 +NFLX,2015-07-06,654.309982,664.500015,653.379974,661.999985,11808300,94.571426 +NFLX,2015-07-07,665.089989,667.989975,648.359993,658.640015,21573300,94.091431 +NFLX,2015-07-08,654.299995,657.969986,645.990005,654.549988,12990600,93.507141 +NFLX,2015-07-09,664.300011,670.919975,659.999992,670.089996,16076900,95.727142 +NFLX,2015-07-10,682.660004,689.519974,678.300011,680.599983,21636300,97.228569 +NFLX,2015-07-13,686.690002,716.159996,686.550026,707.610001,33205200,101.087143 +NFLX,2015-07-14,708.900017,711.449982,697.569984,702.600006,19736500,100.371429 +NFLX,2015-07-15,99.970001,100.75,97.050003,98.129997,30898600,98.129997 +NFLX,2015-07-16,111.019997,116.489998,107.68,115.809998,63461000,115.809998 +NFLX,2015-07-17,117.339996,117.879997,114.239998,114.769997,25136900,114.769997 +NFLX,2015-07-20,114.699997,114.699997,110.139999,110.550003,22676900,110.550003 +NFLX,2015-07-21,110.209999,113.709999,109.32,112.510002,14085400,112.510002 +NFLX,2015-07-22,112.139999,113.879997,110.559998,111.5,10500500,111.5 +NFLX,2015-07-23,110.910004,112.18,109.839996,110.099998,8306800,110.099998 +NFLX,2015-07-24,111.550003,111.68,108.900002,109.339996,8125100,109.339996 +NFLX,2015-07-27,107.790001,109.860001,106.25,106.43,11302600,106.43 +NFLX,2015-07-28,107.290001,107.940002,103.879997,106.900002,11155900,106.900002 +NFLX,2015-07-29,106.830002,107.75,105.400002,107.080002,6695600,107.080002 +NFLX,2015-07-30,106.400002,111.900002,105.400002,111.559998,14229200,111.559998 +NFLX,2015-07-31,111.949997,115,111.150002,114.309998,16349100,114.309998 +NFLX,2015-08-03,114.599998,114.599998,111.779999,112.559998,10144800,112.559998 +NFLX,2015-08-04,113.150002,122.790001,113,121.150002,29653300,121.150002 +NFLX,2015-08-05,125.620003,129.289993,122.709999,123.709999,26946500,123.709999 +NFLX,2015-08-06,126.290001,128.850006,122.040001,126.449997,24716700,126.449997 +NFLX,2015-08-07,126.419998,126.599998,121.300003,123.519997,17360700,123.519997 +NFLX,2015-08-10,126.089996,126.5,121.510002,123.029999,13424600,123.029999 +NFLX,2015-08-11,120.010002,123.760002,120,122.739998,11596800,122.739998 +NFLX,2015-08-12,121.470001,122.449997,118.660004,120.510002,13822500,120.510002 +NFLX,2015-08-13,120.989998,125.730003,119.339996,123.730003,15284400,123.730003 +NFLX,2015-08-14,124.959999,125,123,123.389999,8667700,123.389999 +NFLX,2015-08-17,123.139999,125.699997,122.589996,125.360001,9233800,125.360001 +NFLX,2015-08-18,125.260002,126.75,123.550003,124.050003,9382000,124.050003 +NFLX,2015-08-19,123.5,123.699997,121.5,122.059998,9679900,122.059998 +NFLX,2015-08-20,119.800003,121.449997,111.339996,112.489998,28045300,112.489998 +NFLX,2015-08-21,106.199997,110,102.75,103.959999,33228300,103.959999 +NFLX,2015-08-24,88.75,109.629997,85.5,96.879997,59951900,96.879997 +NFLX,2015-08-25,107.75,107.879997,101.5,101.519997,37620700,101.519997 +NFLX,2015-08-26,107.150002,110.279999,102.019997,110.129997,36164600,110.129997 +NFLX,2015-08-27,114.940002,118.25,113.019997,117.660004,37056100,117.660004 +NFLX,2015-08-28,116.349998,119.349998,115.879997,117.629997,20240200,117.629997 +NFLX,2015-08-31,115.239998,117,113.760002,115.029999,17005600,115.029999 +NFLX,2015-09-01,109.349998,111.239998,103.82,105.790001,35977100,105.790001 +NFLX,2015-09-02,109.309998,109.5,100.300003,105.440002,39843300,105.440002 +NFLX,2015-09-03,102.690002,104.169998,100.110001,101.059998,29546700,101.059998 +NFLX,2015-09-04,98.050003,99.93,97.339996,98.790001,24212000,98.790001 +NFLX,2015-09-08,102.080002,102.5,93.550003,94.949997,43479700,94.949997 +NFLX,2015-09-09,96.510002,102.790001,95.519997,99.18,35524400,99.18 +NFLX,2015-09-10,99.419998,100.849998,96.779999,99.480003,21031900,99.480003 +NFLX,2015-09-11,98.57,100.849998,97.230003,97.510002,17373900,97.510002 +NFLX,2015-09-14,96.839996,97.910004,94.330002,95.690002,15546000,95.690002 +NFLX,2015-09-15,95.220001,99.650002,93.610001,99.160004,22591100,99.160004 +NFLX,2015-09-16,99.699997,104.480003,99.330002,104.080002,28058200,104.080002 +NFLX,2015-09-17,103.669998,107.5,101.830002,104.209999,25817700,104.209999 +NFLX,2015-09-18,102,104.360001,100.709999,102.620003,21715000,102.620003 +NFLX,2015-09-21,103.300003,103.769997,99.559998,100.300003,17900600,100.300003 +NFLX,2015-09-22,98.290001,99.900002,97,98.470001,16717900,98.470001 +NFLX,2015-09-23,98.599998,99.739998,97.660004,98.07,10264500,98.07 +NFLX,2015-09-24,97.110001,104,96.779999,103.760002,21274500,103.760002 +NFLX,2015-09-25,105.300003,105.449997,101.57,102.239998,19066600,102.239998 +NFLX,2015-09-28,101.57,103.330002,97.839996,99.470001,17026600,99.470001 +NFLX,2015-09-29,99.629997,100.629997,96.849998,98.349998,17405900,98.349998 +NFLX,2015-09-30,99.910004,103.459999,99.050003,103.260002,17027600,103.260002 +NFLX,2015-10-01,102.910004,106.110001,101.120003,105.980003,17426900,105.980003 +NFLX,2015-10-02,103.010002,106.870003,101.449997,106.110001,21526700,106.110001 +NFLX,2015-10-05,107.480003,112.279999,105.760002,111.25,21157900,111.25 +NFLX,2015-10-06,110.330002,112.25,105.639999,108.330002,20629800,108.330002 +NFLX,2015-10-07,108.839996,109.779999,106.75,108.099998,12329500,108.099998 +NFLX,2015-10-08,107.940002,115.050003,102.599998,114.93,42831900,114.93 +NFLX,2015-10-09,114.110001,115.830002,112.440002,113.330002,22455200,113.330002 +NFLX,2015-10-12,114.449997,115.419998,112.360001,113.449997,12624500,113.449997 +NFLX,2015-10-13,112.849998,113.720001,108.779999,109.730003,17512100,109.730003 +NFLX,2015-10-14,111.5,111.629997,108.050003,110.230003,33231500,110.230003 +NFLX,2015-10-15,103.769997,104.879997,99.099998,101.089996,48484300,101.089996 +NFLX,2015-10-16,100.209999,101.650002,98.410004,98.989998,21340500,98.989998 +NFLX,2015-10-19,98.07,103.620003,96.260002,101.690002,29964700,101.690002 +NFLX,2015-10-20,101.059998,102.110001,97.580002,98.989998,17285300,98.989998 +NFLX,2015-10-21,99.669998,100.339996,97.010002,97.959999,13728500,97.959999 +NFLX,2015-10-22,98.07,99.93,96.860001,97.32,12786800,97.32 +NFLX,2015-10-23,97.610001,101.559998,97.269997,100.040001,18019900,100.040001 +NFLX,2015-10-26,100.050003,103.309998,99.379997,103.040001,12234800,103.040001 +NFLX,2015-10-27,102.580002,104.720001,101.230003,103.07,12066400,103.07 +NFLX,2015-10-28,102.900002,106.209999,102.059998,105.800003,13094000,105.800003 +NFLX,2015-10-29,105,106.910004,104.75,105.120003,9841400,105.120003 +NFLX,2015-10-30,105.120003,110.099998,104.900002,108.379997,15571500,108.379997 +NFLX,2015-11-02,109.199997,109.370003,106.300003,107.639999,11784600,107.639999 +NFLX,2015-11-03,107.360001,111.050003,107.239998,109.739998,12484100,109.739998 +NFLX,2015-11-04,110.360001,114.279999,109.389999,114.050003,17505000,114.050003 +NFLX,2015-11-05,113.75,115.68,111.720001,113.5,13814900,113.5 +NFLX,2015-11-06,113.389999,114.800003,112.050003,114.059998,10936600,114.059998 +NFLX,2015-11-09,113.360001,114,108.639999,109.860001,16154600,109.860001 +NFLX,2015-11-10,108.860001,112.839996,108.010002,112.699997,11166400,112.699997 +NFLX,2015-11-11,113.080002,114.610001,111.410004,112.860001,11039200,112.860001 +NFLX,2015-11-12,112.519997,115.25,108.199997,108.919998,17568200,108.919998 +NFLX,2015-11-13,108.339996,109.07,103.269997,103.650002,18819400,103.650002 +NFLX,2015-11-16,102.970001,111.650002,101.860001,111.349998,19866200,111.349998 +NFLX,2015-11-17,112.110001,118.790001,111.699997,117.099998,33016300,117.099998 +NFLX,2015-11-18,117.940002,121,116.099998,120.629997,23353600,120.629997 +NFLX,2015-11-19,120.25,123.129997,119.610001,120.220001,19253200,120.220001 +NFLX,2015-11-20,120.849998,124.07,119.209999,123.839996,17977000,123.839996 +NFLX,2015-11-23,124.300003,126.199997,121.660004,125.029999,15727000,125.029999 +NFLX,2015-11-24,123.669998,124.660004,120.029999,123.309998,18335300,123.309998 +NFLX,2015-11-25,124.230003,125.199997,122.360001,124.160004,10980700,124.160004 +NFLX,2015-11-27,123.849998,126.389999,123.589996,125.440002,6645500,125.440002 +NFLX,2015-11-30,126.029999,126.599998,122.889999,123.330002,13894000,123.330002 +NFLX,2015-12-01,124.470001,125.57,122.419998,125.370003,12550800,125.370003 +NFLX,2015-12-02,125.529999,131.350006,124.93,128.929993,24105700,128.929993 +NFLX,2015-12-03,129.619995,132.199997,126.389999,126.809998,26647300,126.809998 +NFLX,2015-12-04,127,130.990005,125.75,130.929993,20250400,130.929993 +NFLX,2015-12-07,131.190002,133.270004,122.75,125.360001,23351600,125.360001 +NFLX,2015-12-08,121.510002,128.240005,121.099998,126.980003,18591100,126.980003 +NFLX,2015-12-09,127.699997,128.779999,122.330002,124.199997,17788800,124.199997 +NFLX,2015-12-10,124.5,125.209999,121.620003,122.910004,13437500,122.910004 +NFLX,2015-12-11,121.449997,123,118.599998,118.910004,16105300,118.910004 +NFLX,2015-12-14,119.769997,120.900002,114.660004,120.669998,18679300,120.669998 +NFLX,2015-12-15,121.93,123.300003,118.540001,118.599998,11760000,118.599998 +NFLX,2015-12-16,119.800003,123,118.089996,122.639999,13181000,122.639999 +NFLX,2015-12-17,123.970001,126.349998,122.419998,122.510002,17284900,122.510002 +NFLX,2015-12-18,120.849998,122.190002,117.919998,118.019997,17948100,118.019997 +NFLX,2015-12-21,119.510002,119.589996,115.660004,116.629997,11670000,116.629997 +NFLX,2015-12-22,117.300003,117.43,114.860001,116.239998,9689000,116.239998 +NFLX,2015-12-23,116.910004,118.559998,115.779999,118.160004,9324300,118.160004 +NFLX,2015-12-24,118.220001,118.800003,117.300003,117.330002,3531300,117.330002 +NFLX,2015-12-28,117.260002,117.349998,113.849998,117.110001,8424300,117.110001 +NFLX,2015-12-29,118.190002,119.599998,116.919998,119.120003,8159200,119.120003 +NFLX,2015-12-30,118.949997,119.019997,116.43,116.709999,8149700,116.709999 +NFLX,2015-12-31,116.209999,117.459999,114.279999,114.379997,9245000,114.379997 +NFLX,2016-01-04,109,110,105.209999,109.959999,20794800,109.959999 +NFLX,2016-01-05,110.449997,110.580002,105.849998,107.660004,17664600,107.660004 +NFLX,2016-01-06,105.290001,117.910004,104.959999,117.68,33045700,117.68 +NFLX,2016-01-07,116.360001,122.18,112.290001,114.559998,33636700,114.559998 +NFLX,2016-01-08,116.330002,117.720001,111.099998,111.389999,18067100,111.389999 +NFLX,2016-01-11,112.129997,116.790001,111.199997,114.970001,21920400,114.970001 +NFLX,2016-01-12,116.110001,117.779999,115.080002,116.580002,15133500,116.580002 +NFLX,2016-01-13,114.43,114.480003,104.529999,106.559998,24921600,106.559998 +NFLX,2016-01-14,105.650002,109.25,101.209999,107.059998,23664800,107.059998 +NFLX,2016-01-15,102.43,105.5,101.720001,104.040001,19651300,104.040001 +NFLX,2016-01-19,106.57,110.139999,105.550003,107.889999,35722800,107.889999 +NFLX,2016-01-20,108.910004,109.989998,97.050003,107.739998,53009400,107.739998 +NFLX,2016-01-21,108.32,108.510002,102.099998,102.349998,31027500,102.349998 +NFLX,2016-01-22,104.720001,104.989998,99.220001,100.720001,26821800,100.720001 +NFLX,2016-01-25,99.779999,102.68,99,99.120003,20321100,99.120003 +NFLX,2016-01-26,99.739998,100.550003,94.849998,97.830002,22083900,97.830002 +NFLX,2016-01-27,96.610001,97.849998,90.589996,91.150002,25556200,91.150002 +NFLX,2016-01-28,93.839996,95.25,90.110001,94.410004,24562300,94.410004 +NFLX,2016-01-29,92,94.389999,90.629997,91.839996,20463900,91.839996 +NFLX,2016-02-01,91.790001,97.18,91.300003,94.089996,19684500,94.089996 +NFLX,2016-02-02,95.540001,96.650002,90.730003,91.489998,21906500,91.489998 +NFLX,2016-02-03,92.410004,92.690002,86.139999,90.739998,27466000,90.739998 +NFLX,2016-02-04,89.5,91.25,86.540001,89.709999,19108600,89.709999 +NFLX,2016-02-05,88.230003,88.949997,81.860001,82.790001,25929300,82.790001 +NFLX,2016-02-08,80.57,84.699997,79.949997,83.32,25035600,83.32 +NFLX,2016-02-09,81.75,88.400002,81.550003,86.129997,25892900,86.129997 +NFLX,2016-02-10,89,92.209999,87.419998,88.449997,23146500,88.449997 +NFLX,2016-02-11,87.419998,88.389999,82.910004,86.349998,21820300,86.349998 +NFLX,2016-02-12,86.639999,89.720001,85.260002,87.400002,19067700,87.400002 +NFLX,2016-02-16,89,90.139999,87.540001,89.050003,16356600,89.050003 +NFLX,2016-02-17,90.129997,94.769997,89.639999,94.760002,18323800,94.760002 +NFLX,2016-02-18,94.800003,94.900002,90.309998,90.489998,17695300,90.489998 +NFLX,2016-02-19,89.980003,91.400002,88.029999,89.230003,14259200,89.230003 +NFLX,2016-02-22,90.75,93.110001,88.300003,91.93,16321800,91.93 +NFLX,2016-02-23,91.400002,92.489998,89.050003,89.120003,12744400,89.120003 +NFLX,2016-02-24,88.5,91.760002,86.699997,91.610001,15972800,91.610001 +NFLX,2016-02-25,91.080002,94.809998,90.209999,94.529999,17898800,94.529999 +NFLX,2016-02-26,95.300003,97.480003,94.25,94.790001,16975200,94.790001 +NFLX,2016-02-29,94.809998,97.199997,93.339996,93.410004,13663100,93.410004 +NFLX,2016-03-01,94.580002,99.160004,93.610001,98.300003,17048800,98.300003 +NFLX,2016-03-02,98.010002,99.480003,95.900002,97.610001,19102800,97.610001 +NFLX,2016-03-03,97.830002,98.349998,95.389999,97.93,15320900,97.93 +NFLX,2016-03-04,98.760002,102.220001,98.32,101.580002,23414600,101.580002 +NFLX,2016-03-07,101,101.790001,95.25,95.489998,23855200,95.489998 +NFLX,2016-03-08,95,98.279999,94.5,96.230003,14797000,96.230003 +NFLX,2016-03-09,96.82,98.370003,95,98,12298700,98 +NFLX,2016-03-10,98.18,99.739998,95.449997,97.360001,17002100,97.360001 +NFLX,2016-03-11,99.510002,99.599998,96.050003,97.660004,15114300,97.660004 +NFLX,2016-03-14,97.199997,99.419998,97.169998,98.129997,11251900,98.129997 +NFLX,2016-03-15,97.870003,98.510002,96.43,97.860001,9691800,97.860001 +NFLX,2016-03-16,97.529999,99.730003,97.5,99.349998,12630500,99.349998 +NFLX,2016-03-17,99.050003,101.389999,99,99.720001,13825000,99.720001 +NFLX,2016-03-18,100.5,102.410004,100.010002,101.120003,15453500,101.120003 +NFLX,2016-03-21,101.150002,102.099998,99.5,101.059998,9578500,101.059998 +NFLX,2016-03-22,100.480003,101.519997,99.199997,99.839996,9069900,99.839996 +NFLX,2016-03-23,99.75,100.389999,98.809998,99.589996,8313500,99.589996 +NFLX,2016-03-24,98.639999,98.849998,97.07,98.360001,10671100,98.360001 +NFLX,2016-03-28,98.339996,101.440002,97.82,101.209999,12432200,101.209999 +NFLX,2016-03-29,101.080002,104.330002,101,104.129997,16008900,104.129997 +NFLX,2016-03-30,104.650002,104.910004,101.480003,102.190002,14705000,102.190002 +NFLX,2016-03-31,102.43,103.529999,101.050003,102.230003,9747500,102.230003 +NFLX,2016-04-01,102.93,105.790001,102.470001,105.699997,14182400,105.699997 +NFLX,2016-04-04,105.900002,105.919998,103.199997,104.349998,10940400,104.349998 +NFLX,2016-04-05,103.470001,105.75,103.25,104.940002,10060900,104.940002 +NFLX,2016-04-06,105.300003,106.440002,104.25,104.830002,9605800,104.830002 +NFLX,2016-04-07,104.309998,106.440002,103.599998,104.449997,10774900,104.449997 +NFLX,2016-04-08,105.120003,105.330002,102.82,103.809998,7857600,103.809998 +NFLX,2016-04-11,104.040001,104.980003,102.620003,102.68,7451300,102.68 +NFLX,2016-04-12,103.150002,107.220001,102.209999,106.980003,12437000,106.980003 +NFLX,2016-04-13,108,111.279999,107.879997,109.650002,16701700,109.650002 +NFLX,2016-04-14,110.010002,111.639999,109.150002,110.419998,9553700,110.419998 +NFLX,2016-04-15,110.639999,111.849998,109.779999,111.510002,11746100,111.510002 +NFLX,2016-04-18,109.900002,110.699997,106.019997,108.400002,27001500,108.400002 +NFLX,2016-04-19,99.489998,101.370003,94.199997,94.339996,55728800,94.339996 +NFLX,2016-04-20,94.339996,96.980003,93.139999,96.769997,26613500,96.769997 +NFLX,2016-04-21,97.309998,97.379997,94.779999,94.980003,19919400,94.980003 +NFLX,2016-04-22,94.849998,96.690002,94.209999,95.900002,15806300,95.900002 +NFLX,2016-04-25,95.699997,95.75,92.800003,93.559998,14985400,93.559998 +NFLX,2016-04-26,93.5,93.550003,91.25,92.43,15330900,92.43 +NFLX,2016-04-27,92.18,92.5,90.209999,91.040001,12218900,91.040001 +NFLX,2016-04-28,91.5,92.669998,90.089996,90.279999,11474900,90.279999 +NFLX,2016-04-29,90.5,90.559998,88.209999,90.029999,13968000,90.029999 +NFLX,2016-05-02,90.410004,93.220001,89.889999,93.110001,12547000,93.110001 +NFLX,2016-05-03,92.080002,93.25,91.300003,91.540001,10593900,91.540001 +NFLX,2016-05-04,91,92.160004,90.349998,90.790001,7394700,90.790001 +NFLX,2016-05-05,90.910004,92.080002,89.25,89.370003,10368500,89.370003 +NFLX,2016-05-06,88.830002,90.879997,88.110001,90.839996,10427600,90.839996 +NFLX,2016-05-09,90.730003,91.830002,89.900002,90.540001,9543700,90.540001 +NFLX,2016-05-10,91.139999,93.25,91.089996,92.889999,11175900,92.889999 +NFLX,2016-05-11,92.400002,92.589996,89.900002,90.019997,11692900,90.019997 +NFLX,2016-05-12,90.32,90.410004,85.739998,87.739998,20408100,87.739998 +NFLX,2016-05-13,87.389999,88.589996,86.260002,87.879997,11571400,87.879997 +NFLX,2016-05-16,87.559998,90,86.150002,89.120003,11247800,89.120003 +NFLX,2016-05-17,89,90.870003,88.169998,88.629997,11571300,88.629997 +NFLX,2016-05-18,88.25,91.720001,88.25,90.5,13911800,90.5 +NFLX,2016-05-19,90.160004,91.269997,88.300003,89.550003,11450300,89.550003 +NFLX,2016-05-20,90.080002,93.279999,89.980003,92.489998,15063000,92.489998 +NFLX,2016-05-23,92.980003,95.290001,92.849998,94.889999,13992300,94.889999 +NFLX,2016-05-24,95.980003,99.139999,95.75,97.889999,21246000,97.889999 +NFLX,2016-05-25,99,100.309998,98.300003,100.199997,15142900,100.199997 +NFLX,2016-05-26,103.209999,104,101.379997,102.809998,17824700,102.809998 +NFLX,2016-05-27,102.440002,103.5,101.440002,103.300003,9078300,103.300003 +NFLX,2016-05-31,102.949997,103.449997,102.129997,102.57,8725700,102.57 +NFLX,2016-06-01,101.5,101.919998,100.160004,101.510002,8393400,101.510002 +NFLX,2016-06-02,101.389999,102.150002,100.769997,101.25,7992400,101.25 +NFLX,2016-06-03,100.989998,101,98.529999,99.589996,9224000,99.589996 +NFLX,2016-06-06,100.290001,101.07,99.720001,100.739998,6828100,100.739998 +NFLX,2016-06-07,101.199997,101.629997,99.769997,99.889999,6474700,99.889999 +NFLX,2016-06-08,100.019997,100.279999,97.599998,97.860001,9423900,97.860001 +NFLX,2016-06-09,97.220001,98.43,96.660004,97.089996,8923800,97.089996 +NFLX,2016-06-10,94.879997,95.349998,93.279999,93.75,12907900,93.75 +NFLX,2016-06-13,95.019997,97.199997,93.620003,93.849998,13484300,93.849998 +NFLX,2016-06-14,94.160004,95.800003,93.269997,94.120003,9480400,94.120003 +NFLX,2016-06-15,94.610001,95.459999,93.5,94.290001,7675400,94.290001 +NFLX,2016-06-16,94.18,95.559998,93.25,95.440002,7550800,95.440002 +NFLX,2016-06-17,95.75,95.769997,94.199997,94.449997,8046800,94.449997 +NFLX,2016-06-20,95.220001,95.879997,93.650002,93.800003,9026400,93.800003 +NFLX,2016-06-21,93.870003,93.879997,90.769997,90.989998,15199700,90.989998 +NFLX,2016-06-22,90.779999,91.980003,89.769997,90.010002,9454700,90.010002 +NFLX,2016-06-23,90.620003,91.68,88.150002,91.660004,10819000,91.660004 +NFLX,2016-06-24,87.529999,90.489998,87.209999,88.440002,11248600,88.440002 +NFLX,2016-06-27,87.879997,88,84.809998,85.330002,13730500,85.330002 +NFLX,2016-06-28,87.410004,88.879997,86.410004,87.970001,11545600,87.970001 +NFLX,2016-06-29,89.669998,91.970001,88.699997,91.059998,11687100,91.059998 +NFLX,2016-06-30,90.910004,91.720001,89.900002,91.480003,9099000,91.480003 +NFLX,2016-07-01,95,97,94.800003,96.669998,16167200,96.669998 +NFLX,2016-07-05,95.199997,101.269997,93.309998,97.910004,25879400,97.910004 +NFLX,2016-07-06,95.029999,96,93.550003,94.599998,16301200,94.599998 +NFLX,2016-07-07,94.699997,95.379997,93.18,95.099998,9913500,95.099998 +NFLX,2016-07-08,96,97.410004,95.300003,97.059998,8335400,97.059998 +NFLX,2016-07-11,96.190002,96.870003,94.300003,94.669998,13276200,94.669998 +NFLX,2016-07-12,95.07,96.720001,94.089996,95.970001,11617400,95.970001 +NFLX,2016-07-13,96.260002,96.720001,94.800003,96.43,8768900,96.43 +NFLX,2016-07-14,97,98.269997,96.800003,98.019997,9885000,98.019997 +NFLX,2016-07-15,98.519997,98.699997,97.410004,98.389999,9041900,98.389999 +NFLX,2016-07-18,98.43,99.839996,97.239998,98.809998,28669700,98.809998 +NFLX,2016-07-19,85.43,86.75,84.5,85.839996,55681200,85.839996 +NFLX,2016-07-20,86.669998,88.489998,85.82,87.910004,23525100,87.910004 +NFLX,2016-07-21,88.300003,88.379997,85.209999,85.989998,16084000,85.989998 +NFLX,2016-07-22,86.480003,86.5,85.110001,85.889999,11363900,85.889999 +NFLX,2016-07-25,85.730003,87.870003,85.010002,87.660004,14135000,87.660004 +NFLX,2016-07-26,91.029999,93.099998,90.900002,91.410004,19577600,91.410004 +NFLX,2016-07-27,91.5,92.059998,90.099998,92.040001,8727500,92.040001 +NFLX,2016-07-28,91.919998,92.209999,90.68,91.650002,6227700,91.650002 +NFLX,2016-07-29,91.190002,91.75,90.589996,91.25,6960200,91.25 +NFLX,2016-08-01,91.230003,94.669998,90.5,94.370003,10666900,94.370003 +NFLX,2016-08-02,94,94.080002,92.18,93.559998,9836200,93.559998 +NFLX,2016-08-03,93.279999,94.669998,92.550003,93.099998,7030900,93.099998 +NFLX,2016-08-04,93.199997,93.730003,91.82,93.440002,6043400,93.440002 +NFLX,2016-08-05,93.769997,97.739998,93.559998,97.029999,18364800,97.029999 +NFLX,2016-08-08,95.910004,95.93,94,95.110001,10135400,95.110001 +NFLX,2016-08-09,95.120003,95.809998,93.480003,93.989998,9175400,93.989998 +NFLX,2016-08-10,94.400002,94.75,92.949997,93.93,6511100,93.93 +NFLX,2016-08-11,94.599998,96.330002,94.370003,95.889999,8547700,95.889999 +NFLX,2016-08-12,95.529999,96.830002,95.080002,96.589996,6592900,96.589996 +NFLX,2016-08-15,96.830002,96.910004,95.239998,95.309998,7304600,95.309998 +NFLX,2016-08-16,95.190002,95.610001,94.400002,95.120003,6311300,95.120003 +NFLX,2016-08-17,94.940002,96.93,94.849998,96.370003,8315600,96.370003 +NFLX,2016-08-18,95.980003,97.220001,95.169998,96.160004,7252600,96.160004 +NFLX,2016-08-19,96.050003,96.779999,95.510002,95.870003,6942900,95.870003 +NFLX,2016-08-22,95.669998,96.129997,94.949997,95.260002,5830500,95.260002 +NFLX,2016-08-23,95.68,96.589996,95.480003,95.940002,5239100,95.940002 +NFLX,2016-08-24,96.129997,96.360001,94.910004,95.18,6276500,95.18 +NFLX,2016-08-25,96.379997,98.25,96.040001,97.32,10823100,97.32 +NFLX,2016-08-26,97.330002,97.949997,96.57,97.580002,6617600,97.580002 +NFLX,2016-08-29,96.970001,98.449997,96.57,97.300003,8008400,97.300003 +NFLX,2016-08-30,97.839996,98.849998,97.139999,97.449997,6093500,97.449997 +NFLX,2016-08-31,97.480003,97.879997,96.760002,97.449997,4690600,97.449997 +NFLX,2016-09-01,97.809998,97.980003,96.919998,97.379997,4148600,97.379997 +NFLX,2016-09-02,97.900002,98.18,97.010002,97.379997,4247200,97.379997 +NFLX,2016-09-06,97.760002,100.32,97.650002,100.089996,9036100,100.089996 +NFLX,2016-09-07,100.110001,100.190002,98.419998,99.150002,6468500,99.150002 +NFLX,2016-09-08,99.230003,100.050003,98.82,99.660004,5201200,99.660004 +NFLX,2016-09-09,99.059998,99.389999,96.5,96.5,7373300,96.5 +NFLX,2016-09-12,95.910004,99.290001,95.709999,99.050003,7718400,99.050003 +NFLX,2016-09-13,97.169998,98,95.330002,96.089996,11788100,96.089996 +NFLX,2016-09-14,97.349998,98.349998,96.959999,97.010002,8481000,97.010002 +NFLX,2016-09-15,97.230003,97.970001,96.529999,97.339996,5293500,97.339996 +NFLX,2016-09-16,97.099998,99.489998,97.040001,99.480003,9445100,99.480003 +NFLX,2016-09-19,99.900002,100.349998,97.82,98.059998,8616200,98.059998 +NFLX,2016-09-20,98.779999,99.160004,97.660004,98.25,4736800,98.25 +NFLX,2016-09-21,96.900002,97.099998,93.260002,94.879997,20042200,94.879997 +NFLX,2016-09-22,95.540001,95.879997,94.230003,95.830002,11215000,95.830002 +NFLX,2016-09-23,95.75,96.970001,95.43,95.940002,6179500,95.940002 +NFLX,2016-09-26,95.379997,95.379997,94.040001,94.559998,6739200,94.559998 +NFLX,2016-09-27,95.040001,97.639999,95,97.07,9680100,97.07 +NFLX,2016-09-28,97.099998,97.589996,96.019997,97.480003,7235100,97.480003 +NFLX,2016-09-29,97.309998,98.309998,96.599998,96.669998,6217600,96.669998 +NFLX,2016-09-30,96.900002,99.529999,96.790001,98.550003,9807900,98.550003 +NFLX,2016-10-03,98,103.389999,98,102.629997,15344500,102.629997 +NFLX,2016-10-04,103.190002,104.440002,101.860001,102.339996,12143100,102.339996 +NFLX,2016-10-05,103.5,106.970001,103.43,106.279999,12942900,106.279999 +NFLX,2016-10-06,104.970001,105.470001,103.879997,105.07,6587700,105.07 +NFLX,2016-10-07,103.980003,106.5,103.550003,104.82,8659500,104.82 +NFLX,2016-10-10,103.18,104.529999,102.760002,103.330002,6699700,103.330002 +NFLX,2016-10-11,102.309998,102.900002,99.860001,100.589996,9032900,100.589996 +NFLX,2016-10-12,100.879997,102.470001,99.220001,99.5,7426500,99.5 +NFLX,2016-10-13,98.010002,100.5,97.629997,100.230003,8319300,100.230003 +NFLX,2016-10-14,101.589996,102.099998,100.349998,101.470001,9531100,101.470001 +NFLX,2016-10-17,100.5,100.730003,98.379997,99.800003,26589500,99.800003 +NFLX,2016-10-18,116.629997,119.82,116.5,118.790001,42168200,118.790001 +NFLX,2016-10-19,118.25,122.449997,118,121.870003,21981700,121.870003 +NFLX,2016-10-20,121.970001,123.75,121.059998,123.349998,14492800,123.349998 +NFLX,2016-10-21,122.5,127.849998,122.309998,127.5,18832400,127.5 +NFLX,2016-10-24,127.419998,129.289993,126.150002,127.330002,15980700,127.330002 +NFLX,2016-10-25,126.519997,128.059998,125.75,126.510002,8253900,126.510002 +NFLX,2016-10-26,126.290001,128.720001,125.75,126.970001,8602400,126.970001 +NFLX,2016-10-27,127.43,128.179993,125.93,126.470001,6914200,126.470001 +NFLX,2016-10-28,126.080002,128.929993,126.010002,126.57,7077300,126.57 +NFLX,2016-10-31,126.849998,126.900002,124.400002,124.870003,6517500,124.870003 +NFLX,2016-11-01,124.980003,125.830002,121.800003,123.300003,6978600,123.300003 +NFLX,2016-11-02,122.830002,124.07,121.830002,122.339996,4816500,122.339996 +NFLX,2016-11-03,122.309998,123.720001,121.839996,122.139999,5041300,122.139999 +NFLX,2016-11-04,122,123.43,121.620003,122.029999,5077700,122.029999 +NFLX,2016-11-07,124.260002,125.75,123.370003,124.580002,5827100,124.580002 +NFLX,2016-11-08,124.120003,125.809998,123.220001,124.339996,4667300,124.339996 +NFLX,2016-11-09,121.839996,123.650002,120.860001,122.190002,7705700,122.190002 +NFLX,2016-11-10,122.760002,122.970001,113.699997,115.419998,19718700,115.419998 +NFLX,2016-11-11,114.900002,116.629997,113.110001,114.779999,11070900,114.779999 +NFLX,2016-11-14,114.75,115.900002,110.68,113.379997,9932400,113.379997 +NFLX,2016-11-15,114.550003,116.410004,113.089996,113.589996,7445100,113.589996 +NFLX,2016-11-16,112.959999,116.120003,111.809998,115.190002,5933700,115.190002 +NFLX,2016-11-17,115.129997,116.809998,113.559998,115.029999,6232700,115.029999 +NFLX,2016-11-18,115.730003,116.419998,113.510002,115.209999,6746800,115.209999 +NFLX,2016-11-21,116.199997,118.720001,116.190002,117.959999,7064500,117.959999 +NFLX,2016-11-22,118.32,119.459999,116.980003,118.040001,7007200,118.040001 +NFLX,2016-11-23,117.760002,118.889999,117.309998,117.690002,4521300,117.690002 +NFLX,2016-11-25,117.639999,118.389999,117.18,117.410004,1616300,117.410004 +NFLX,2016-11-28,117.050003,117.620003,115.709999,116.93,5278900,116.93 +NFLX,2016-11-29,117.300003,119.18,117.129997,117.510002,7082300,117.510002 +NFLX,2016-11-30,119,120.370003,116.389999,117,7715100,117 +NFLX,2016-12-01,117.519997,118.68,113.949997,117.220001,8636900,117.220001 +NFLX,2016-12-02,116.75,120.980003,116.75,120.809998,8928900,120.809998 +NFLX,2016-12-05,120.730003,120.75,118.400002,119.160004,7614400,119.160004 +NFLX,2016-12-06,120.099998,124.790001,119.419998,124.57,11476600,124.57 +NFLX,2016-12-07,124.480003,125.75,123.25,125.389999,8170100,125.389999 +NFLX,2016-12-08,125.400002,126.349998,122.160004,123.239998,8982500,123.239998 +NFLX,2016-12-09,123.779999,124.300003,121.730003,122.879997,4694500,122.879997 +NFLX,2016-12-12,122.839996,124.029999,122.300003,122.830002,3906300,122.830002 +NFLX,2016-12-13,123.510002,125.089996,122.779999,123.779999,5523400,123.779999 +NFLX,2016-12-14,123.43,124.400002,122.5,123.440002,6065200,123.440002 +NFLX,2016-12-15,123.440002,127.43,122.949997,125,7372400,125 +NFLX,2016-12-16,126.389999,126.68,124.010002,124.220001,7821700,124.220001 +NFLX,2016-12-19,124.300003,126.440002,122.870003,125.449997,4828200,125.449997 +NFLX,2016-12-20,125.459999,126.300003,124.639999,125.120003,3932100,125.120003 +NFLX,2016-12-21,125.529999,127.739998,125,126.5,6497200,126.5 +NFLX,2016-12-22,126.839996,127.5,125.18,125.580002,4160700,125.580002 +NFLX,2016-12-23,125.610001,126.279999,125.080002,125.589996,2002100,125.589996 +NFLX,2016-12-27,126.239998,129.050003,125.699997,128.350006,5276200,128.350006 +NFLX,2016-12-28,129.070007,129.070007,125.760002,125.889999,4366700,125.889999 +NFLX,2016-12-29,125.949997,126.139999,124.199997,125.330002,3443700,125.330002 +NFLX,2016-12-30,126.239998,126.57,123.599998,123.800003,4426500,123.800003 +GOOG,2013-01-02,719.421247,727.001263,716.551211,723.25123,5101500,361.264351 +GOOG,2013-01-03,724.931273,731.931241,720.721209,723.671256,4653700,361.474154 +GOOG,2013-01-04,729.341243,741.471277,727.681232,737.971262,5547600,368.617014 +GOOG,2013-01-07,735.451289,739.381254,730.581227,734.751286,3323800,367.008634 +GOOG,2013-01-08,735.541286,736.301266,724.431236,733.301227,3364700,366.284329 +GOOG,2013-01-09,732.271256,738.351283,728.601234,738.121237,4064500,368.691926 +GOOG,2013-01-10,742.831277,745.001249,733.501254,741.481263,3685000,370.370261 +GOOG,2013-01-11,742.001272,742.431284,736.301266,739.99126,2579900,369.626004 +GOOG,2013-01-14,737.001269,742.201299,722.351261,723.25123,5749200,361.264351 +GOOG,2013-01-15,719.33125,735.001243,712.101236,724.931273,7884700,362.103533 +GOOG,2013-01-16,722.401253,724.341239,713.67125,715.191211,4061900,357.238367 +GOOG,2013-01-17,717.711246,719.641246,711.021213,711.321223,4439500,355.305306 +GOOG,2013-01-18,710.361215,712.77122,701.331203,704.511235,6477700,351.903714 +GOOG,2013-01-22,704.661209,705.341179,695.521167,702.871197,7613100,351.084514 +GOOG,2013-01-23,735.99127,749.001301,735.791243,741.501296,11862400,370.380268 +GOOG,2013-01-24,741.241291,756.831273,740.511269,754.211317,6790600,376.728929 +GOOG,2013-01-25,750.77128,758.481297,750.251271,753.671274,4468400,376.459178 +GOOG,2013-01-28,751.761307,755.601275,747.891257,750.731274,3266300,374.990647 +GOOG,2013-01-29,746.751256,756.951289,746.541304,753.681322,3507200,376.464197 +GOOG,2013-01-30,753.741299,760.95128,752.911294,753.831296,3478900,376.539109 +GOOG,2013-01-31,750.511275,757.621273,750.251271,755.691272,3280500,377.468168 +GOOG,2013-02-01,758.201321,776.601361,758.101277,775.601349,7520100,387.413261 +GOOG,2013-02-04,767.691304,770.471343,758.271284,759.021279,6103700,379.131508 +GOOG,2013-02-05,761.131335,771.111307,759.471324,765.741331,3755300,382.488177 +GOOG,2013-02-06,759.071331,772.961297,758.501331,770.171333,4171700,384.700966 +GOOG,2013-02-07,769.701316,778.811339,765.501298,773.951324,5701600,386.589073 +GOOG,2013-02-08,780.131334,786.671331,779.561333,785.371369,6062700,392.293391 +GOOG,2013-02-11,778.40136,783.00137,773.751297,782.421322,4351800,390.819841 +GOOG,2013-02-12,781.751339,787.901329,779.371354,780.701335,3731900,389.960707 +GOOG,2013-02-13,780.131334,785.351336,779.971312,782.861321,2405200,391.039621 +GOOG,2013-02-14,779.731341,788.741382,777.771321,787.82138,3483500,393.517173 +GOOG,2013-02-15,787.401353,793.261381,787.071324,792.891346,5480000,396.049623 +GOOG,2013-02-19,795.991368,807.001373,795.281379,806.851398,5885500,403.022676 +GOOG,2013-02-20,805.301357,808.971379,791.79135,792.461334,5549000,395.834832 +GOOG,2013-02-21,798.001379,805.451392,791.22135,795.531336,7039000,397.3683 +GOOG,2013-02-22,799.261397,801.251375,793.801362,799.711381,4123100,399.456234 +GOOG,2013-02-25,802.301379,808.411364,790.491327,790.771365,4625000,394.990692 +GOOG,2013-02-26,795.001341,795.951362,784.401315,790.13134,4421500,394.670999 +GOOG,2013-02-27,794.801375,804.75139,791.111381,799.781345,4067300,399.491181 +GOOG,2013-02-28,801.101401,806.991387,801.031376,801.201384,4548500,400.200491 +GOOG,2013-03-01,797.801352,807.141361,796.151389,806.191401,4367000,402.693007 +GOOG,2013-03-04,805.301357,822.841434,805.001408,821.501406,5571900,410.340363 +GOOG,2013-03-05,828.931447,840.151465,828.901428,838.601424,8118400,418.88183 +GOOG,2013-03-06,841.031462,844.00142,828.811431,831.381396,5767400,415.275422 +GOOG,2013-03-07,834.061452,836.621431,829.581397,832.601408,4120700,415.884819 +GOOG,2013-03-08,834.501451,834.921415,825.051412,831.521445,5845600,415.345377 +GOOG,2013-03-11,831.691453,839.701419,831.501412,834.821433,3201200,416.993723 +GOOG,2013-03-12,830.711412,831.891419,823.671439,827.611391,4031600,413.392303 +GOOG,2013-03-13,827.901415,830.69143999999994,822.311439,825.311416,3294800,412.243465 +GOOG,2013-03-14,826.991399,826.991399,817.391385,821.541411,3314700,410.360345 +GOOG,2013-03-15,818.501429,820.301427,813.341404,814.301411,6222500,406.743962 +GOOG,2013-03-18,805.001408,812.761417,801.471374,807.791372,3690300,403.492194 +GOOG,2013-03-19,811.241395,819.251423,806.451405,811.321406,4212000,405.255448 +GOOG,2013-03-20,816.831371,817.511402,811.441361,814.71139,2938500,406.94874600000003 +GOOG,2013-03-21,811.291387,816.921429,809.851376,811.261367,2966200,405.225458 +GOOG,2013-03-22,814.74141,815.241385,809.641362,810.311407,2987400,404.750953 +GOOG,2013-03-25,812.411416,819.23139,806.821379,809.641362,3436800,404.416265 +GOOG,2013-03-26,813.501426,814.001401,807.791372,812.421402,2392600,405.804896 +GOOG,2013-03-27,806.68139,807.001373,801.331386,802.661367,4342500,400.929754 +GOOG,2013-03-28,803.991409,805.371382,793.301386,794.191369,4592600,396.698985 +GOOG,2013-04-01,795.011388,802.251388,793.251334,801.191398,3628100,400.195503 +GOOG,2013-04-02,804.541376,814.831406,804.001395,813.041394,4098200,406.114582 +GOOG,2013-04-03,813.46142,814.201367,800.671389,806.201387,3489900,402.697995 +GOOG,2013-04-04,804.251352,805.751402,791.301361,795.071366,4913400,397.138544 +GOOG,2013-04-05,786.061325,786.991374,776.401334,783.051362,6893400,391.134546 +GOOG,2013-04-08,778.751362,779.551347,768.401293,774.851354,5685300,387.038638 +GOOG,2013-04-09,775.501304,783.751365,773.111333,777.651304,4330700,388.437215 +GOOG,2013-04-10,782.921359,792.351365,776.001341,790.181331,3971900,394.69597 +GOOG,2013-04-11,792.88136,793.101359,784.061361,790.391345,4072500,394.800871 +GOOG,2013-04-12,791.99137700000006,792.101346,782.931345,790.051329,3285500,394.631034 +GOOG,2013-04-15,785.951356,797.001366,777.021326,781.931333,4924500,390.575091 +GOOG,2013-04-16,786.59132,796.001354,783.921372,793.37135,3496900,396.289386 +GOOG,2013-04-17,786.751342,790.841329,778.10135,782.561372,4089100,390.889796 +GOOG,2013-04-18,785.351336,785.80132,761.261276,765.911339,6669800,382.573096 +GOOG,2013-04-19,769.161334,803.441381,766.26134,799.871342,11649800,399.536135 +GOOG,2013-04-22,800.601364,803.96139,775.001329,800.111374,5788300,399.656031 +GOOG,2013-04-23,801.001357,815.50139,800.361393,807.901403,4601600,403.547154 +GOOG,2013-04-24,808.111416,818.001391,808.001385,813.451373,3671800,406.319367 +GOOG,2013-04-25,816.251384,816.471383,807.631412,809.101381,3999200,404.146544 +GOOG,2013-04-26,807.601393,807.741381,796.58134,801.421383,4993900,400.310381 +GOOG,2013-04-29,803.251401,822.701385,803.001382,819.061382,4618800,409.121569 +GOOG,2013-04-30,819.001404,827.64141,817.681409,824.571408,4630600,411.87383 +GOOG,2013-05-01,823.261399,824.721444,816.361415,820.431429,2920800,409.805909 +GOOG,2013-05-02,820.1014,834.551442,819.051396,829.611416,4051600,414.391317 +GOOG,2013-05-03,836.961447,846.801431,836.001439,845.721469,5044000,422.438296 +GOOG,2013-05-06,848.261476,861.851493,848.261476,861.551483,4298500,430.345396 +GOOG,2013-05-07,863.011466,863.871491,850.67148,857.231449,3932600,428.187537 +GOOG,2013-05-08,857.001464,873.881483,852.911477,873.631526,4955000,436.379383 +GOOG,2013-05-09,870.8415,879.6615,868.231468,871.481464,4417600,435.305427 +GOOG,2013-05-10,875.311508,880.541496,872.161495,880.2315,3809500,439.676074 +GOOG,2013-05-13,878.891533,882.471497,873.381507,877.531533,2907700,438.327439 +GOOG,2013-05-14,877.501513,888.691512,877.141526,887.101527,3170300,443.107656 +GOOG,2013-05-15,895.501561,916.38157,894.021545,915.89158,8001600,457.488302 +GOOG,2013-05-16,919.001588,919.981567,902.011539,903.871576,6443200,451.484304 +GOOG,2013-05-17,910.021566,913.491561,900.521536,909.181575,5604800,454.136651 +GOOG,2013-05-20,905.00153,920.601559,905.00153,908.531564,4562300,453.81197 +GOOG,2013-05-21,908.021541,911.661543,897.611556,906.971536,3980700,453.032735 +GOOG,2013-05-22,902.561567,909.311578,886.881527,889.421534,5140300,444.266501 +GOOG,2013-05-23,877.001476,889.961516,874.001499,882.79154,4567200,440.954815 +GOOG,2013-05-24,875.261516,878.821508,871.011508,873.321468,4610700,436.22451 +GOOG,2013-05-28,883.501529,892.141535,880.401508,881.271518,4531900,440.195564 +GOOG,2013-05-29,875.711501,877.991503,864.291456,868.311479,4041800,433.722018 +GOOG,2013-05-30,869.921498,878.901519,866.411498,870.761489,4257200,434.945799 +GOOG,2013-05-31,868.121499,877.001476,867.521479,871.221521,3953500,435.175585 +GOOG,2013-06-03,873.001486,873.97148,855.021472,867.63151,4969900,433.382372 +GOOG,2013-06-04,867.851509,870.591482,854.07145,859.101473,3751100,429.121615 +GOOG,2013-06-05,862.51149,869.45148,857.131466,859.701493,4229300,429.421325 +GOOG,2013-06-06,864.301503,866.331487,847.221457,864.641457,5177400,431.88884 +GOOG,2013-06-07,870.421474,880.001515,865.321488,879.731524,5369200,439.426336 +GOOG,2013-06-10,882.101524,891.001534,880.091512,890.22152,4693000,444.666094 +GOOG,2013-06-11,883.971486,887.001544,879.521511,879.811535,3528300,439.466301 +GOOG,2013-06-12,885.461488,886.001531,869.651507,871.981501,4426100,435.555195 +GOOG,2013-06-13,868.981463,879.6615,865.501482,877.001476,4155200,438.062675 +GOOG,2013-06-14,880.101498,884.701508,874.131501,875.041517,4506700,437.083675 +GOOG,2013-06-17,879.231487,889.43152,878.281527,886.251549,4308500,442.683092 +GOOG,2013-06-18,888.651507,901.00154,888.351497,900.621519,4350000,449.860899 +GOOG,2013-06-19,901.371575,910.841586,897.501526,900.681558,5853600,449.890888 +GOOG,2013-06-20,893.991525,901.00154,883.311488,884.741513,6769200,441.928828 +GOOG,2013-06-21,888.341511,889.881505,873.071511,880.931503,7994300,440.025726 +GOOG,2013-06-24,871.881518,876.321507,863.251499,869.791496,6056300,434.461287 +GOOG,2013-06-25,877.261481,879.681533,864.511455,866.201484,5125500,432.668074 +GOOG,2013-06-26,873.75148,878.001489,870.571509,873.651498,3676400,436.389359 +GOOG,2013-06-27,878.801536,884.691522,876.651475,877.071501,3867300,438.097653 +GOOG,2013-06-28,874.901529,881.841519,874.191479,880.371488,4716100,439.745998 +GOOG,2013-07-01,886.451515,892.081558,885.001518,887.88154,3462400,443.497273 +GOOG,2013-07-02,890.201548,891.001534,877.271528,882.311537,3797000,440.715053 +GOOG,2013-07-03,879.901532,889.171516,878.501526,886.431543,2101700,442.772999 +GOOG,2013-07-05,890.011507,895.411564,887.341498,893.491549,3416500,446.299475 +GOOG,2013-07-08,899.211527,906.271534,897.081561,905.091527,3953700,452.09367 +GOOG,2013-07-09,911.001546,912.95158,897.981529,905.241563,3973500,452.168613 +GOOG,2013-07-10,903.45155,911.141534,900.381548,905.991557,3429500,452.543235 +GOOG,2013-07-11,913.001572,920.811572,908.521578,920.241572,5187700,459.661125 +GOOG,2013-07-12,920.0016,923.001578,915.241569,923.001578,5155600,461.039749 +GOOG,2013-07-15,924.301601,928.001581,916.361598,924.691608,3935600,461.88392 +GOOG,2013-07-16,927.13157,927.971561,913.90154,919.611594,3980700,459.34645 +GOOG,2013-07-17,921.001552,926.86158,916.301559,918.551603,3023400,458.816985 +GOOG,2013-07-18,918.991602,920.0016,903.191545,910.681564,7296100,454.885896 +GOOG,2013-07-19,886.611537,902.951574,875.611518,896.601557,14773700,447.852926 +GOOG,2013-07-22,902.001553,912.671542,897.00155,910.701536,5828100,454.895872 +GOOG,2013-07-23,910.701536,913.001572,899.571515,903.801551,4106600,451.449326 +GOOG,2013-07-24,907.26156,910.301543,900.70153,902.901521,4172500,450.999761 +GOOG,2013-07-25,893.871509,896.851514,886.081542,887.701547,6024600,443.407366 +GOOG,2013-07-26,886.991496,889.991535,882.001541,885.351519,3568600,442.233526 +GOOG,2013-07-29,884.901535,894.82153,880.891498,882.271531,3797800,440.695071 +GOOG,2013-07-30,885.461488,895.61153,880.871526,890.921523,3524300,445.015746 +GOOG,2013-07-31,892.991512,896.51156,886.181525,887.751538,4363200,443.432337 +GOOG,2013-08-01,895.001524,904.551546,895.001524,904.221578,4292700,451.65913 +GOOG,2013-08-02,903.441564,907.001556,900.821546,906.571544,3440600,452.832939 +GOOG,2013-08-05,905.391537,905.521539,899.201541,905.00153,2629100,452.048716 +GOOG,2013-08-06,904.691534,909.71157,895.731546,896.571537,3023400,447.837931 +GOOG,2013-08-07,895.041529,898.451547,889.091505,890.651532,2768600,444.880885 +GOOG,2013-08-08,895.491514,895.841515,885.291542,892.661544,2987000,445.884887 +GOOG,2013-08-09,890.561536,895.521533,890.001521,890.4115,2657200,444.760989 +GOOG,2013-08-12,886.9015,887.001544,881.651539,885.511541,2764200,442.313457 +GOOG,2013-08-13,886.831536,888.501532,876.201491,881.251485,2850200,440.185557 +GOOG,2013-08-14,878.371524,880.2315,867.161492,869.811468,4179900,434.471263 +GOOG,2013-08-15,864.441491,864.921495,858.001477,859.661487,3752300,429.401342 +GOOG,2013-08-16,861.281492,862.441466,856.541494,856.911467,3362700,428.027706 +GOOG,2013-08-19,857.711453,872.001473,857.451449,865.651456,3635300,432.393335 +GOOG,2013-08-20,868.351485,872.111504,863.541461,865.421471,2475100,432.278457 +GOOG,2013-08-21,870.65152,876.911479,866.501494,869.331464,3527700,434.231501 +GOOG,2013-08-22,872.701476,874.751493,870.251466,873.711475,1746200,436.419318 +GOOG,2013-08-23,877.831482,878.001489,869.75149,870.211522,2162200,434.67109 +GOOG,2013-08-26,870.001509,874.901529,866.05151,866.391464,2112800,432.762969 +GOOG,2013-08-27,859.621482,863.731502,847.901427,850.151471,3481100,424.651084 +GOOG,2013-08-28,850.251454,855.411479,847.771425,848.551438,2669700,423.851867 +GOOG,2013-08-29,849.071447,860.381462,848.591444,855.431451,2968000,427.288437 +GOOG,2013-08-30,855.76148,858.041482,845.561447,846.901475,3737100,423.02771 +GOOG,2013-09-03,854.361474,866.191498,853.951434,860.381462,4110400,429.76097 +GOOG,2013-09-04,860.351504,873.501523,855.171446,871.6315,4097600,435.38037 +GOOG,2013-09-05,873.501523,879.881499,871.611466,879.561517,2592100,439.341417 +GOOG,2013-09-06,882.441539,883.781506,873.741494,879.581489,3134800,439.351393 +GOOG,2013-09-09,883.731514,889.751502,882.421506,888.051548,2478300,443.582192 +GOOG,2013-09-10,890.021554,892.001547,884.001505,888.67154,2584700,443.891878 +GOOG,2013-09-11,888.541538,896.97153,886.081542,896.191517,3233200,447.64811 +GOOG,2013-09-12,897.401543,897.901518,890.011507,893.061537,2199100,446.084684 +GOOG,2013-09-13,894.501548,895.681555,884.841496,889.071533,2660600,444.091675 +GOOG,2013-09-16,896.201564,897.00155,884.871516,887.761524,2682900,443.437325 +GOOG,2013-09-17,887.411523,888.391502,881.001528,886.1115,2528200,442.613137 +GOOG,2013-09-18,886.351532,903.971559,883.071517,903.321548,3883800,451.209564 +GOOG,2013-09-19,905.991557,905.991557,895.401517,898.391569,3207600,448.747038 +GOOG,2013-09-20,898.391569,904.131581,895.621516,903.111535,8723000,451.104663 +GOOG,2013-09-23,896.151511,901.591574,885.201545,886.501507,3568000,442.807945 +GOOG,2013-09-24,886.501507,890.101504,881.401521,886.841522,2984600,442.977783 +GOOG,2013-09-25,886.551498,886.551498,875.601532,877.231523,3310200,438.177584 +GOOG,2013-09-26,878.301499,882.751535,875.001512,878.171497,2529200,438.647101 +GOOG,2013-09-27,874.821518,877.521485,871.311518,876.391532,2527000,437.758008 +GOOG,2013-09-30,869.081507,880.841506,868.311479,875.911528,3457600,437.518246 +GOOG,2013-10-01,880.251533,887.671527,880.051506,887.001544,3382100,443.057714 +GOOG,2013-10-02,882.731502,889.361496,877.821495,887.991509,3001700,443.552202 +GOOG,2013-10-03,888.001495,894.101555,872.101517,876.091522,4249800,437.608153 +GOOG,2013-10-04,875.001512,877.511499,870.001509,872.351475,2726100,435.739997 +GOOG,2013-10-07,867.451516,873.991513,864.111462,865.741514,2596800,432.438319 +GOOG,2013-10-08,865.321488,865.981485,851.631488,853.671458,3901800,426.409319 +GOOG,2013-10-09,856.281489,862.651479,842.981435,855.861463,5322400,427.503228 +GOOG,2013-10-10,863.841471,868.831488,860.211455,868.241516,4527400,433.687071 +GOOG,2013-10-11,866.031477,873.48149,865.301455,871.991487,2828300,435.560183 +GOOG,2013-10-14,866.661516,876.251482,865.391513,876.111494,2496400,437.618129 +GOOG,2013-10-15,875.761492,885.631496,874.001499,882.011527,3195600,440.565198 +GOOG,2013-10-16,885.871529,898.331531,884.011491,898.031521,4030200,448.567193 +GOOG,2013-10-17,892.991512,896.901567,885.73154,888.791495,8545000,443.951796 +GOOG,2013-10-18,976.581695,1015.461751,974.001682,1011.411708,23219400,505.200653 +GOOG,2013-10-21,1011.461761,1019.001771,999.551726,1003.301698,7283700,501.149699 +GOOG,2013-10-22,1005.001713,1013.001755,995.791707,1007.001739,4433700,502.997872 +GOOG,2013-10-23,1001.001723,1034.751774,1000.631688,1031.411782,5346300,515.1907 +GOOG,2013-10-24,1031.871752,1040.571735,1024.80176,1025.551754,4199700,512.263613 +GOOG,2013-10-25,1028.821783,1028.821783,1010.741725,1015.201747,4076100,507.09378 +GOOG,2013-10-28,1015.201747,1023.431773,1012.991708,1015.001719,2326000,506.993866 +GOOG,2013-10-29,1019.101754,1036.941719,1013.501731,1036.241716,3222000,517.603255 +GOOG,2013-10-30,1037.431831,1037.511719,1026.001738,1030.421755,2658000,514.696181 +GOOG,2013-10-31,1028.931813,1041.521818,1023.971755,1030.581776,3292200,514.776112 +GOOG,2013-11-01,1031.791741,1036.001806,1025.10177,1027.041757,2576100,513.00787 +GOOG,2013-11-04,1031.501717,1032.371789,1022.031768,1026.111769,2286000,512.543341 +GOOG,2013-11-05,1020.351724,1031.651814,1017.421771,1021.521745,2371500,510.250622 +GOOG,2013-11-06,1025.601746,1027.001751,1015.371754,1022.751743,1832600,510.865006 +GOOG,2013-11-07,1022.611754,1023.931749,1007.641703,1007.951699,3371700,503.472377 +GOOG,2013-11-08,1008.751746,1018.501734,1008.501728,1016.031752,2591100,507.508367 +GOOG,2013-11-11,1009.511727,1015.931769,1008.001752,1010.59175,2233500,504.791084 +GOOG,2013-11-12,1007.701742,1017.56176,1005.001713,1011.781743,2445200,505.385486 +GOOG,2013-11-13,1006.751721,1032.851732,1006.501702,1032.471772,3170500,515.720166 +GOOG,2013-11-14,1033.921769,1039.751777,1030.351791,1035.231717,2342100,517.09876 +GOOG,2013-11-15,1034.871729,1038.001831,1030.311725,1033.561782,2562100,516.264626 +GOOG,2013-11-18,1035.751726,1048.741785,1029.241809,1031.551709,3532500,515.260594 +GOOG,2013-11-19,1031.721778,1034.751774,1023.051753,1025.201753,2271600,512.088788 +GOOG,2013-11-20,1029.951737,1033.361816,1020.361771,1022.311744,1934500,510.645227 +GOOG,2013-11-21,1027.001751,1038.311828,1026.001738,1034.071744,2191700,516.519352 +GOOG,2013-11-22,1033.421732,1036.171752,1029.221715,1031.891724,2517700,515.430432 +GOOG,2013-11-25,1037.161779,1053.191759,1035.021826,1045.931848,3238000,522.443481 +GOOG,2013-11-26,1048.601858,1061.501858,1042.941796,1058.411823,4589600,528.677234 +GOOG,2013-11-27,1062.031792,1068.00185,1060.001869,1063.111877,2255500,531.024914 +GOOG,2013-11-29,1062.161794,1066.621816,1059.451841,1059.591768,2394400,529.266617 +GOOG,2013-12-02,1063.511809,1066.351887,1050.761782,1054.481857,2756600,526.714214 +GOOG,2013-12-03,1050.951823,1063.441845,1049.021761,1053.261845,3364700,526.104818 +GOOG,2013-12-04,1051.37185,1063.981826,1050.001741,1058.181837,2392000,528.562356 +GOOG,2013-12-05,1057.201858,1059.661854,1051.09175,1057.341785,2275800,528.14275 +GOOG,2013-12-06,1069.791862,1070.001875,1060.081758,1069.871873,2868200,534.401535 +GOOG,2013-12-09,1070.99178,1082.311903,1068.021822,1078.141905,2976200,538.53242 +GOOG,2013-12-10,1076.151804,1092.311909,1075.65189,1084.661869,3721600,541.789145 +GOOG,2013-12-11,1087.401842,1091.321883,1075.171825,1077.291806,3436400,538.107795 +GOOG,2013-12-12,1079.571808,1082.94182,1069.001801,1069.961809,3204800,534.446458 +GOOG,2013-12-13,1075.40181,1076.291854,1057.891813,1060.791808,4340900,529.866038 +GOOG,2013-12-16,1064.001798,1074.691882,1062.01182,1072.981881,3216000,535.954985 +GOOG,2013-12-17,1072.821859,1080.761801,1068.381809,1069.861826,3082800,534.396516 +GOOG,2013-12-18,1071.851804,1084.951893,1059.041862,1084.751805,4437100,541.834068 +GOOG,2013-12-19,1080.771848,1091.991866,1079.081818,1086.221897,3343800,542.56838 +GOOG,2013-12-20,1088.301811,1101.171914,1088.001862,1100.621886,6547600,549.761182 +GOOG,2013-12-23,1107.841852,1115.801889,1105.121852,1115.101886,3456000,556.993949 +GOOG,2013-12-24,1114.971883,1115.241935,1108.101857,1111.8419040000001,1473800,555.365586 +GOOG,2013-12-26,1114.011876,1119.001954,1108.691952,1117.461899,2685500,558.172777 +GOOG,2013-12-27,1120.001906,1120.281882,1112.941961,1118.401934,3151100,558.642325 +GOOG,2013-12-30,1120.341921,1120.501943,1109.02192,1109.461919,2481300,554.176782 +GOOG,2013-12-31,1112.241958,1121.00198,1106.261853,1120.711956,2725900,559.796182 +GOOG,2014-01-02,1115.461873,1117.751923,1108.261879,1113.121955,3656400,556.004972 +GOOG,2014-01-03,1115.001903,1116.931965,1104.931933,1105.001897,3345800,551.948999 +GOOG,2014-01-06,1113.011924,1118.861905,1106.441847,1117.321972,3551800,558.102883 +GOOG,2014-01-07,1125.001909,1139.691922,1121.161879,1138.861917,5124300,568.862096 +GOOG,2014-01-08,1146.001995,1147.32199,1133.291913,1141.231977,4501700,570.045943 +GOOG,2014-01-09,1143.442016,1144.221907,1125.561985,1130.241944,4184500,564.556416 +GOOG,2014-01-10,1139.081977,1139.081977,1122.251889,1130.181906,4302900,564.526426 +GOOG,2014-01-13,1126.471878,1146.912011,1117.171875,1122.981911,4855800,560.930026 +GOOG,2014-01-14,1137.951901,1151.001998,1128.091944,1149.402027,4983700,574.126886 +GOOG,2014-01-15,1152.991977,1155.001927,1143.791956,1148.622013,3915000,573.737269 +GOOG,2014-01-16,1149.101955,1157.931941,1148.002021,1156.221939,3380300,577.533436 +GOOG,2014-01-17,1156.851978,1160.631969,1144.201935,1150.53198,5422800,574.691299 +GOOG,2014-01-21,1160.932041,1164.001982,1151.301947,1163.702033,3974500,581.269747 +GOOG,2014-01-22,1166.611952,1167.892003,1158.861929,1165.022028,3154500,581.929085 +GOOG,2014-01-23,1160.00193,1162.491946,1154.37201,1160.102036,3912700,579.471546 +GOOG,2014-01-24,1151.011923,1153.55193,1123.001883,1123.831888,7814000,561.35459 +GOOG,2014-01-27,1126.101966,1126.501898,1082.271837,1101.23183,8739800,550.065849 +GOOG,2014-01-28,1110.321943,1125.751903,1109.941861,1123.01193,4436900,560.94502 +GOOG,2014-01-29,1119.121909,1121.751974,1099.421846,1106.921912,4777500,552.908048 +GOOG,2014-01-30,1145.001921,1152.4919400000001,1127.251892,1135.391922,10220800,567.128832 +GOOG,2014-01-31,1171.35195,1186.542001,1151.132,1180.971997,11174200,589.896102 +GOOG,2014-02-03,1179.202079,1181.721991,1132.011985,1133.431963,9172400,566.149832 +GOOG,2014-02-04,1137.991967,1155.001927,1137.011988,1138.161914,5644800,568.512445 +GOOG,2014-02-05,1143.381977,1150.772013,1128.021981,1143.201984,4806800,571.029962 +GOOG,2014-02-06,1151.132,1160.161952,1147.551975,1159.961986,3907600,579.401591 +GOOG,2014-02-07,1167.631998,1177.902056,1160.562006,1177.441963,5292000,588.132849 +GOOG,2014-02-10,1171.801996,1182.402022,1169.021957,1172.93195,3904800,585.880095 +GOOG,2014-02-11,1180.172011,1191.872094,1172.211975,1190.182065,4116900,594.496536 +GOOG,2014-02-12,1189.001997,1190.002071,1181.381976,1186.691975,3461800,592.753234 +GOOG,2014-02-13,1180.752059,1199.902094,1179.662049,1199.902094,3686400,599.351695 +GOOG,2014-02-14,1195.612019,1204.392013,1192.802082,1202.802088,4389700,600.800244 +GOOG,2014-02-18,1201.412007,1212.872058,1200.002077,1210.88208,4233500,604.836204 +GOOG,2014-02-19,1205.302029,1209.222069,1197.502014,1202.342118,4222900,600.570489 +GOOG,2014-02-20,1203.142104,1206.892075,1200.222015,1204.112036,3414300,601.454563 +GOOG,2014-02-21,1207.812016,1209.872081,1202.842033,1203.792115,3738500,601.294763 +GOOG,2014-02-24,1205.362067,1220.162111,1205.102063,1212.512071,3361100,605.650385 +GOOG,2014-02-25,1215.942121,1224.502055,1210.422109,1220.002089,2888100,609.391653 +GOOG,2014-02-26,1224.002141,1228.882066,1213.762102,1220.172036,3979100,609.476541 +GOOG,2014-02-27,1218.39207,1224.232126,1217.012037,1219.212151,2529400,608.997078 +GOOG,2014-02-28,1220.342104,1224.192059,1206.222092,1215.652097,4644500,607.21883 +GOOG,2014-03-03,1206.752026,1207.842036,1192.142024,1202.692058,4225300,600.745284 +GOOG,2014-03-04,1215.002086,1216.002038,1209.502046,1214.912028,2946300,606.849165 +GOOG,2014-03-05,1215.052078,1223.082077,1211.412136,1218.262068,2479700,608.522511 +GOOG,2014-03-06,1222.282091,1226.152141,1218.602083,1219.612082,2545600,609.196844 +GOOG,2014-03-07,1226.802152,1226.992071,1211.442033,1214.792073,3041500,606.789247 +GOOG,2014-03-10,1215.692042,1217.642076,1204.092064,1211.572035,2438200,605.180837 +GOOG,2014-03-11,1213.772027,1214.322055,1196.642112,1199.9920300000001,3438800,599.396618 +GOOG,2014-03-12,1196.40208,1207.852083,1184.192035,1207.302054,3943200,603.047979 +GOOG,2014-03-13,1207.952066,1210.50212,1184.762035,1189.062036,4708600,593.937081 +GOOG,2014-03-14,1181.992043,1190.87202,1172.532018,1172.80207,4604900,585.81522 +GOOG,2014-03-17,1179.25207,1197.072063,1178.112069,1192.102079,4340300,595.455584 +GOOG,2014-03-18,1194.672106,1211.532091,1193.062087,1211.262039,3643500,605.025994 +GOOG,2014-03-19,1211.80202,1211.992061,1194.412101,1199.252083,3237800,599.027014 +GOOG,2014-03-20,1199.952085,1209.612076,1195.362061,1197.161999,3381900,597.983016 +GOOG,2014-03-21,1206.312028,1209.632048,1182.452014,1183.041986,6441000,590.930063 +GOOG,2014-03-24,1184.192035,1184.902085,1145.952004,1157.931941,6096800,578.387583 +GOOG,2014-03-25,1166.002007,1169.842037,1147.001947,1158.722002,4838400,578.782219 +GOOG,2014-03-26,1162.012003,1171.572011,1131.501901,1131.971918,5179200,565.420539 +GOOG,2014-03-27,568.00257,568.00257,552.922516,558.462551,13100,558.462551 +GOOG,2014-03-28,561.202549,566.43259,558.672539,559.992565,41200,559.992565 +GOOG,2014-03-31,566.892592,567.002574,556.932537,556.972503,10800,556.972503 +GOOG,2014-04-01,558.712504,568.452595,558.712504,567.162558,7900,567.162558 +GOOG,2014-04-02,599.992707,604.832763,562.192568,567.002574,147100,567.002574 +GOOG,2014-04-03,569.852553,587.282679,564.132581,569.742571,5099100,569.742571 +GOOG,2014-04-04,574.652582,577.772589,543.002488,543.14246,6369300,543.14246 +GOOG,2014-04-07,540.742445,548.482483,527.152379,538.152456,4401600,538.152456 +GOOG,2014-04-08,542.602466,555.0025,541.612446,554.902495,3151200,554.902495 +GOOG,2014-04-09,559.622532,565.372554,552.952506,564.142557,3330800,564.142557 +GOOG,2014-04-10,565.002582,565.002582,539.902434,540.952433,4036800,540.952433 +GOOG,2014-04-11,532.552381,540.00244,526.532392,530.602392,3924800,530.602392 +GOOG,2014-04-14,538.252462,544.10249,529.56237,532.522392,2575000,532.522392 +GOOG,2014-04-15,536.822454,538.452412,518.462348,536.442444,3855000,536.442444 +GOOG,2014-04-16,543.002488,557.002492,540.00244,556.54249,4893200,556.54249 +GOOG,2014-04-17,548.81249,549.502492,531.152424,536.1024,6809500,536.1024 +GOOG,2014-04-21,536.1024,536.702435,525.602352,528.622414,2566700,528.622414 +GOOG,2014-04-22,528.642366,537.232453,527.512375,534.812425,2365300,534.812425 +GOOG,2014-04-23,533.792415,533.872408,526.252389,526.942391,2052300,526.942391 +GOOG,2014-04-24,530.072374,531.652391,522.122349,525.162363,1883100,525.162363 +GOOG,2014-04-25,522.512395,524.702361,515.422333,516.182352,2100300,516.182352 +GOOG,2014-04-28,517.182348,518.602319,502.802274,517.152359,3335500,517.152359 +GOOG,2014-04-29,516.902344,529.462425,516.322324,527.70241,2699000,527.70241 +GOOG,2014-04-30,527.602405,528.002366,522.522372,526.662388,1751100,526.662388 +GOOG,2014-05-01,527.112413,532.932391,523.882364,531.352435,1905500,531.352435 +GOOG,2014-05-02,533.762426,534.002403,525.612389,527.932411,1688500,527.932411 +GOOG,2014-05-05,524.822381,528.902418,521.322364,527.812392,1024100,527.812392 +GOOG,2014-05-06,525.232379,526.812396,515.062337,515.14233,1689000,515.14233 +GOOG,2014-05-07,515.792305,516.68232,503.302272,509.962321,3224300,509.962321 +GOOG,2014-05-08,508.462297,517.232351,506.452298,511.002313,2021300,511.002313 +GOOG,2014-05-09,510.752299,519.902332,504.202292,518.732375,2439400,518.732375 +GOOG,2014-05-12,523.512391,530.192393,519.012379,529.922427,1912500,529.922427 +GOOG,2014-05-13,530.892433,536.072411,529.512367,533.092437,1653400,533.092437 +GOOG,2014-05-14,533.002407,533.002407,525.292358,526.652412,1191700,526.652412 +GOOG,2014-05-15,525.702357,525.872379,517.422325,519.982324,1704300,519.982324 +GOOG,2014-05-16,521.39238,521.802379,515.442347,520.632362,1485200,520.632362 +GOOG,2014-05-19,519.70238199999994,529.782394,517.58537,528.862391,1277700,528.862391 +GOOG,2014-05-20,529.742368,536.232457,526.302392,529.772418,1784700,529.772418 +GOOG,2014-05-21,532.902401,539.185441,531.912381,538.942465,1196200,538.942465 +GOOG,2014-05-22,541.132431,547.602506,540.782472,545.062459,1615800,545.062459 +GOOG,2014-05-23,547.262462,553.642508,543.702467,552.702492,1932100,552.702492 +GOOG,2014-05-27,556.002496,566.002578,554.352525,565.952575,2104100,565.952575 +GOOG,2014-05-28,564.57257,567.842585,561.002537,561.682564,1652000,561.682564 +GOOG,2014-05-29,563.352549,564.002525,558.712504,560.082534,1354100,560.082534 +GOOG,2014-05-30,560.802526,561.352557,555.912528,559.892559,1771100,559.892559 +GOOG,2014-06-02,560.70252,560.902531,545.732448,553.932488,1435000,553.932488 +GOOG,2014-06-03,550.99248,552.342495,542.552463,544.94244,1866600,544.94244 +GOOG,2014-06-04,541.502464,548.612478,538.752429,544.662436,1816400,544.662436 +GOOG,2014-06-05,546.402499,554.952498,544.452449,553.902499,1689100,553.902499 +GOOG,2014-06-06,558.062528,558.062528,548.932509,556.332503,1736700,556.332503 +GOOG,2014-06-09,557.152501,562.902523,556.042523,562.122552,1467500,562.122552 +GOOG,2014-06-10,560.512546,563.602563,557.902544,560.552511,1351700,560.552511 +GOOG,2014-06-11,558.002549,559.882522,555.022514,558.842499,1100100,558.842499 +GOOG,2014-06-12,557.302509,557.992512,548.46247,551.352476,1458400,551.352476 +GOOG,2014-06-13,552.262503,552.30253,545.562488,551.762475,1220500,551.762475 +GOOG,2014-06-16,549.262515,549.622511,541.522477,544.282488,1702500,544.282488 +GOOG,2014-06-17,544.202435,545.32245,539.33245,543.012465,1444500,543.012465 +GOOG,2014-06-18,544.862448,553.562516,544.002484,553.372481,1741700,553.372481 +GOOG,2014-06-19,554.242482,555.0025,548.512473,554.902495,2456800,554.902495 +GOOG,2014-06-20,556.852545,557.582513,550.394465,556.362492,4508300,556.362492 +GOOG,2014-06-23,555.152509,565.002582,554.252519,564.952579,1536800,564.952579 +GOOG,2014-06-24,565.192556,572.648612,561.012513,564.622572,2207100,564.622572 +GOOG,2014-06-25,565.262572,579.962616,565.222546,578.652627,1969300,578.652627 +GOOG,2014-06-26,581.002639,582.45266,571.852606,576.002598,1741900,576.002598 +GOOG,2014-06-27,577.182592,579.872648,573.802595,577.242632,2236900,577.242632 +GOOG,2014-06-30,578.662603,579.572631,574.752588,575.282606,1313700,575.282606 +GOOG,2014-07-01,578.32262,584.402649,576.652635,582.672624,1447900,582.672624 +GOOG,2014-07-02,583.352651,585.442672,580.392628,582.33766,1056300,582.33766 +GOOG,2014-07-03,583.352651,585.01266,580.922646,584.732656,714100,584.732656 +GOOG,2014-07-07,583.76265,586.432631,579.592644,582.252649,1064600,582.252649 +GOOG,2014-07-08,577.662607,579.530645,566.137592,571.092587,1909500,571.092587 +GOOG,2014-07-09,571.582578,576.72259,569.378597,576.08259,1116700,576.08259 +GOOG,2014-07-10,565.912548,576.592595,565.012558,571.102563,1356700,571.102563 +GOOG,2014-07-11,571.912585,580.85263,571.422594,579.182645,1621700,579.182645 +GOOG,2014-07-14,582.602608,585.212671,578.032641,584.872627,1854000,584.872627 +GOOG,2014-07-15,585.742628,585.807626,576.562606,584.782659,1623000,584.782659 +GOOG,2014-07-16,588.002671,588.402633,582.202646,582.662648,1397100,582.662648 +GOOG,2014-07-17,579.532604,580.992601,568.61258,573.732579,3016500,573.732579 +GOOG,2014-07-18,593.002712,596.802684,582.002635,595.082696,4014100,595.082696 +GOOG,2014-07-21,591.752702,594.40267,585.235622,589.47264500000006,2062100,589.47264500000006 +GOOG,2014-07-22,590.722655,599.652725,590.602697,594.742713,1699100,594.742713 +GOOG,2014-07-23,593.232713,597.852683,592.502683,595.982686,1233100,595.982686 +GOOG,2014-07-24,596.452725,599.502716,591.772654,593.352671,1035100,593.352671 +GOOG,2014-07-25,590.402686,591.862684,587.032665,589.022681,932400,589.022681 +GOOG,2014-07-28,588.072688,592.502683,584.755668,590.602697,986800,590.602697 +GOOG,2014-07-29,588.752653,589.702646,583.517654,585.612633,1349800,585.612633 +GOOG,2014-07-30,586.55265,589.502696,584.002627,587.42265,1016400,587.42265 +GOOG,2014-07-31,580.602616,583.652668,570.002561,571.602592,2102700,571.602592 +GOOG,2014-08-01,570.402584,575.962633,562.85252,566.072533,1955200,566.072533 +GOOG,2014-08-04,569.042592,575.352622,564.102531,573.152619,1427300,573.152619 +GOOG,2014-08-05,570.052564,571.982601,562.612543,565.072537,1551200,565.072537 +GOOG,2014-08-06,561.782569,570.702601,560.002541,566.376589,1334300,566.376589 +GOOG,2014-08-07,568.00257,569.89258,561.102543,563.362525,1110900,563.362525 +GOOG,2014-08-08,563.562536,570.252576,560.352561,568.772565,1494700,568.772565 +GOOG,2014-08-11,569.992585,570.492553,566.002578,567.882551,1214700,567.882551 +GOOG,2014-08-12,564.522567,565.902572,560.882518,562.732562,1542000,562.732562 +GOOG,2014-08-13,567.312567,575.002602,565.752564,574.782577,1439200,574.782577 +GOOG,2014-08-14,576.182596,577.902645,570.882599,574.652582,985400,574.652582 +GOOG,2014-08-15,577.862619,579.382595,570.522603,573.482626,1519100,573.482626 +GOOG,2014-08-18,576.11258,584.512631,576.002598,582.162619,1284100,582.162619 +GOOG,2014-08-19,585.002622,587.342658,584.002627,586.862643,978600,586.862643 +GOOG,2014-08-20,585.88266,586.702658,582.572618,584.492618,1036700,584.492618 +GOOG,2014-08-21,583.822628,584.502655,581.14261,583.372664,914800,583.372664 +GOOG,2014-08-22,583.592628,585.238621,580.642643,582.562642,789000,582.562642 +GOOG,2014-08-25,584.722619,585.002622,579.002647,580.202654,1361400,580.202654 +GOOG,2014-08-26,581.262629,581.802623,576.582619,577.862619,1639600,577.862619 +GOOG,2014-08-27,577.272622,578.492642,570.105566,571.002557,1703300,571.002557 +GOOG,2014-08-28,569.562573,573.252625,567.102579,569.202577,1292900,569.202577 +GOOG,2014-08-29,571.332564,572.04258,567.07155,571.602592,1083700,571.602592 +GOOG,2014-09-02,571.852606,577.832629,571.192593,577.332601,1578400,577.332601 +GOOG,2014-09-03,580.002643,582.992655,575.002602,577.942611,1215100,577.942611 +GOOG,2014-09-04,580.002643,586.00268,579.222611,581.982621,1458100,581.982621 +GOOG,2014-09-05,583.982613,586.55265,581.952632,586.082672,1632300,586.082672 +GOOG,2014-09-08,586.602653,591.772654,586.302635,589.722659,1431000,589.722659 +GOOG,2014-09-09,588.902662,589.002667,580.002643,581.012615,1287200,581.012615 +GOOG,2014-09-10,581.502606,583.502659,576.942615,583.102636,977300,583.102636 +GOOG,2014-09-11,580.362639,581.812661,576.262588,581.352659,1221000,581.352659 +GOOG,2014-09-12,581.002639,581.642639,574.462608,575.622589,1601600,575.622589 +GOOG,2014-09-15,572.94257,574.952599,568.212557,573.102616,1597500,573.102616 +GOOG,2014-09-16,572.762572,581.502606,572.662566,579.95264,1480300,579.95264 +GOOG,2014-09-17,580.012619,587.522656,578.777604,584.772622,1692800,584.772622 +GOOG,2014-09-18,587.002675,589.542661,585.002622,589.272695,1444500,589.272695 +GOOG,2014-09-19,591.502688,596.482715,589.502696,596.082692,3736600,596.082692 +GOOG,2014-09-22,593.82271,593.951665,583.462632,587.372648,1689500,587.372648 +GOOG,2014-09-23,586.852667,586.852667,581.002639,581.132634,1471400,581.132634 +GOOG,2014-09-24,581.462641,589.632691,580.522624,587.992634,1728100,587.992634 +GOOG,2014-09-25,587.552646,587.982658,574.182604,575.062581,1925900,575.062581 +GOOG,2014-09-26,576.062638,579.2526,574.662619,577.1026,1443600,577.1026 +GOOG,2014-09-29,571.7526,578.192625,571.172579,576.362594,1282400,576.362594 +GOOG,2014-09-30,576.932639,579.852634,572.852602,577.36259,1621700,577.36259 +GOOG,2014-10-01,576.012635,577.582615,567.01255,568.272597,1445400,568.272597 +GOOG,2014-10-02,567.312567,571.912585,563.322559,570.082554,1178400,570.082554 +GOOG,2014-10-03,573.052613,577.227637,572.502582,575.282606,1141700,575.282606 +GOOG,2014-10-06,578.802636,581.002639,574.442595,577.352614,1214600,577.352614 +GOOG,2014-10-07,574.402629,575.27263,563.742534,563.742534,1911300,563.742534 +GOOG,2014-10-08,565.572566,573.882587,557.492545,572.502582,1990800,572.502582 +GOOG,2014-10-09,571.182555,571.49261,559.062524,560.882518,2524800,560.882518 +GOOG,2014-10-10,557.722546,565.132577,544.052487,544.492476,3081900,544.492476 +GOOG,2014-10-13,544.992443,549.502492,533.102413,533.212394,2581600,533.212394 +GOOG,2014-10-14,538.902438,547.192507,533.172429,537.942408,2222500,537.942408 +GOOG,2014-10-15,531.012391,532.802396,518.302363,530.032409,3719300,530.032409 +GOOG,2014-10-16,519.002342,529.432374,515.002358,524.512387,3708500,524.512387 +GOOG,2014-10-17,527.252385,530.982402,508.532313,511.172305,5539300,511.172305 +GOOG,2014-10-20,509.452317,521.762353,508.102301,520.842349,2607500,520.842349 +GOOG,2014-10-21,525.192353,526.792383,519.112324,526.542369,2336200,526.542369 +GOOG,2014-10-22,529.892376,539.802428,528.802412,532.712427,2919200,532.712427 +GOOG,2014-10-23,539.322413,547.222497,535.852447,543.982471,2348800,543.982471 +GOOG,2014-10-24,544.36248,544.882461,535.792407,539.782415,1973100,539.782415 +GOOG,2014-10-27,537.032441,544.412483,537.032441,540.772435,1185300,540.772435 +GOOG,2014-10-28,543.002488,548.982512,541.622422,548.902458,1270900,548.902458 +GOOG,2014-10-29,550.00246,554.192479,546.982459,549.33247,1770500,549.33247 +GOOG,2014-10-30,548.952461,552.802497,543.512432,550.312514,1455600,550.312514 +GOOG,2014-10-31,559.352504,559.572529,554.752486,559.082538,2035000,559.082538 +GOOG,2014-11-03,555.502529,557.902544,553.23251,555.222525,1382200,555.222525 +GOOG,2014-11-04,553.002509,555.502529,549.302481,554.112486,1244200,554.112486 +GOOG,2014-11-05,556.802542,556.802542,544.052487,545.922484,2032200,545.922484 +GOOG,2014-11-06,545.502448,546.887472,540.972446,542.042458,1333200,542.042458 +GOOG,2014-11-07,546.212464,546.212464,538.672437,541.012473,1633700,541.012473 +GOOG,2014-11-10,541.462437,549.592461,541.022449,547.492463,1134600,547.492463 +GOOG,2014-11-11,548.492459,551.942473,546.302493,550.292501,965500,550.292501 +GOOG,2014-11-12,550.392507,550.462462,545.172441,547.312465,1129600,547.312465 +GOOG,2014-11-13,549.80251,549.80251,543.482442,545.38249,1339300,545.38249 +GOOG,2014-11-14,546.682503,546.682503,542.15244,544.402446,1289500,544.402446 +GOOG,2014-11-17,543.582448,543.792436,534.063422,536.512399,1726000,536.512399 +GOOG,2014-11-18,537.502419,541.942452,534.172425,535.032449,1962600,535.032449 +GOOG,2014-11-19,535.002399,538.242425,530.082412,536.992415,1392200,536.992415 +GOOG,2014-11-20,531.252429,535.112442,531.082408,534.832438,1563300,534.832438 +GOOG,2014-11-21,541.612446,542.142464,536.562402,537.502419,2224200,537.502419 +GOOG,2014-11-24,537.652428,542.702471,535.622446,539.272471,1706300,539.272471 +GOOG,2014-11-25,539.002444,543.982471,538.60444,541.082428,1789900,541.082428 +GOOG,2014-11-26,540.882478,541.552467,537.044437,540.372473,1522900,540.372473 +GOOG,2014-11-28,540.622426,542.002431,536.602429,541.832471,1148300,541.832471 +GOOG,2014-12-01,538.902438,541.412434,531.862379,533.80239099999994,2115300,533.80239099999994 +GOOG,2014-12-02,533.512412,535.502427,529.802408,533.752389,1526600,533.752389 +GOOG,2014-12-03,531.442404,535.998416,529.262414,531.322384,1277900,531.322384 +GOOG,2014-12-04,531.1624,537.342434,528.592363,537.312445,1392100,537.312445 +GOOG,2014-12-05,531.002415,532.892425,524.282386,525.262369,2565600,525.262369 +GOOG,2014-12-08,527.132366,531.002415,523.792395,526.982357,2329300,526.982357 +GOOG,2014-12-09,522.142362,534.192438,520.502366,533.37244,1871300,533.37244 +GOOG,2014-12-10,533.082399,536.332401,525.562386,526.062353,1712200,526.062353 +GOOG,2014-12-11,527.802416,533.922411,527.102376,528.34241,1610800,528.34241 +GOOG,2014-12-12,523.512391,528.502395,518.662359,518.662359,1994500,518.662359 +GOOG,2014-12-15,522.742396,523.102392,513.272333,513.802351,2813400,513.802351 +GOOG,2014-12-16,511.562321,513.052308,489.00222,495.392242,3964200,495.392242 +GOOG,2014-12-17,497.002248,507.002299,496.812244,504.892295,2883100,504.892295 +GOOG,2014-12-18,512.952333,513.872306,504.70229,511.102319,2926700,511.102319 +GOOG,2014-12-19,511.512318,517.722342,506.91328,516.352313,3690200,516.352313 +GOOG,2014-12-22,516.082347,526.462376,516.082347,524.872383,2723700,524.872383 +GOOG,2014-12-23,527.00237,534.56241,526.292354,530.592416,2197600,530.592416 +GOOG,2014-12-24,530.512424,531.761394,527.022384,528.772422,705900,528.772422 +GOOG,2014-12-26,528.772422,534.252417,527.312364,534.032392,1040500,534.032392 +GOOG,2014-12-29,532.192385,535.482414,530.013375,530.332426,2278500,530.332426 +GOOG,2014-12-30,528.092396,531.152424,527.132366,530.422394,876200,530.422394 +GOOG,2014-12-31,531.252429,532.602384,525.802363,526.402397,1368200,526.402397 +GOOG,2015-01-02,529.012399,531.272382,524.102388,524.812404,1447500,524.812404 +GOOG,2015-01-05,523.262377,524.332389,513.062315,513.872306,2059800,513.872306 +GOOG,2015-01-06,515.002358,516.177334,501.052266,501.962262,2899900,501.962262 +GOOG,2015-01-07,507.002299,507.246285,499.652247,501.102268,2065000,501.102268 +GOOG,2015-01-08,497.992268,503.48227,491.002212,502.682285,3353500,502.682285 +GOOG,2015-01-09,504.7623,504.922285,494.792239,496.172244,2071300,496.172244 +GOOG,2015-01-12,494.942247,495.97823,487.562205,492.552239,2326700,492.552239 +GOOG,2015-01-13,498.842256,502.982272,492.392224,496.182251,2370400,496.182251 +GOOG,2015-01-14,494.652237,503.232286,493.002234,500.872267,2215500,500.872267 +GOOG,2015-01-15,505.572291,505.682303,497.762267,501.792271,2715800,501.792271 +GOOG,2015-01-16,500.012273,508.1923,500.002267,508.082288,2298200,508.082288 +GOOG,2015-01-20,511.002313,512.502307,506.018277,506.902294,2232000,506.902294 +GOOG,2015-01-21,507.252283,519.282346,506.202284,518.042373,2268700,518.042373 +GOOG,2015-01-22,521.482349,536.332401,519.70238199999994,534.392388,2676900,534.392388 +GOOG,2015-01-23,535.592396,542.172453,533.002407,539.952437,2281700,539.952437 +GOOG,2015-01-26,538.532466,539.002444,529.672413,535.212448,1543700,535.212448 +GOOG,2015-01-27,529.972369,530.702398,518.19232,518.63237,1904000,518.63237 +GOOG,2015-01-28,522.782362,522.992349,510.002318,510.002318,1683800,510.002318 +GOOG,2015-01-29,511.002313,511.092313,501.202274,510.6623,4186300,510.6623 +GOOG,2015-01-30,515.862322,539.872444,515.522339,534.522445,5606300,534.522445 +GOOG,2015-02-02,531.732383,533.002407,518.552377,528.482381,2849800,528.482381 +GOOG,2015-02-03,528.002366,533.40243,523.262377,529.2424,2038600,529.2424 +GOOG,2015-02-04,529.2424,532.67442,521.272361,522.762349,1663600,522.762349 +GOOG,2015-02-05,523.792395,528.502395,522.092359,527.582391,1849700,527.582391 +GOOG,2015-02-06,527.64237,537.202402,526.412373,531.002415,1763500,531.002415 +GOOG,2015-02-09,528.002366,532.002411,526.022388,527.832406,1267700,527.832406 +GOOG,2015-02-10,529.302379,537.702431,526.922378,536.942412,1749800,536.942412 +GOOG,2015-02-11,535.302416,538.452412,533.380397,535.972405,1377700,535.972405 +GOOG,2015-02-12,537.252405,544.822482,534.675391,542.932472,1620200,542.932472 +GOOG,2015-02-13,543.352447,549.912491,543.132484,549.012501,1900300,549.012501 +GOOG,2015-02-17,546.83245,550.00246,541.092465,542.842443,1616800,542.842443 +GOOG,2015-02-18,541.402458,545.492471,537.512456,539.702422,1453000,539.702422 +GOOG,2015-02-19,538.042413,543.11247,538.012424,542.872432,989100,542.872432 +GOOG,2015-02-20,543.132484,543.75247,535.802444,538.952441,1444300,538.952441 +GOOG,2015-02-23,536.052398,536.441404,529.412422,531.912381,1457800,531.912381 +GOOG,2015-02-24,530.002419,536.792403,528.252381,536.092424,1005000,536.092424 +GOOG,2015-02-25,535.90245,546.222501,535.447406,543.872489,1825900,543.872489 +GOOG,2015-02-26,543.212476,556.142529,541.502464,555.482516,2311500,555.482516 +GOOG,2015-02-27,554.242482,564.712541,552.902503,558.402511,2410100,558.402511 +GOOG,2015-03-02,560.532559,572.152562,558.752531,571.342601,2129600,571.342601 +GOOG,2015-03-03,570.452587,575.392588,566.522559,573.64261,1704700,573.64261 +GOOG,2015-03-04,571.872619,577.112637,568.012546,573.372583,1876800,573.372583 +GOOG,2015-03-05,575.022616,577.912621,573.412609,575.332609,1389600,575.332609 +GOOG,2015-03-06,574.882583,576.682625,566.762536,567.687558,1659100,567.687558 +GOOG,2015-03-09,566.862541,570.272589,563.537566,568.852557,1062100,568.852557 +GOOG,2015-03-10,564.252539,564.852573,554.732534,555.012538,1792300,555.012538 +GOOG,2015-03-11,555.142533,558.142521,550.682486,551.182515,1820700,551.182515 +GOOG,2015-03-12,553.512513,556.37253,550.462462,555.512505,1389600,555.512505 +GOOG,2015-03-13,553.502476,558.402511,544.222448,547.322503,1703500,547.322503 +GOOG,2015-03-16,550.952514,556.852545,546.002476,554.512509,1640900,554.512509 +GOOG,2015-03-17,551.712472,553.802493,548.002468,550.842471,1805500,550.842471 +GOOG,2015-03-18,552.50248,559.782516,547.002472,559.502513,2134500,559.502513 +GOOG,2015-03-19,559.392531,560.802526,556.147548,557.992512,1197200,557.992512 +GOOG,2015-03-20,561.652513,561.722529,559.052548,560.362537,2616800,560.362537 +GOOG,2015-03-23,560.432554,562.362529,555.832536,558.81251,1643800,558.81251 +GOOG,2015-03-24,562.562541,574.592603,561.212525,570.192597,2583200,570.192597 +GOOG,2015-03-25,570.50259,572.262605,558.742555,558.787539,2152200,558.787539 +GOOG,2015-03-26,557.59255,558.90254,550.652497,555.172522,1572600,555.172522 +GOOG,2015-03-27,553.002509,555.282504,548.132463,548.342512,1897400,548.342512 +GOOG,2015-03-30,551.622503,553.472487,548.17249,552.032502,1287500,552.032502 +GOOG,2015-03-31,550.00246,554.712521,546.722468,548.002468,1588000,548.002468 +GOOG,2015-04-01,548.602502,551.142488,539.502472,542.562439,1963000,542.562439 +GOOG,2015-04-02,540.852427,540.852427,533.849395,535.532417,1716300,535.532417 +GOOG,2015-04-06,532.222436,538.412447,529.572407,536.767432,1324400,536.767432 +GOOG,2015-04-07,538.08244,542.692434,536.002456,537.022404,1302800,537.022404 +GOOG,2015-04-08,538.382457,543.852476,538.382457,541.612446,1178500,541.612446 +GOOG,2015-04-09,541.032425,541.952428,535.492451,540.782472,1557800,540.782472 +GOOG,2015-04-10,542.292472,542.292472,537.312445,540.012416,1409400,540.012416 +GOOG,2015-04-13,538.412447,544.062463,537.312445,539.172466,1645300,539.172466 +GOOG,2015-04-14,536.252409,537.572435,528.094416,530.392405,2604100,530.392405 +GOOG,2015-04-15,528.702406,534.732432,523.22235,532.532429,2318800,532.532429 +GOOG,2015-04-16,529.902414,535.592396,529.612373,533.80239099999994,1299800,533.80239099999994 +GOOG,2015-04-17,528.662379,529.842373,521.012371,524.052386,2151800,524.052386 +GOOG,2015-04-20,525.602352,536.092424,524.50235,535.382408,1679200,535.382408 +GOOG,2015-04-21,537.512456,539.392429,533.677415,533.972413,1844700,533.972413 +GOOG,2015-04-22,534.402426,541.082428,531.752397,539.367458,1593500,539.367458 +GOOG,2015-04-23,541.002435,550.96249,540.23244,547.002472,4184800,547.002472 +GOOG,2015-04-24,566.102584,571.14259,557.252507,565.062561,4932500,565.062561 +GOOG,2015-04-27,563.390015,565.950012,553.200012,555.369995,2398000,555.369995 +GOOG,2015-04-28,554.640015,556.02002,550.366028,553.679993,1491000,553.679993 +GOOG,2015-04-29,550.469971,553.679993,546.905029,549.080017,1698800,549.080017 +GOOG,2015-04-30,547.869995,548.590027,535.049988,537.340027,2082200,537.340027 +GOOG,2015-05-01,538.429993,539.539978,532.099976,537.900024,1768200,537.900024 +GOOG,2015-05-04,538.530029,544.070007,535.059998,540.780029,1308000,540.780029 +GOOG,2015-05-05,538.210022,539.73999,530.390991,530.799988,1383100,530.799988 +GOOG,2015-05-06,531.23999,532.380005,521.085022,524.219971,1567000,524.219971 +GOOG,2015-05-07,523.98999,533.460022,521.75,530.700012,1546300,530.700012 +GOOG,2015-05-08,536.650024,541.150024,525,538.219971,1527600,538.219971 +GOOG,2015-05-11,538.369995,541.97998,535.400024,535.700012,905300,535.700012 +GOOG,2015-05-12,531.599976,533.208984,525.26001,529.039978,1634200,529.039978 +GOOG,2015-05-13,530.559998,534.322021,528.655029,529.619995,1252300,529.619995 +GOOG,2015-05-14,533.77002,539,532.409973,538.400024,1403900,538.400024 +GOOG,2015-05-15,539.179993,539.273987,530.380005,533.849976,1971300,533.849976 +GOOG,2015-05-18,532.01001,534.820007,528.849976,532.299988,2003400,532.299988 +GOOG,2015-05-19,533.97998,540.659973,533.039978,537.359985,1966900,537.359985 +GOOG,2015-05-20,538.48999,542.919983,532.971985,539.27002,1430800,539.27002 +GOOG,2015-05-21,537.950012,543.840027,535.97998,542.51001,1462700,542.51001 +GOOG,2015-05-22,540.150024,544.190002,539.51001,540.109985,1176200,540.109985 +GOOG,2015-05-26,538.119995,539,529.880005,532.320007,2406500,532.320007 +GOOG,2015-05-27,532.799988,540.549988,531.710022,539.789978,1525000,539.789978 +GOOG,2015-05-28,538.01001,540.609985,536.25,539.780029,1029800,539.780029 +GOOG,2015-05-29,537.369995,538.630005,531.450012,532.109985,2597400,532.109985 +GOOG,2015-06-01,536.789978,536.789978,529.76001,533.98999,1904300,533.98999 +GOOG,2015-06-02,532.929993,543,531.330017,539.179993,1939000,539.179993 +GOOG,2015-06-03,539.909973,543.5,537.109985,540.309998,1714500,540.309998 +GOOG,2015-06-04,537.76001,540.590027,534.320007,536.700012,1348300,536.700012 +GOOG,2015-06-05,536.349976,537.200012,532.52002,533.330017,1388200,533.330017 +GOOG,2015-06-08,533.309998,534.119995,526.23999,526.830017,1520600,526.830017 +GOOG,2015-06-09,527.559998,529.200012,523.01001,526.690002,1455300,526.690002 +GOOG,2015-06-10,529.359985,538.359985,529.349976,536.690002,1815000,536.690002 +GOOG,2015-06-11,538.424988,538.97998,533.02002,534.609985,1217500,534.609985 +GOOG,2015-06-12,531.599976,533.119995,530.159973,532.330017,955800,532.330017 +GOOG,2015-06-15,528,528.299988,524,527.200012,1632700,527.200012 +GOOG,2015-06-16,528.400024,529.640015,525.559998,528.150024,1071800,528.150024 +GOOG,2015-06-17,529.369995,530.97998,525.099976,529.26001,1294200,529.26001 +GOOG,2015-06-18,531,538.150024,530.789978,536.72998,1833100,536.72998 +GOOG,2015-06-19,537.210022,538.25,533.01001,536.690002,1893500,536.690002 +GOOG,2015-06-22,539.590027,543.73999,537.530029,538.190002,1250300,538.190002 +GOOG,2015-06-23,539.640015,541.499023,535.25,540.47998,1197500,540.47998 +GOOG,2015-06-24,540,540,535.659973,537.840027,1286600,537.840027 +GOOG,2015-06-25,538.869995,540.900024,535.22998,535.22998,1335700,535.22998 +GOOG,2015-06-26,537.26001,537.76001,531.349976,531.690002,2109100,531.690002 +GOOG,2015-06-29,525.01001,528.609985,520.539978,521.52002,1937800,521.52002 +GOOG,2015-06-30,526.02002,526.25,520.5,520.51001,2217200,520.51001 +GOOG,2015-07-01,524.72998,525.690002,518.22998,521.840027,1961000,521.840027 +GOOG,2015-07-02,521.080017,524.650024,521.080017,523.400024,1235900,523.400024 +GOOG,2015-07-06,519.5,525.25,519,522.859985,1280500,522.859985 +GOOG,2015-07-07,523.130005,526.179993,515.179993,525.02002,1597200,525.02002 +GOOG,2015-07-08,521.049988,522.734009,516.109985,516.830017,1296700,516.830017 +GOOG,2015-07-09,523.119995,523.77002,520.349976,520.679993,1839400,520.679993 +GOOG,2015-07-10,526.289978,532.559998,525.549988,530.130005,1956700,530.130005 +GOOG,2015-07-13,532.880005,547.109985,532.400024,546.549988,2206500,546.549988 +GOOG,2015-07-14,546.76001,565.848999,546.710022,561.099976,3244100,561.099976 +GOOG,2015-07-15,560.130005,566.502991,556.789978,560.219971,1784600,560.219971 +GOOG,2015-07-16,565.119995,580.679993,565,579.849976,4768300,579.849976 +GOOG,2015-07-17,649,674.468018,645,672.929993,11164900,672.929993 +GOOG,2015-07-20,659.23999,668.880005,653.01001,663.02002,5860900,663.02002 +GOOG,2015-07-21,655.210022,673,654.299988,662.299988,3377200,662.299988 +GOOG,2015-07-22,660.890015,678.640015,659,662.099976,3929300,662.099976 +GOOG,2015-07-23,661.27002,663.630005,641,644.280029,3029100,644.280029 +GOOG,2015-07-24,647,648.169983,622.52002,623.559998,3625700,623.559998 +GOOG,2015-07-27,621,634.299988,620.5,627.26001,2675400,627.26001 +GOOG,2015-07-28,632.830017,632.830017,623.309998,628,1727300,628 +GOOG,2015-07-29,628.799988,633.359985,622.650024,631.929993,1575100,631.929993 +GOOG,2015-07-30,630,635.219971,622.049988,632.590027,1474200,632.590027 +GOOG,2015-07-31,631.380005,632.909973,625.5,625.609985,1706100,625.609985 +GOOG,2015-08-03,625.340027,633.05603,625.340027,631.210022,1304500,631.210022 +GOOG,2015-08-04,628.419983,634.809998,627.159973,629.25,1490900,629.25 +GOOG,2015-08-05,634.330017,647.859985,633.159973,643.780029,2334300,643.780029 +GOOG,2015-08-06,645,645.379028,632.25,642.679993,1572600,642.679993 +GOOG,2015-08-07,640.22998,642.679993,629.710022,635.299988,1403900,635.299988 +GOOG,2015-08-10,639.47998,643.440002,631.249023,633.72998,1809200,633.72998 +GOOG,2015-08-11,669.200012,674.900024,654.27002,660.780029,5029200,660.780029 +GOOG,2015-08-12,663.080017,665,652.289978,659.559998,2936700,659.559998 +GOOG,2015-08-13,659.322021,664.5,651.661011,656.450012,1810700,656.450012 +GOOG,2015-08-14,655.01001,659.85498,652.659973,657.119995,1072100,657.119995 +GOOG,2015-08-17,656.799988,661.380005,651.23999,660.869995,1051700,660.869995 +GOOG,2015-08-18,661.900024,664,653.460022,656.130005,1456100,656.130005 +GOOG,2015-08-19,656.599976,667,654.190002,660.900024,2131600,660.900024 +GOOG,2015-08-20,655.460022,662.98999,642.900024,646.830017,2855300,646.830017 +GOOG,2015-08-21,639.780029,640.049988,612.330017,612.47998,4265200,612.47998 +GOOG,2015-08-24,573,599.330017,565.049988,589.609985,5770300,589.609985 +GOOG,2015-08-25,614.909973,617.450012,581.109985,582.059998,3538000,582.059998 +GOOG,2015-08-26,610.349976,631.710022,599.049988,628.619995,4235900,628.619995 +GOOG,2015-08-27,639.400024,643.590027,622,637.609985,3491300,637.609985 +GOOG,2015-08-28,632.820007,636.880005,624.559998,630.380005,1978700,630.380005 +GOOG,2015-08-31,627.539978,635.799988,617.679993,618.25,2176700,618.25 +GOOG,2015-09-01,602.359985,612.859985,594.099976,597.789978,3702100,597.789978 +GOOG,2015-09-02,605.590027,614.340027,599.710022,614.340027,2575600,614.340027 +GOOG,2015-09-03,617,619.710022,602.820984,606.25,1759600,606.25 +GOOG,2015-09-04,600,603.469971,595.25,600.700012,2089000,600.700012 +GOOG,2015-09-08,612.48999,616.309998,604.119995,614.659973,2279500,614.659973 +GOOG,2015-09-09,621.219971,626.52002,609.599976,612.719971,1702100,612.719971 +GOOG,2015-09-10,613.099976,624.159973,611.429993,621.349976,1905300,621.349976 +GOOG,2015-09-11,619.75,625.780029,617.419983,625.77002,1373500,625.77002 +GOOG,2015-09-14,625.700012,625.859985,619.429993,623.23999,1702300,623.23999 +GOOG,2015-09-15,626.700012,638.700012,623.780029,635.140015,2084400,635.140015 +GOOG,2015-09-16,635.469971,637.950012,632.320007,635.97998,1286500,635.97998 +GOOG,2015-09-17,637.789978,650.900024,635.02002,642.900024,2274700,642.900024 +GOOG,2015-09-18,636.789978,640,627.02002,629.25,5133400,629.25 +GOOG,2015-09-21,634.400024,636.48999,625.940002,635.440002,1788500,635.440002 +GOOG,2015-09-22,627,627.549988,615.429993,622.690002,2562900,622.690002 +GOOG,2015-09-23,622.049988,628.929993,620,622.359985,1470900,622.359985 +GOOG,2015-09-24,616.640015,627.320007,612.400024,625.799988,2240100,625.799988 +GOOG,2015-09-25,629.77002,629.77002,611,611.969971,2174000,611.969971 +GOOG,2015-09-28,610.340027,614.60498,589.380005,594.890015,3127700,594.890015 +GOOG,2015-09-29,597.280029,605,590.219971,594.969971,2309500,594.969971 +GOOG,2015-09-30,603.280029,608.76001,600.72998,608.419983,2413400,608.419983 +GOOG,2015-10-01,608.369995,612.090027,599.849976,611.289978,1867600,611.289978 +GOOG,2015-10-02,607.200012,627.340027,603.130005,626.909973,2684800,626.909973 +GOOG,2015-10-05,632,643.01001,627,641.469971,1803600,641.469971 +GOOG,2015-10-06,638.840027,649.25,636.530029,645.440002,2166300,645.440002 +GOOG,2015-10-07,649.23999,650.609009,632.150024,642.359985,2092700,642.359985 +GOOG,2015-10-08,641.359985,644.450012,625.559998,639.159973,2182100,639.159973 +GOOG,2015-10-09,640,645.98999,635.317993,643.609985,1648700,643.609985 +GOOG,2015-10-12,642.090027,648.5,639.01001,646.669983,1275200,646.669983 +GOOG,2015-10-13,643.150024,657.812012,643.150024,652.299988,1807700,652.299988 +GOOG,2015-10-14,653.210022,659.390015,648.849976,651.159973,1415500,651.159973 +GOOG,2015-10-15,654.659973,663.130005,654.460022,661.73999,1885700,661.73999 +GOOG,2015-10-16,664.109985,664.969971,657.200012,662.200012,1611100,662.200012 +GOOG,2015-10-19,661.179993,666.820007,659.580017,666.099976,1477300,666.099976 +GOOG,2015-10-20,664.039978,664.719971,644.195007,650.280029,2490000,650.280029 +GOOG,2015-10-21,654.150024,655.869995,641.72998,642.609985,1791100,642.609985 +GOOG,2015-10-22,646.700012,657.799988,644.01001,651.789978,4071000,651.789978 +GOOG,2015-10-23,727.5,730,701.5,702,6653900,702 +GOOG,2015-10-26,701.549988,719.150024,701.26001,712.780029,2716600,712.780029 +GOOG,2015-10-27,707.380005,713.619995,704.549988,708.48999,2245800,708.48999 +GOOG,2015-10-28,707.330017,712.97998,703.080017,712.950012,2178900,712.950012 +GOOG,2015-10-29,710.5,718.26001,710.01001,716.919983,1456000,716.919983 +GOOG,2015-10-30,715.72998,718,710.049988,710.809998,1908800,710.809998 +GOOG,2015-11-02,711.059998,721.619995,705.849976,721.109985,1886300,721.109985 +GOOG,2015-11-03,718.859985,724.650024,714.719971,722.159973,1565400,722.159973 +GOOG,2015-11-04,722,733.099976,721.900024,728.109985,1706700,728.109985 +GOOG,2015-11-05,729.469971,739.47998,729.469971,731.25,1861600,731.25 +GOOG,2015-11-06,731.5,735.409973,727.01001,733.76001,1511600,733.76001 +GOOG,2015-11-09,730.200012,734.710022,719.429993,724.890015,2069800,724.890015 +GOOG,2015-11-10,724.400024,730.590027,718.5,728.320007,1608000,728.320007 +GOOG,2015-11-11,732.460022,741,730.22998,735.400024,1366400,735.400024 +GOOG,2015-11-12,731,737.799988,728.64502,731.22998,1837200,731.22998 +GOOG,2015-11-13,729.169983,731.150024,716.72998,717,2075500,717 +GOOG,2015-11-16,715.599976,729.48999,711.330017,728.960022,1905900,728.960022 +GOOG,2015-11-17,729.289978,731.844971,723.026978,725.299988,1510900,725.299988 +GOOG,2015-11-18,727.580017,741.409973,727,740,1684300,740 +GOOG,2015-11-19,738.73999,742,737.429993,738.409973,1327100,738.409973 +GOOG,2015-11-20,746.530029,757.919983,743,756.599976,2212300,756.599976 +GOOG,2015-11-23,757.450012,762.708008,751.820007,755.97998,1414500,755.97998 +GOOG,2015-11-24,752,755.278992,737.630005,748.280029,2333100,748.280029 +GOOG,2015-11-25,748.140015,752,746.059998,748.150024,1122100,748.150024 +GOOG,2015-11-27,748.460022,753.409973,747.48999,750.26001,838500,750.26001 +GOOG,2015-11-30,748.809998,754.929993,741.27002,742.599976,2097600,742.599976 +GOOG,2015-12-01,747.109985,768.950012,746.700012,767.039978,2134600,767.039978 +GOOG,2015-12-02,768.900024,775.955017,758.960022,762.380005,2230400,762.380005 +GOOG,2015-12-03,766.01001,768.994995,745.630005,752.539978,2590600,752.539978 +GOOG,2015-12-04,753.099976,768.48999,750,766.809998,2757300,766.809998 +GOOG,2015-12-07,767.77002,768.72998,755.090027,763.25,1812300,763.25 +GOOG,2015-12-08,757.890015,764.799988,754.200012,762.369995,1829500,762.369995 +GOOG,2015-12-09,759.169983,764.22998,737.000977,751.609985,2700000,751.609985 +GOOG,2015-12-10,752.849976,755.849976,743.830017,749.460022,1984900,749.460022 +GOOG,2015-12-11,741.159973,745.710022,736.75,738.869995,2224400,738.869995 +GOOG,2015-12-14,741.789978,748.72998,724.169983,747.77002,2412500,747.77002 +GOOG,2015-12-15,753,758.080017,743.01001,743.400024,2666200,743.400024 +GOOG,2015-12-16,750,760.590027,739.434998,758.090027,1993300,758.090027 +GOOG,2015-12-17,762.419983,762.679993,749,749.429993,1553400,749.429993 +GOOG,2015-12-18,746.51001,754.130005,738.150024,739.309998,3148700,739.309998 +GOOG,2015-12-21,746.130005,750,740,747.77002,1525700,747.77002 +GOOG,2015-12-22,751.650024,754.849976,745.530029,750,1365400,750 +GOOG,2015-12-23,753.469971,754.210022,744,750.309998,1565900,750.309998 +GOOG,2015-12-24,749.549988,751.349976,746.619995,748.400024,527200,748.400024 +GOOG,2015-12-28,752.919983,762.98999,749.52002,762.51001,1515300,762.51001 +GOOG,2015-12-29,766.690002,779.97998,766.429993,776.599976,1765000,776.599976 +GOOG,2015-12-30,776.599976,777.599976,766.900024,771,1293300,771 +GOOG,2015-12-31,769.5,769.5,758.340027,758.880005,1489600,758.880005 +GOOG,2016-01-04,743,744.059998,731.257996,741.840027,3272800,741.840027 +GOOG,2016-01-05,746.450012,752,738.640015,742.580017,1950700,742.580017 +GOOG,2016-01-06,730,747.179993,728.919983,743.619995,1947000,743.619995 +GOOG,2016-01-07,730.309998,738.5,719.059998,726.390015,2963700,726.390015 +GOOG,2016-01-08,731.450012,733.22998,713,714.469971,2450900,714.469971 +GOOG,2016-01-11,716.609985,718.85498,703.539978,716.030029,2090600,716.030029 +GOOG,2016-01-12,721.679993,728.75,717.317017,726.070007,2024500,726.070007 +GOOG,2016-01-13,730.849976,734.73999,698.609985,700.559998,2501700,700.559998 +GOOG,2016-01-14,705.380005,721.924988,689.099976,714.719971,2225800,714.719971 +GOOG,2016-01-15,692.289978,706.73999,685.369995,694.450012,3592400,694.450012 +GOOG,2016-01-19,703.299988,709.97998,693.409973,701.789978,2268100,701.789978 +GOOG,2016-01-20,688.609985,706.849976,673.26001,698.450012,3445000,698.450012 +GOOG,2016-01-21,702.179993,719.190002,694.460022,706.590027,2412200,706.590027 +GOOG,2016-01-22,723.599976,728.130005,720.120972,725.25,2011800,725.25 +GOOG,2016-01-25,723.580017,729.679993,710.01001,711.669983,1711700,711.669983 +GOOG,2016-01-26,713.849976,718.280029,706.47998,713.039978,1331700,713.039978 +GOOG,2016-01-27,713.669983,718.234985,694.390015,699.98999,2194200,699.98999 +GOOG,2016-01-28,722.219971,733.690002,712.349976,730.960022,2676400,730.960022 +GOOG,2016-01-29,731.530029,744.98999,726.799988,742.950012,3474300,742.950012 +GOOG,2016-02-01,750.460022,757.859985,743.27002,752,5139200,752 +GOOG,2016-02-02,784.5,789.869995,764.650024,764.650024,6348100,764.650024 +GOOG,2016-02-03,770.219971,774.5,720.5,726.950012,6171000,726.950012 +GOOG,2016-02-04,722.809998,727,701.859985,708.01001,5168700,708.01001 +GOOG,2016-02-05,703.869995,703.98999,680.150024,683.570007,5105700,683.570007 +GOOG,2016-02-08,667.849976,684.030029,663.059998,682.73999,4247400,682.73999 +GOOG,2016-02-09,672.320007,699.900024,668.77002,678.109985,3608900,678.109985 +GOOG,2016-02-10,686.859985,701.309998,682.130005,684.119995,2638000,684.119995 +GOOG,2016-02-11,675,689.349976,668.867981,683.109985,3024000,683.109985 +GOOG,2016-02-12,690.26001,693.75,678.599976,682.400024,2141400,682.400024 +GOOG,2016-02-16,692.97998,698,685.049988,691,2520000,691 +GOOG,2016-02-17,698.090027,709.75,691.380005,708.400024,2492600,708.400024 +GOOG,2016-02-18,710,712.349976,696.030029,697.349976,1883200,697.349976 +GOOG,2016-02-19,695.030029,703.080994,694.049988,700.909973,1589300,700.909973 +GOOG,2016-02-22,707.450012,713.23999,702.51001,706.460022,1949800,706.460022 +GOOG,2016-02-23,701.450012,708.400024,693.580017,695.849976,2009300,695.849976 +GOOG,2016-02-24,688.919983,700,680.780029,699.559998,1963600,699.559998 +GOOG,2016-02-25,700.01001,705.97998,690.585022,705.75,1642200,705.75 +GOOG,2016-02-26,708.580017,713.429993,700.859985,705.070007,2243500,705.070007 +GOOG,2016-02-29,700.320007,710.890015,697.679993,697.77002,2481100,697.77002 +GOOG,2016-03-01,703.619995,718.809998,699.77002,718.809998,2151400,718.809998 +GOOG,2016-03-02,719,720,712,718.849976,1629000,718.849976 +GOOG,2016-03-03,718.679993,719.450012,706.02002,712.419983,1958000,712.419983 +GOOG,2016-03-04,714.98999,716.48999,706.02002,710.890015,1972100,710.890015 +GOOG,2016-03-07,706.900024,708.091003,686.900024,695.159973,2985100,695.159973 +GOOG,2016-03-08,688.590027,703.789978,685.340027,693.969971,2076300,693.969971 +GOOG,2016-03-09,698.469971,705.679993,694,705.23999,1421500,705.23999 +GOOG,2016-03-10,708.119995,716.440002,703.359985,712.820007,2833500,712.820007 +GOOG,2016-03-11,720,726.919983,717.125,726.820007,1970800,726.820007 +GOOG,2016-03-14,726.809998,735.5,725.150024,730.48999,1718300,730.48999 +GOOG,2016-03-15,726.919983,732.289978,724.77002,728.330017,1721000,728.330017 +GOOG,2016-03-16,726.369995,737.469971,724.51001,736.090027,1624400,736.090027 +GOOG,2016-03-17,736.450012,743.070007,736,737.780029,1860800,737.780029 +GOOG,2016-03-18,741.859985,742,731.830017,737.599976,2980700,737.599976 +GOOG,2016-03-21,736.5,742.5,733.515991,742.090027,1836500,742.090027 +GOOG,2016-03-22,737.460022,745,737.460022,740.75,1269700,740.75 +GOOG,2016-03-23,742.359985,745.719971,736.150024,738.059998,1432100,738.059998 +GOOG,2016-03-24,732.01001,737.747009,731,735.299988,1594900,735.299988 +GOOG,2016-03-28,736.789978,738.98999,732.5,733.530029,1301300,733.530029 +GOOG,2016-03-29,734.590027,747.25,728.76001,744.77002,1903800,744.77002 +GOOG,2016-03-30,750.099976,757.880005,748.73999,750.530029,1782400,750.530029 +GOOG,2016-03-31,749.25,750.849976,740.940002,744.950012,1718800,744.950012 +GOOG,2016-04-01,738.599976,750.340027,737,749.909973,1576700,749.909973 +GOOG,2016-04-04,750.059998,752.799988,742.429993,745.289978,1134200,745.289978 +GOOG,2016-04-05,738,742.799988,735.369995,737.799988,1132300,737.799988 +GOOG,2016-04-06,735.77002,746.23999,735.559998,745.690002,1053700,745.690002 +GOOG,2016-04-07,745.369995,747,736.280029,740.280029,1453200,740.280029 +GOOG,2016-04-08,743.969971,745.450012,735.549988,739.150024,1290800,739.150024 +GOOG,2016-04-11,743.02002,745,736.049988,736.099976,1220100,736.099976 +GOOG,2016-04-12,738,743.830017,731.01001,743.090027,1353000,743.090027 +GOOG,2016-04-13,749.159973,754.380005,744.260986,751.719971,1707100,751.719971 +GOOG,2016-04-14,754.01001,757.309998,752.705017,753.200012,1135300,753.200012 +GOOG,2016-04-15,753.97998,761,752.69397,759,1809300,759 +GOOG,2016-04-18,760.460022,768.049988,757.299988,766.609985,1556000,766.609985 +GOOG,2016-04-19,769.51001,769.900024,749.330017,753.929993,2030500,753.929993 +GOOG,2016-04-20,758,758.132019,750.01001,752.669983,1529200,752.669983 +GOOG,2016-04-21,755.380005,760.450012,749.549988,759.140015,3060500,759.140015 +GOOG,2016-04-22,726.299988,736.119995,713.609985,718.77002,5951900,718.77002 +GOOG,2016-04-25,716.099976,723.929993,715.590027,723.150024,1959200,723.150024 +GOOG,2016-04-26,725.419983,725.765991,703.026001,708.140015,2744600,708.140015 +GOOG,2016-04-27,707.289978,708.97998,692.36499,705.840027,3098600,705.840027 +GOOG,2016-04-28,708.26001,714.169983,689.549988,691.02002,2867300,691.02002 +GOOG,2016-04-29,690.700012,697.619995,689,693.01001,2487700,693.01001 +GOOG,2016-05-02,697.630005,700.640015,691,698.210022,1645300,698.210022 +GOOG,2016-05-03,696.869995,697.840027,692,692.359985,1543800,692.359985 +GOOG,2016-05-04,690.48999,699.75,689.01001,695.700012,1693500,695.700012 +GOOG,2016-05-05,697.700012,702.320007,695.719971,701.429993,1683500,701.429993 +GOOG,2016-05-06,698.380005,711.859985,698.106995,711.119995,1826100,711.119995 +GOOG,2016-05-09,712,718.710022,710,712.900024,1510300,712.900024 +GOOG,2016-05-10,716.75,723.5,715.719971,723.179993,1569600,723.179993 +GOOG,2016-05-11,723.409973,724.47998,712.799988,715.289978,1692100,715.289978 +GOOG,2016-05-12,717.059998,719.25,709,713.309998,1360700,713.309998 +GOOG,2016-05-13,711.929993,716.661987,709.26001,710.830017,1314500,710.830017 +GOOG,2016-05-16,709.130005,718.47998,705.650024,716.48999,1317100,716.48999 +GOOG,2016-05-17,715.98999,721.52002,704.109985,706.22998,2001200,706.22998 +GOOG,2016-05-18,703.669983,711.599976,700.630005,706.630005,1766800,706.630005 +GOOG,2016-05-19,702.359985,706,696.799988,700.320007,1670200,700.320007 +GOOG,2016-05-20,701.619995,714.580017,700.52002,709.73999,1828400,709.73999 +GOOG,2016-05-23,706.530029,711.478027,704.179993,704.23999,1330700,704.23999 +GOOG,2016-05-24,706.859985,720.969971,706.859985,720.090027,1929500,720.090027 +GOOG,2016-05-25,720.76001,727.51001,719.705017,725.27002,1629200,725.27002 +GOOG,2016-05-26,722.869995,728.330017,720.280029,724.119995,1576300,724.119995 +GOOG,2016-05-27,724.01001,733.935974,724,732.659973,1974000,732.659973 +GOOG,2016-05-31,731.73999,739.72998,731.26001,735.719971,2129500,735.719971 +GOOG,2016-06-01,734.530029,737.210022,730.659973,734.150024,1253600,734.150024 +GOOG,2016-06-02,732.5,733.02002,724.169983,730.400024,1341800,730.400024 +GOOG,2016-06-03,729.27002,729.48999,720.559998,722.340027,1226300,722.340027 +GOOG,2016-06-06,724.909973,724.909973,714.609985,716.549988,1565300,716.549988 +GOOG,2016-06-07,719.840027,721.97998,716.549988,716.650024,1336200,716.650024 +GOOG,2016-06-08,723.960022,728.570007,720.580017,728.280029,1583700,728.280029 +GOOG,2016-06-09,722.869995,729.539978,722.335999,728.580017,988900,728.580017 +GOOG,2016-06-10,719.469971,725.890015,716.429993,719.409973,1216400,719.409973 +GOOG,2016-06-13,716.51001,725.440002,716.51001,718.359985,1258900,718.359985 +GOOG,2016-06-14,716.47998,722.469971,713.119995,718.27002,1306100,718.27002 +GOOG,2016-06-15,719,722.97998,717.309998,718.919983,1214500,718.919983 +GOOG,2016-06-16,714.909973,716.650024,703.26001,710.359985,1982500,710.359985 +GOOG,2016-06-17,708.650024,708.820007,688.452026,691.719971,3402400,691.719971 +GOOG,2016-06-20,698.77002,702.47998,693.409973,693.710022,2082500,693.710022 +GOOG,2016-06-21,698.400024,702.77002,692.01001,695.940002,1465600,695.940002 +GOOG,2016-06-22,699.059998,700.859985,693.08197,697.460022,1184300,697.460022 +GOOG,2016-06-23,697.450012,701.950012,687,701.869995,2171400,701.869995 +GOOG,2016-06-24,675.169983,689.400024,673.450012,675.219971,4449000,675.219971 +GOOG,2016-06-27,671,672.299988,663.283997,668.26001,2629000,668.26001 +GOOG,2016-06-28,678.969971,680.330017,673,680.039978,2173800,680.039978 +GOOG,2016-06-29,683,687.429016,681.409973,684.109985,1932600,684.109985 +GOOG,2016-06-30,685.469971,692.320007,683.650024,692.099976,1597700,692.099976 +GOOG,2016-07-01,692.200012,700.650024,692.130005,699.210022,1344700,699.210022 +GOOG,2016-07-05,696.059998,696.940002,688.880005,694.950012,1462600,694.950012 +GOOG,2016-07-06,689.97998,701.679993,689.090027,697.77002,1411900,697.77002 +GOOG,2016-07-07,698.080017,698.200012,688.215027,695.359985,1304200,695.359985 +GOOG,2016-07-08,699.5,705.710022,696.434998,705.630005,1575200,705.630005 +GOOG,2016-07-11,708.049988,716.51001,707.23999,715.090027,1111800,715.090027 +GOOG,2016-07-12,719.119995,722.940002,715.909973,720.640015,1336900,720.640015 +GOOG,2016-07-13,723.619995,724,716.849976,716.97998,935900,716.97998 +GOOG,2016-07-14,721.580017,722.210022,718.030029,720.950012,950200,720.950012 +GOOG,2016-07-15,725.72998,725.73999,719.054993,719.849976,1279300,719.849976 +GOOG,2016-07-18,722.710022,736.130005,721.190002,733.780029,1295500,733.780029 +GOOG,2016-07-19,729.890015,736.98999,729,736.960022,1227500,736.960022 +GOOG,2016-07-20,737.330017,742.130005,737.099976,741.190002,1289700,741.190002 +GOOG,2016-07-21,740.359985,741.690002,735.830994,738.630005,1026300,738.630005 +GOOG,2016-07-22,741.859985,743.23999,736.559998,742.73999,1259800,742.73999 +GOOG,2016-07-25,740.669983,742.609985,737.5,739.77002,1032400,739.77002 +GOOG,2016-07-26,739.039978,741.690002,734.27002,738.419983,1186700,738.419983 +GOOG,2016-07-27,738.280029,744.460022,737,741.77002,1512500,741.77002 +GOOG,2016-07-28,747.039978,748.650024,739.299988,745.909973,3530200,745.909973 +GOOG,2016-07-29,772.710022,778.549988,766.77002,768.789978,3841500,768.789978 +GOOG,2016-08-01,761.090027,780.429993,761.090027,772.880005,2700500,772.880005 +GOOG,2016-08-02,768.690002,775.840027,767.849976,771.070007,1784500,771.070007 +GOOG,2016-08-03,767.179993,773.210022,766.820007,773.179993,1287400,773.179993 +GOOG,2016-08-04,772.219971,774.070007,768.794983,771.609985,1140300,771.609985 +GOOG,2016-08-05,773.780029,783.039978,772.340027,782.219971,1801200,782.219971 +GOOG,2016-08-08,782,782.630005,778.091003,781.76001,1107900,781.76001 +GOOG,2016-08-09,781.099976,788.940002,780.570007,784.26001,1318900,784.26001 +GOOG,2016-08-10,783.75,786.812012,782.778015,784.679993,786400,784.679993 +GOOG,2016-08-11,785,789.75,782.969971,784.849976,975100,784.849976 +GOOG,2016-08-12,781.5,783.39502,780.400024,783.219971,740500,783.219971 +GOOG,2016-08-15,783.75,787.48999,780.109985,782.440002,938200,782.440002 +GOOG,2016-08-16,780.299988,780.97998,773.44397,777.140015,1028000,777.140015 +GOOG,2016-08-17,777.320007,780.809998,773.530029,779.909973,924200,779.909973 +GOOG,2016-08-18,780.01001,782.859985,777,777.5,719400,777.5 +GOOG,2016-08-19,775,777.099976,773.130005,775.419983,861500,775.419983 +GOOG,2016-08-22,773.27002,774.539978,770.049988,772.150024,951400,772.150024 +GOOG,2016-08-23,775.47998,776.440002,771.784973,772.080017,928200,772.080017 +GOOG,2016-08-24,770.580017,774.5,767.070007,769.640015,1072000,769.640015 +GOOG,2016-08-25,767,771.890015,763.184998,769.409973,926900,769.409973 +GOOG,2016-08-26,769,776.080017,765.849976,769.539978,1166700,769.539978 +GOOG,2016-08-29,768.73999,774.98999,766.61499,772.150024,847600,772.150024 +GOOG,2016-08-30,769.330017,774.466003,766.840027,769.090027,1130000,769.090027 +GOOG,2016-08-31,767.01001,769.090027,765.380005,767.049988,1248600,767.049988 +GOOG,2016-09-01,769.25,771.02002,764.299988,768.780029,925100,768.780029 +GOOG,2016-09-02,773.01001,773.919983,768.409973,771.460022,1072700,771.460022 +GOOG,2016-09-06,773.450012,782,771,780.080017,1442800,780.080017 +GOOG,2016-09-07,780,782.72998,776.200012,780.349976,893700,780.349976 +GOOG,2016-09-08,778.590027,780.349976,773.580017,775.320007,1270300,775.320007 +GOOG,2016-09-09,770.099976,773.244995,759.659973,759.659973,1885500,759.659973 +GOOG,2016-09-12,755.130005,770.289978,754,769.02002,1311000,769.02002 +GOOG,2016-09-13,764.47998,766.219971,755.799988,759.690002,1395000,759.690002 +GOOG,2016-09-14,759.609985,767.679993,759.109985,762.48999,1087400,762.48999 +GOOG,2016-09-15,762.890015,773.799988,759.960022,771.76001,1305100,771.76001 +GOOG,2016-09-16,769.75,769.75,764.659973,768.880005,2049300,768.880005 +GOOG,2016-09-19,772.419983,774,764.440979,765.700012,1172800,765.700012 +GOOG,2016-09-20,769,773.330017,768.530029,771.409973,978600,771.409973 +GOOG,2016-09-21,772.659973,777.159973,768.301025,776.219971,1167800,776.219971 +GOOG,2016-09-22,780,789.849976,778.440002,787.210022,1486200,787.210022 +GOOG,2016-09-23,786.590027,788.929993,784.150024,786.900024,1411900,786.900024 +GOOG,2016-09-26,782.73999,782.73999,773.070007,774.210022,1533200,774.210022 +GOOG,2016-09-27,775.5,785.98999,774.307983,783.01001,1153200,783.01001 +GOOG,2016-09-28,777.849976,781.809998,774.969971,781.559998,1109800,781.559998 +GOOG,2016-09-29,781.440002,785.799988,774.231995,775.01001,1314700,775.01001 +GOOG,2016-09-30,776.330017,780.940002,774.090027,777.289978,1585300,777.289978 +GOOG,2016-10-03,774.25,776.065002,769.5,772.559998,1278800,772.559998 +GOOG,2016-10-04,776.030029,778.710022,772.890015,776.429993,1201400,776.429993 +GOOG,2016-10-05,779.309998,782.070007,775.650024,776.469971,1461200,776.469971 +GOOG,2016-10-06,779,780.47998,775.539978,776.859985,1070700,776.859985 +GOOG,2016-10-07,779.659973,779.659973,770.75,775.080017,933200,775.080017 +GOOG,2016-10-10,777.710022,789.380005,775.869995,785.940002,1174900,785.940002 +GOOG,2016-10-11,786.659973,792.280029,780.580017,783.070007,1372500,783.070007 +GOOG,2016-10-12,783.76001,788.130005,782.059998,786.140015,937400,786.140015 +GOOG,2016-10-13,781.219971,781.219971,773,778.190002,1365300,778.190002 +GOOG,2016-10-14,781.650024,783.950012,776,778.530029,852500,778.530029 +GOOG,2016-10-17,779.799988,785.849976,777.5,779.960022,1093000,779.960022 +GOOG,2016-10-18,787.849976,801.609985,785.565002,795.26001,2056900,795.26001 +GOOG,2016-10-19,798.23999,804.599976,798.030029,801.5,1766800,801.5 +GOOG,2016-10-20,803.299988,803.969971,796.030029,796.969971,1757500,796.969971 +GOOG,2016-10-21,795,799.5,794,799.369995,1266200,799.369995 +GOOG,2016-10-24,804.900024,815.179993,804.820007,813.109985,1697500,813.109985 +GOOG,2016-10-25,816.679993,816.679993,805.140015,807.669983,1576400,807.669983 +GOOG,2016-10-26,806.340027,806.97998,796.320007,799.070007,1647700,799.070007 +GOOG,2016-10-27,801,803.48999,791.5,795.349976,2749200,795.349976 +GOOG,2016-10-28,808.349976,815.48999,793.590027,795.369995,4269900,795.369995 +GOOG,2016-10-31,795.469971,796.859985,784,784.539978,2427300,784.539978 +GOOG,2016-11-01,782.890015,789.48999,775.539978,783.609985,2406400,783.609985 +GOOG,2016-11-02,778.200012,781.650024,763.450012,768.700012,1872400,768.700012 +GOOG,2016-11-03,767.25,769.950012,759.030029,762.130005,1943200,762.130005 +GOOG,2016-11-04,750.659973,770.359985,750.560974,762.02002,2134800,762.02002 +GOOG,2016-11-07,774.5,785.190002,772.549988,782.52002,1585100,782.52002 +GOOG,2016-11-08,783.400024,795.632996,780.190002,790.51001,1350800,790.51001 +GOOG,2016-11-09,779.940002,791.22699,771.669983,785.309998,2602700,785.309998 +GOOG,2016-11-10,791.169983,791.169983,752.179993,762.559998,4740100,762.559998 +GOOG,2016-11-11,756.539978,760.780029,750.380005,754.02002,2394000,754.02002 +GOOG,2016-11-14,755.599976,757.849976,727.539978,736.080017,3631700,736.080017 +GOOG,2016-11-15,746.969971,764.416016,746.969971,758.48999,2341200,758.48999 +GOOG,2016-11-16,755.200012,766.359985,750.51001,764.47998,1465200,764.47998 +GOOG,2016-11-17,766.919983,772.700012,764.22998,771.22998,1287000,771.22998 +GOOG,2016-11-18,771.369995,775,760,760.539978,1526200,760.539978 +GOOG,2016-11-21,762.609985,769.700012,760.599976,769.200012,1323000,769.200012 +GOOG,2016-11-22,772.630005,776.960022,767,768.27002,1591800,768.27002 +GOOG,2016-11-23,767.72998,768.28302,755.25,760.98999,1477400,760.98999 +GOOG,2016-11-25,764.26001,765,760.52002,761.679993,586000,761.679993 +GOOG,2016-11-28,760,779.530029,759.799988,768.23999,2172200,768.23999 +GOOG,2016-11-29,771.530029,778.5,768.23999,770.840027,1604500,770.840027 +GOOG,2016-11-30,770.070007,772.98999,754.830017,758.039978,2365800,758.039978 +GOOG,2016-12-01,757.440002,759.849976,737.025024,747.919983,2996900,747.919983 +GOOG,2016-12-02,744.590027,754,743.099976,750.5,1448700,750.5 +GOOG,2016-12-05,757.710022,763.900024,752.900024,762.52002,1382900,762.52002 +GOOG,2016-12-06,764.72998,768.830017,757.340027,759.109985,1632800,759.109985 +GOOG,2016-12-07,761,771.359985,755.799988,771.190002,1750800,771.190002 +GOOG,2016-12-08,772.47998,778.179993,767.22998,776.419983,1448200,776.419983 +GOOG,2016-12-09,780,789.429993,779.020996,789.289978,1780500,789.289978 +GOOG,2016-12-12,785.039978,791.25,784.35498,789.27002,2097100,789.27002 +GOOG,2016-12-13,793.900024,804.380005,793.340027,796.099976,2119800,796.099976 +GOOG,2016-12-14,797.400024,804,794.01001,797.070007,1664500,797.070007 +GOOG,2016-12-15,797.340027,803,792.919983,797.849976,1623700,797.849976 +GOOG,2016-12-16,800.400024,800.856018,790.289978,790.799988,2428300,790.799988 +GOOG,2016-12-19,790.219971,797.659973,786.27002,794.200012,1225900,794.200012 +GOOG,2016-12-20,796.76001,798.650024,793.27002,796.419983,925100,796.419983 +GOOG,2016-12-21,795.840027,796.676025,787.099976,794.559998,1208700,794.559998 +GOOG,2016-12-22,792.359985,793.320007,788.580017,791.26001,969100,791.26001 +GOOG,2016-12-23,790.900024,792.73999,787.280029,789.909973,623400,789.909973 +GOOG,2016-12-27,790.679993,797.859985,787.656982,791.549988,789100,791.549988 +GOOG,2016-12-28,793.700012,794.22998,783.200012,785.049988,1132700,785.049988 +GOOG,2016-12-29,783.330017,785.929993,778.919983,782.789978,742200,782.789978 +GOOG,2016-12-30,782.75,782.780029,770.409973,771.820007,1760200,771.820007 diff --git a/data-raw/sample_img_1_volatility.R b/data-raw/sample_img_1_volatility.R new file mode 100644 index 00000000..4c43ec13 --- /dev/null +++ b/data-raw/sample_img_1_volatility.R @@ -0,0 +1,30 @@ +library(tidyquant) +library(ggplot2) +library(lubridate) +library(dplyr) +# Get some data +FANG <- c("META", "AMZN", "NFLX", "GOOG") %>% + tq_get(get = "stock.prices", from = "2007-01-01", to = "2017-01-01") + +# Setup dates for zoom window +end <- ymd("2017-01-01") +start <- end - weeks(20) + +# Visualize!!! +n_mavg <- 20 # Number of periods (days) for moving average +d <- FANG %>% + dplyr::filter(date >= start - lubridate::days(2 * n_mavg)) |> + ggplot(aes(x = date, y = close, group = factor(symbol))) + + geom_candlestick(aes(open = open, close = close, high = high, low = low)) + + geom_bbands(aes(high = high, low = low, close = close), + ma_fun = SMA, n = n_mavg, sd = 2, size = 0.5) + + labs(title = "Multiple Stocks at Once!", + subtitle = "Quickly visualize the volatility of four stocks at once", + x = "", y = "Closing Price") + + coord_x_date(xlim = c(start, end)) + + facet_wrap(~ symbol, scales = "free_y") + + theme_tq() + + scale_y_continuous(labels = scales::label_dollar()) +# Add dropped_aes +d +ggsave("man/figures/sample_img_1_volatility.png") diff --git a/man/figures/sample_img_2_stock_returns.R b/data-raw/sample_img_2_stock_returns.R similarity index 68% rename from man/figures/sample_img_2_stock_returns.R rename to data-raw/sample_img_2_stock_returns.R index 2d274c3a..91d63e6a 100644 --- a/man/figures/sample_img_2_stock_returns.R +++ b/data-raw/sample_img_2_stock_returns.R @@ -1,7 +1,7 @@ library(tidyquant) # Get some data -FANG <- c("FB", "AMZN", "NFLX", "GOOG") %>% +FANG <- c("META", "AMZN", "NFLX", "GOOG") %>% tq_get(get = "stock.prices", from = "2013-01-01", to = "2017-01-01") # Transform to monthly returns using split, apply, combine framework @@ -21,7 +21,7 @@ FANG_wealth <- FANG_returns %>% # Visualize!!! FANG_wealth %>% ggplot(aes(x = date, y = wealth.index, color = symbol)) + - geom_line(size = 2) + + geom_line(linewidth = 2) + geom_smooth(method = "loess") + labs(title = "Individual Stocks: Comparing the Growth of $10K", subtitle = "Quickly visualize stock performance", @@ -30,17 +30,4 @@ FANG_wealth %>% scale_color_tq() + scale_y_continuous(labels = scales::dollar) -ggsave("img/sample_img_2_stock_returns.png") - -# Website - -# FANG_wealth %>% -# ggplot(aes(x = date, y = wealth.index, color = symbol)) + -# geom_line(size = 2) + -# geom_smooth(method = "loess") + -# labs(x = "", y = "Investment Value") + -# theme_tq() + -# scale_color_tq() + -# scale_y_continuous(labels = scales::dollar) -# -# ggsave("docs/README_2_returns.png", height = 4.5, width = 8) +ggsave("man/figures/sample_img_2_stock_returns.png") diff --git a/man/figures/sample_img_3_portfolio_returns.R b/data-raw/sample_img_3_portfolio_returns.R similarity index 71% rename from man/figures/sample_img_3_portfolio_returns.R rename to data-raw/sample_img_3_portfolio_returns.R index 2d56b01b..445a29de 100644 --- a/man/figures/sample_img_3_portfolio_returns.R +++ b/data-raw/sample_img_3_portfolio_returns.R @@ -1,7 +1,7 @@ library(tidyquant) # Get some data -FANG <- c("FB", "AMZN", "NFLX", "GOOG") %>% +FANG <- c("META", "AMZN", "NFLX", "GOOG") %>% tq_get(get = "stock.prices", from = "2013-01-01", to = "2017-01-01") # Transform to monthly returns using split, apply, combine framework @@ -21,22 +21,22 @@ FANG_returns_mult <- FANG_returns %>% # B: Make weights table weights_table <- tribble( ~portfolio, ~stocks, ~weights, - 1, "FB", 0.50, + 1, "META", 0.50, 1, "AMZN", 0.25, 1, "NFLX", 0.25, 1, "GOOG", 0.00, - 2, "FB", 0.00, + 2, "META", 0.00, 2, "AMZN", 0.50, 2, "NFLX", 0.25, 2, "GOOG", 0.25, - 3, "FB", 0.25, + 3, "META", 0.25, 3, "AMZN", 0.00, 3, "NFLX", 0.50, 3, "GOOG", 0.25, - 4, "FB", 0.25, + 4, "META", 0.25, 4, "AMZN", 0.25, 4, "NFLX", 0.00, 4, "GOOG", 0.50) %>% @@ -52,7 +52,7 @@ FANG_portfolio_wealth <- FANG_returns_mult %>% # Visualize!!! FANG_portfolio_wealth %>% ggplot(aes(x = date, y = wealth.index, color = factor(portfolio))) + - geom_line(size = 2) + + geom_line(linewidth = 2) + geom_smooth(method = "loess") + labs(title = "Portfolios: Comparing the Growth of $10K", subtitle = "Quickly visualize blended portfolio performance", @@ -60,21 +60,6 @@ FANG_portfolio_wealth %>% color = "Portfolio Number: ") + theme_tq() + scale_color_tq() + - scale_y_continuous(labels = scales::dollar) + scale_y_continuous(labels = scales::label_dollar()) -ggsave("img/sample_img_3_portfolio_returns.png", width = 7.64, height = 4.5) - - -# Website - -# FANG_portfolio_wealth %>% -# ggplot(aes(x = date, y = wealth.index, color = factor(portfolio))) + -# geom_line(size = 2) + -# geom_smooth(method = "loess") + -# labs(x = "", y = "Investment Value", -# color = "Portfolio Number: ") + -# theme_tq() + -# scale_color_tq() + -# scale_y_continuous(labels = scales::dollar) -# -# ggsave("docs/README_3_port_returns.png", height = 4.5, width = 8) +ggsave("man/figures/sample_img_3_portfolio_returns.png", width = 7.64, height = 4.5) diff --git a/data/FANG.rda b/data/FANG.rda index 5949d01d..0abd422d 100644 Binary files a/data/FANG.rda and b/data/FANG.rda differ diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index 3b4ae0a7..00000000 --- a/docs/404.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - -Page not found (404) • tidyquant - - - - - - - - - - - - -
-
- - - - -
-
- - -Content not found. Please use links in the navbar. - -
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.1.

-
- -
-
- - - - - - - - diff --git a/docs/LICENSE b/docs/LICENSE deleted file mode 100644 index d8bcbd91..00000000 --- a/docs/LICENSE +++ /dev/null @@ -1,2 +0,0 @@ -YEAR: 2016 -COPYRIGHT HOLDER: Matt Dancho diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html deleted file mode 100644 index 27feeb90..00000000 --- a/docs/LICENSE-text.html +++ /dev/null @@ -1,118 +0,0 @@ - -License • tidyquant - - -
-
- - - -
-
- - -
YEAR: 2016
-COPYRIGHT HOLDER: Matt Dancho
-
- -
- - - -
- - - -
- -
-

Site built with pkgdown 2.0.1.

-
- -
- - - - - - - - diff --git a/docs/LICENSE.html b/docs/LICENSE.html deleted file mode 100644 index 444c7461..00000000 --- a/docs/LICENSE.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - -License • tidyquant - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
- -
-
- - -
YEAR: 2016
-COPYRIGHT HOLDER: Matt Dancho
-
- -
- -
- - -
- - -
-

Site built with pkgdown.

-
- -
-
- - - diff --git a/docs/README_1_volatility.png b/docs/README_1_volatility.png deleted file mode 100644 index 3023d1d0..00000000 Binary files a/docs/README_1_volatility.png and /dev/null differ diff --git a/docs/README_2_returns.png b/docs/README_2_returns.png deleted file mode 100644 index 3461bbab..00000000 Binary files a/docs/README_2_returns.png and /dev/null differ diff --git a/docs/README_3_port_returns.png b/docs/README_3_port_returns.png deleted file mode 100644 index b5b2926f..00000000 Binary files a/docs/README_3_port_returns.png and /dev/null differ diff --git a/docs/articles/TQ00-introduction-to-tidyquant.html b/docs/articles/TQ00-introduction-to-tidyquant.html deleted file mode 100644 index 59233e39..00000000 --- a/docs/articles/TQ00-introduction-to-tidyquant.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - -Introduction to tidyquant • tidyquant - - - - - - - - - - - - - -
-
- - - - -
-
- - - - -
-

2-Minutes To Tidyquant -

-

Our short introduction to tidyquant on YouTube.

-

Anomalize

-

Check out our entire Software Intro Series on YouTube!

-
-
-

Benefits -

-
    -
  • A few core functions with a lot of power
  • -
  • Integrates the quantitative analysis functionality of zoo, xts, quantmod, TTR, and PerformanceAnalytics -
  • -
  • Designed for modeling and scaling analyses using the the tidyverse tools in R for Data Science -
  • -
  • Implements ggplot2 functionality for beautiful and meaningful financial visualizations
  • -
  • User-friendly documentation to get you up to speed quickly!
  • -
-
-

A Few Core Functions with A Lot of Power -

-

Minimizing the number of functions reduces the learning curve. What we’ve done is group the core functions into four categories:

-
    -
  1. Get a Stock Index, tq_index(), or a Stock Exchange, tq_exchange(): Returns the stock symbols and various attributes for every stock in an index or exchange. Eighteen indexes and three exchanges are available.

  2. -
  3. Get Quantitative Data, tq_get(): A one-stop shop to get data from various web-sources.

  4. -
  5. Transmute, tq_transmute(), and Mutate, tq_mutate(), Quantitative Data: Perform and scale financial calculations completely within the tidyverse. These workhorse functions integrate the xts, zoo, quantmod, TTR, and PerformanceAnalytics packages.

  6. -
  7. Performance analysis, tq_performance(), and portfolio aggregation, tq_portfolio(): The PerformanceAnalytics integration enables analyzing performance of assets and portfolios. Refer to Performance Analysis with tidyquant.

  8. -
-

For more information, refer to the first topic-specific vignette, Core Functions in tidyquant.

-
-
-

Integrates the Quantitative Analysis Functionality of xts/zoo, quantmod TTR and Performance Analytics -

-

There’s a wide range of useful quantitative analysis functions (QAF) that work with time-series objects. The problem is that many of these wonderful functions don’t work with data frames or the tidyverse workflow. That is until now. The tidyquant package integrates the most useful functions from the xts, zoo, quantmod, TTR, and PerformanceAnalytics packages, enabling seamless usage within the tidyverse workflow.

-

Refer below for information on the performance analysis and portfolio attribution with the PerformanceAnalytics integration.

-

For more information, refer to the second topic-specific vignette, R Quantitative Analysis Package Integrations in tidyquant.

-
-
-

Designed for the data science workflow of the tidyverse -

-

The greatest benefit to tidyquant is the ability to easily model and scale your financial analysis. Scaling is the process of creating an analysis for one security and then extending it to multiple groups. This idea of scaling is incredibly useful to financial analysts because typically one wants to compare many securities to make informed decisions. Fortunately, the tidyquant package integrates with the tidyverse making scaling super simple!

-

All tidyquant functions return data in the tibble (tidy data frame) format, which allows for interaction within the tidyverse. This means we can:

-
    -
  • Seamlessly scale data retrieval and mutations
  • -
  • Use the pipe (%>%) for chaining operations
  • -
  • Use dplyr and tidyr: select, filter, group_by, nest/unnest, spread/gather, etc
  • -
  • Use purrr: mapping functions with map -
  • -
-

For more information, refer to the third topic-specific vignette, Scaling and Modeling with tidyquant.

-
-
-

Implements ggplot2 Functionality for Financial Visualizations -

-

The tidyquant package includes charting tools to assist users in developing quick visualizations in ggplot2 using the grammar of graphics format and workflow.

-

-

For more information, refer to the fourth topic-specific vignette, Charting with tidyquant.

-
-
-

Performance Analysis of Asset and Portfolio Returns -

-

Asset and portfolio performance analysis is a deep field with a wide range of theories and methods for analyzing risk versus reward. The PerformanceAnalytics package consolidates many of the most widely used performance metrics as functions that can be applied to stock or portfolio returns. tidquant implements the functionality with two primary functions:

-
    -
  • -tq_performance implements the performance analysis functions in a tidy way, enabling scaling analysis using the split, apply, combine framework.
  • -
  • -tq_portfolio provides a useful toolset for aggregating a group of individual asset returns into one or many portfolios.
  • -
-

Performance is based on the statistical properties of returns, and as a result both functions use returns as opposed to stock prices.

-

For more information, refer to the fifth topic-specific vignette, Performance Analysis with tidyquant.

-
-
-
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.1.

-
- -
-
- - - - - - - - diff --git a/docs/articles/TQ00-introduction-to-tidyquant_files/figure-html/unnamed-chunk-2-1.png b/docs/articles/TQ00-introduction-to-tidyquant_files/figure-html/unnamed-chunk-2-1.png deleted file mode 100644 index c671e105..00000000 Binary files a/docs/articles/TQ00-introduction-to-tidyquant_files/figure-html/unnamed-chunk-2-1.png and /dev/null differ diff --git a/docs/articles/TQ00-introduction-to-tidyquant_files/header-attrs-2.1/header-attrs.js b/docs/articles/TQ00-introduction-to-tidyquant_files/header-attrs-2.1/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/TQ00-introduction-to-tidyquant_files/header-attrs-2.1/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/TQ01-core-functions-in-tidyquant.html b/docs/articles/TQ01-core-functions-in-tidyquant.html deleted file mode 100644 index 0cd7a622..00000000 --- a/docs/articles/TQ01-core-functions-in-tidyquant.html +++ /dev/null @@ -1,656 +0,0 @@ - - - - - - - -Core Functions in tidyquant • tidyquant - - - - - - - - - - - - - -
-
- - - - -
-
- - - - -
-

A few core functions with a lot of power

-
-
-

Overview -

-

The tidyquant package has a core functions with a lot of power. Few functions means less of a learning curve for the user, which is why there are only a handful of functions the user needs to learn to perform the vast majority of financial analysis tasks. The main functions are:

-
    -
  • Get a Stock Index, tq_index(), or a Stock Exchange, tq_exchange(): Returns the stock symbols and various attributes for every stock in an index or exchange. Eighteen indexes and three exchanges are available.

  • -
  • Get Quantitative Data, tq_get(): A one-stop shop to get data from various web-sources.

  • -
  • Transmute, tq_transmute(), and Mutate, tq_mutate(), Quantitative Data: Perform and scale financial calculations completely within the tidyverse. These workhorse functions integrate the xts, zoo, quantmod, and TTR packages.

  • -
  • Performance analysis, tq_performance(), and portfolio aggregation, tq_portfolio(): The PerformanceAnalytics integration enables analyzing performance of assets and portfolios. Because of the breadth of this topic, refer to Performance Analysis with tidyquant for a tutorial on these functions.

  • -
-
-
-

Prerequisites -

-

Load the tidyquant package to get started.

-
-# Loads tidyquant, lubridate, xts, quantmod, TTR 
-library(tidyverse)
-library(tidyquant)
-
-
-

1.0 Retrieve Consolidated Symbol Data -

-
-

1.1 Stock Indexes -

-

A wide range of stock index / exchange lists can be retrieved using tq_index(). To get a full list of the options, use tq_index_options().

- -
## [1] "DOW"       "DOWGLOBAL" "SP400"     "SP500"     "SP600"
-

Set x as one of the options in the list of options above to get the desired stock index / exchange.

-
-tq_index("SP500")
-

The data source is State Street Global Advisors - US SPDRS ETFs.

-
-
-

1.2 Stock Exchanges -

-

Stock lists for three stock exchanges are available: NASDAQ, NYSE, and AMEX. If you forget, just use tq_exchange_options(). We can easily get the full list of stocks on the NASDAQ exchange.

-
-tq_exchange("NASDAQ")
-
-
-
-

1.0 Get Quantitative Data -

-

The tq_get() function is used to collect data by changing the get argument. The data sources:

-
    -
  1. -Yahoo Finance - Daily stock data
  2. -
  3. -FRED - Economic data
  4. -
  5. -Quandl - Economic, Energy, & Financial Data API
  6. -
  7. -Tiingo - Financial API with sub-daily stock data and crypto-currency
  8. -
  9. -Alpha Vantage - Financial API with sub-daily, ForEx, and crypto-currency data
  10. -
  11. -Bloomberg - Financial API. Paid account is required.
  12. -
-

Use tq_get_options() to see the full list.

- -
##  [1] "stock.prices"       "stock.prices.japan" "dividends"         
-##  [4] "splits"             "economic.data"      "quandl"            
-##  [7] "quandl.datatable"   "tiingo"             "tiingo.iex"        
-## [10] "tiingo.crypto"      "alphavantager"      "alphavantage"      
-## [13] "rblpapi"
-
-

2.1 Yahoo! Finance -

-

The stock prices can be retrieved succinctly using get = "stock.prices". This returns stock price data from Yahoo Finance.

-
-aapl_prices  <- tq_get("AAPL", get = "stock.prices", from = " 1990-01-01")
-aapl_prices 
-
## # A tibble: 8,062 × 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.266
-##  2 AAPL   1990-01-03 0.339 0.339 0.335 0.335 207995200    0.268
-##  3 AAPL   1990-01-04 0.342 0.346 0.333 0.336 221513600    0.269
-##  4 AAPL   1990-01-05 0.337 0.342 0.330 0.337 123312000    0.27 
-##  5 AAPL   1990-01-08 0.335 0.339 0.330 0.339 101572800    0.272
-##  6 AAPL   1990-01-09 0.339 0.339 0.330 0.336  86139200    0.269
-##  7 AAPL   1990-01-10 0.336 0.336 0.319 0.321 199718400    0.257
-##  8 AAPL   1990-01-11 0.324 0.324 0.308 0.308 211052800    0.247
-##  9 AAPL   1990-01-12 0.306 0.310 0.301 0.308 171897600    0.247
-## 10 AAPL   1990-01-15 0.308 0.319 0.306 0.306 161739200    0.245
-## # … with 8,052 more rows
-

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

-
-x8411T <- tq_get("8411.T", get = "stock.prices.japan", from = "2016-01-01", to  = "2016-12-31")
-

The data source is Yahoo Finance and Yahoo Finance Japan.

-
-
-

2.2 FRED Economic Data -

-

A wealth of economic data can be extracted from the Federal Reserve Economic Data (FRED) database. The FRED contains over 10K data sets that are free to use. See the FRED categories to narrow down the data base and to get data codes. The WTI Crude Oil Prices are shown below.

-
-wti_price_usd <- tq_get("DCOILWTICO", get = "economic.data")
-wti_price_usd 
-
## # A tibble: 2,866 × 3
-##    symbol     date       price
-##    <chr>      <date>     <dbl>
-##  1 DCOILWTICO 2011-01-03  91.6
-##  2 DCOILWTICO 2011-01-04  89.4
-##  3 DCOILWTICO 2011-01-05  90.3
-##  4 DCOILWTICO 2011-01-06  88.4
-##  5 DCOILWTICO 2011-01-07  88.1
-##  6 DCOILWTICO 2011-01-10  89.2
-##  7 DCOILWTICO 2011-01-11  91.1
-##  8 DCOILWTICO 2011-01-12  91.8
-##  9 DCOILWTICO 2011-01-13  91.4
-## 10 DCOILWTICO 2011-01-14  91.5
-## # … with 2,856 more rows
-
-
-

2.3 Quandl API -

-

Quandl provides access to a vast number of financial and economic databases. The Quandl package has been integrated into tidyquant as follows.

-
-

Authentication -

-

To make full use of the integration we recommend you set your api key. To do this create or sign into your Quandl account and go to your account api key page.

-
-quandl_api_key("<your-api-key>")
-
-
- -

Searching Quandl from within the R console is possible with quandl_search(), a wrapper for Quandl::Quandl.search(). An example search is shown below. The only required argument is query. You can also visit the Quandl Search webpage to search for available database codes.

-
-quandl_search(query = "Oil", database_code = "NSE", per_page = 3)
-
-
-

Getting Quandl Data -

-

Getting data is integrated into tq_get(). Two get options exist to retrieve Quandl data:

-
    -
  1. -get = "quandl": Get’s Quandl time series data. A wrapper for Quandl().
  2. -
  3. -get = "quandl.datatable": Gets Quandl datatables (larger data sets that may not be time series). A wrapper for Quandl.datatable().
  4. -
-

Getting data from Quandl can be achieved in much the same way as the other “get” options. Just pass the “codes” for the data along with desired arguments for the underlying function.

-

The following uses get = "quandl" and the “WIKI” database to download daily stock prices for FB and AAPL in 2016. The output is a tidy data frame.

-
-c("WIKI/FB", "WIKI/AAPL") %>%
-    tq_get(get  = "quandl",
-           from = "2016-01-01",
-           to   = "2016-12-31")
-

The following time series options are available to be passed to the underlying Quandl() function:

-
    -
  • -start_date (from) = “yyyy-mm-dd” | end_date (to) = “yyyy-mm-dd”
  • -
  • -column_index = numeric column number (e.g. 1)
  • -
  • -rows = numeric row number indicating first n rows (e.g. 100)
  • -
  • -collapse = “none”, “daily”, “weekly”, “monthly”, “quarterly”, “annual”
  • -
  • -transform = “none”, “diff”, “rdiff”, “cumul”, “normalize”
  • -
-

Here’s an example to get period returns of the adj.close (column index 11) using the column_index, collapse and transform arguments.

-
-c("WIKI/FB", "WIKI/AAPL") %>%
-    tq_get(get          = "quandl",
-           from         = "2007-01-01",
-           to           = "2016-12-31",
-           column_index = 11, 
-           collapse     = "annual",      
-           transform    = "rdiff")       
-

Datatables are larger data sets. These can be downloaded using get = "quandl.datatable". Note that the time series arguments do not work with data tables.

-

Here’s several examples of Zacks Fundamentals Collection B

-
-# Zacks Fundamentals Collection B (DOW 30 Available to non subscribers)
-tq_get("ZACKS/FC", get = "quandl.datatable")   # Zacks Fundamentals Condensed
-tq_get("ZACKS/FR", get = "quandl.datatable")   # Zacks Fundamental Ratios
-tq_get("ZACKS/MT", get = "quandl.datatable")   # Zacks Master Table
-tq_get("ZACKS/MKTV", get = "quandl.datatable") # Zacks Market Value Supplement
-tq_get("ZACKS/SHRS", get = "quandl.datatable") # Zacks Shares Out Supplement
-
-
-
-

2.4 Tiingo API -

-

The Tiingo API is a free source for stock prices, cryptocurrencies, and intraday feeds from the IEX (Investors Exchange). This can serve as an alternate source of data to Yahoo! Finance.

-
-

Authentication -

-

To make full use of the integration you need to get an API key and then set your api key. If you don’t have one already, go to Tiingo account and get your FREE API key. You can then set it as follows:

-
-tiingo_api_key('<your-api-key>')
-
-
-

Getting Tiingo Data -

-

The tidyquant package provides convenient wrappers to the riingo package (R interface to Tiingo). Here’s how tq_get() maps to riingo:

-
    -
  • Tiingo Prices: tq_get(get = "tiingo") = riingo::riingo_prices() -
  • -
  • Tiingo IEX Data: tq_get(get = "tiingo.iex") = riingo::riingo_iex_prices() -
  • -
  • Tiingo Crypto Data: tq_get(get = "tiingo.crypto") = riingo::riingo_crypto_prices() -
  • -
-
-# Tiingo Prices (Free alternative to Yahoo Finance!)
-tq_get(c("AAPL", "GOOG"), get = "tiingo", from = "2010-01-01")
-
-# Sub-daily prices from IEX ----
-tq_get(c("AAPL", "GOOG"),
-       get = "tiingo.iex",
-       from   = "2020-01-01",
-       to     = "2020-01-15",
-       resample_frequency = "5min")
-
-# Tiingo Bitcoin in USD ----
-tq_get(c("btcusd"),
-       get    = "tiingo.crypto",
-       from   = "2020-01-01",
-       to     = "2020-01-15",
-       resample_frequency = "5min")
-
-
-
-

2.5 Alpha Vantage API -

-

Alpha Vantage provides access to a real-time and historical financial data. The alphavantager package, a lightweight R interface, has been integrated into tidyquant as follows. The benefit of the integration is the scalability since we can now get multiple symbols returned in a tidy format.

-
-

Authentication -

-

To make full use of the integration you need to get an API key and then set your api key. If you don’t have one already, go to Alpha Vantage account and get your FREE API key. You can then set it as follows:

-
-av_api_key("<your-api-key>")
-
-
-

Getting Alpha Vantage Data -

-

Getting data is simple as the structure follows the Alpha Vantage API documentation. For example, if you wish to retrieve intraday data at 5 minute intervals for FB and MSFT, you can build the parameters x = c("FB", "MSFT"), get = "alphavantager", av_fun = "TIME_SERIES_INTRADAY", interval = "5min". The familiar x and get are the same as you always use. The av_fun argument comes from alphavantager::av_get() and the Alpha Vantage documentation. The interval argument comes from the docs as well.

-
-# Scaling is as simple as supplying multiple symbols
-c("FB", "MSFT") %>%
-    tq_get(get = "alphavantage", av_fun = "TIME_SERIES_INTRADAY", interval = "5min")
-
-
-
-

2.6 Bloomberg -

-

Bloomberg provides access to arguably the most comprehensive financial data and is actively used by most major financial instutions that work with financial data. The Rblpapi package, an R interface to Bloomberg, has been integrated into tidyquant as follows. The benefit of the integration is the scalability since we can now get multiple symbols returned in a tidy format.

-
-

Authentication -

-

To make full use of the integration you need to have a Bloomberg Terminal account (Note this is not a free service). If you have Bloomberg Terminal running on your machine, you can connect as follows:

-
-blpConnect()
-
-
-

Getting Bloomberg Data -

-

Getting data is simple as the structure follows the Rblpapi API documentation. For example, if you wish to retrieve monthly data for SPX Index and AGTHX Equity, you can build the tq_get parameters as follows:

-
    -
  • x = c('SPX Index','ODMAX Equity')
  • -
  • get = "rblpapi"
  • -
  • -rblpapi_fun = "bdh" Note that “bdh” is the default, and options include “bdh” (Bloomberg Data History), “bds” (Bloomberg Data Set), and “bdp” (Bloomberg Data Point)
  • -
  • -from / to These get passed to start.date and end.date and can be provided in “YYYY-MM-DD” character format. Note that start.date and end.date from Rblpapi can be used but must be converted to date or datetime.
  • -
  • Other arguments: These are options that depend on the rblpapi_fun. See Rblpapi documentation.
  • -
-
-# Get Bloomberg data in a tidy data frame
-my_bloomberg_data <- c('SPX Index','ODMAX Equity') %>%
-    tq_get(get         = "Rblpapi",
-           rblpapi_fun = "bdh",
-           fields      = c("PX_LAST"),
-           options     = c("periodicitySelection" = "WEEKLY"),
-           from        = "2016-01-01",
-           to          = "2016-12-31")
-
-
-
-
-

3.0 Mutate Quantitative Data -

-

Mutating functions enable the xts/zoo, quantmod and TTR functions to shine. We’ll touch on the mutation functions briefly using the FANG data set, which consists of daily prices for FB, AMZN, GOOG, and NFLX from the beginning of 2013 to the end of 2016. We’ll apply the functions to grouped data sets to get a feel for how each works

-
-data("FANG")
-
-FANG
-
## # A tibble: 4,032 × 8
-##    symbol date        open  high   low close    volume adjusted
-##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl>
-##  1 FB     2013-01-02  27.4  28.2  27.4  28    69846400     28  
-##  2 FB     2013-01-03  27.9  28.5  27.6  27.8  63140600     27.8
-##  3 FB     2013-01-04  28.0  28.9  27.8  28.8  72715400     28.8
-##  4 FB     2013-01-07  28.7  29.8  28.6  29.4  83781800     29.4
-##  5 FB     2013-01-08  29.5  29.6  28.9  29.1  45871300     29.1
-##  6 FB     2013-01-09  29.7  30.6  29.5  30.6 104787700     30.6
-##  7 FB     2013-01-10  30.6  31.5  30.3  31.3  95316400     31.3
-##  8 FB     2013-01-11  31.3  32.0  31.1  31.7  89598000     31.7
-##  9 FB     2013-01-14  32.1  32.2  30.6  31.0  98892800     31.0
-## 10 FB     2013-01-15  30.6  31.7  29.9  30.1 173242600     30.1
-## # … with 4,022 more rows
-

For a detailed walkthrough of the compatible functions, see the next vignette in the series, R Quantitative Analysis Package Integrations in tidyquant.

-
-

3.1 Transmute Quantitative Data, tq_transmute -

-

Transmute the results of tq_get(). Transmute here holds almost the same meaning as in dplyr, only the newly created columns will be returned, but with tq_transmute(), the number of rows returned can be different than the original data frame. This is important for changing periodicity. An example is periodicity aggregation from daily to monthly.

-
-FANG %>%
-    group_by(symbol) %>%
-    tq_transmute(select = adjusted, mutate_fun = to.monthly, indexAt = "lastof")
-
## # A tibble: 192 × 3
-## # Groups:   symbol [4]
-##    symbol date       adjusted
-##    <chr>  <date>        <dbl>
-##  1 FB     2013-01-31     31.0
-##  2 FB     2013-02-28     27.2
-##  3 FB     2013-03-31     25.6
-##  4 FB     2013-04-30     27.8
-##  5 FB     2013-05-31     24.4
-##  6 FB     2013-06-30     24.9
-##  7 FB     2013-07-31     36.8
-##  8 FB     2013-08-31     41.3
-##  9 FB     2013-09-30     50.2
-## 10 FB     2013-10-31     50.2
-## # … with 182 more rows
-

Let’s go through what happened. select allows you to easily choose what columns get passed to mutate_fun. In example above, adjusted selects the “adjusted” column from data, and sends it to the mutate function, to.monthly, which mutates the periodicity from daily to monthly. Additional arguments can be passed to the mutate_fun by way of .... We are passing the indexAt argument to return a date that matches the first date in the period.

-
-

Working with non-OHLC data -

-

Returns from FRED, Oanda, and other sources do not have open, high, low, close (OHLC) format. However, this is not a problem with select. The following example shows how to transmute WTI Crude daily prices to monthly prices. Since we only have a single column to pass, we can leave the select argument as NULL which selects all columns by default. This sends the price column to the to.period mutate function.

-
-wti_prices <- tq_get("DCOILWTICO", get = "economic.data") 
-
-wti_prices %>%    
-    tq_transmute(mutate_fun = to.period,
-                 period     = "months", 
-                 col_rename = "WTI Price")
-
## # A tibble: 132 × 2
-##    date       `WTI Price`
-##    <date>           <dbl>
-##  1 2011-01-31        91.0
-##  2 2011-02-28        97.1
-##  3 2011-03-31       106. 
-##  4 2011-04-29       113. 
-##  5 2011-05-31       103. 
-##  6 2011-06-30        95.3
-##  7 2011-07-29        95.7
-##  8 2011-08-31        88.8
-##  9 2011-09-30        78.9
-## 10 2011-10-31        93.2
-## # … with 122 more rows
-
-
-
-

3.2 Mutate Quantitative Data, tq_mutate -

-

Adds a column or set of columns to the tibble with the calculated attributes (hence the original tibble is returned, mutated with the additional columns). An example is getting the MACD from close, which mutates the original input by adding MACD and Signal columns. Note that we can quickly rename the columns using the col_rename argument.

-
-FANG %>%
-    group_by(symbol) %>%
-    tq_mutate(select     = close, 
-              mutate_fun = MACD, 
-              col_rename = c("MACD", "Signal"))
-
## # A tibble: 4,032 × 10
-## # Groups:   symbol [4]
-##    symbol date        open  high   low close    volume adjusted  MACD Signal
-##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl> <dbl>  <dbl>
-##  1 FB     2013-01-02  27.4  28.2  27.4  28    69846400     28      NA     NA
-##  2 FB     2013-01-03  27.9  28.5  27.6  27.8  63140600     27.8    NA     NA
-##  3 FB     2013-01-04  28.0  28.9  27.8  28.8  72715400     28.8    NA     NA
-##  4 FB     2013-01-07  28.7  29.8  28.6  29.4  83781800     29.4    NA     NA
-##  5 FB     2013-01-08  29.5  29.6  28.9  29.1  45871300     29.1    NA     NA
-##  6 FB     2013-01-09  29.7  30.6  29.5  30.6 104787700     30.6    NA     NA
-##  7 FB     2013-01-10  30.6  31.5  30.3  31.3  95316400     31.3    NA     NA
-##  8 FB     2013-01-11  31.3  32.0  31.1  31.7  89598000     31.7    NA     NA
-##  9 FB     2013-01-14  32.1  32.2  30.6  31.0  98892800     31.0    NA     NA
-## 10 FB     2013-01-15  30.6  31.7  29.9  30.1 173242600     30.1    NA     NA
-## # … with 4,022 more rows
-

Note that a mutation can occur if, and only if, the mutation has the same structure of the original tibble. In other words, the calculation must have the same number of rows and row.names (or date fields), otherwise the mutation cannot be performed.

-
-

Mutate rolling regressions with rollapply -

-

A very powerful example is applying custom functions across a rolling window using rollapply. A specific example is using the rollapply function to compute a rolling regression. This example is slightly more complicated so it will be broken down into three steps:

-
    -
  1. Get returns
  2. -
  3. Create a custom function
  4. -
  5. Apply the custom function accross a rolling window using tq_mutate(mutate_fun = rollapply) -
  6. -
-

Step 1: Get Returns

-

First, get combined returns. The asset and baseline returns should be in wide format, which is needed for the lm function in the next step.

-
-fb_returns <- tq_get("FB", get  = "stock.prices", from = "2016-01-01", to   = "2016-12-31") %>%
-    tq_transmute(adjusted, periodReturn, period = "weekly", col_rename = "fb.returns")
-
-xlk_returns <- tq_get("XLK", from = "2016-01-01", to = "2016-12-31") %>%
-    tq_transmute(adjusted, periodReturn, period = "weekly", col_rename = "xlk.returns")
-
-returns_combined <- left_join(fb_returns, xlk_returns, by = "date")
-returns_combined
-
## # A tibble: 52 × 3
-##    date       fb.returns xlk.returns
-##    <date>          <dbl>       <dbl>
-##  1 2016-01-08   -0.0478     -0.0516 
-##  2 2016-01-15   -0.0242     -0.0187 
-##  3 2016-01-22    0.0313      0.0264 
-##  4 2016-01-29    0.146       0.0213 
-##  5 2016-02-05   -0.0725     -0.0422 
-##  6 2016-02-12   -0.0198     -0.00582
-##  7 2016-02-19    0.0251      0.0354 
-##  8 2016-02-26    0.0320      0.0148 
-##  9 2016-03-04    0.00436     0.0281 
-## 10 2016-03-11    0.00941     0.0106 
-## # … with 42 more rows
-

Step 2: Create a custom function

-

Next, create a custom regression function, which will be used to apply over the rolling window in Step 3. An important point is that the “data” will be passed to the regression function as an xts object. The timetk::tk_tbl function takes care of converting to a data frame for the lm function to work properly with the columns “fb.returns” and “xlk.returns”.

-
-regr_fun <- function(data) {
-    coef(lm(fb.returns ~ xlk.returns, data = timetk::tk_tbl(data, silent = TRUE)))
-}
-

Step 3: Apply the custom function

-

Now we can use tq_mutate() to apply the custom regression function over a rolling window using rollapply from the zoo package. Internally, since we left select = NULL, the returns_combined data frame is being passed automatically to the data argument of the rollapply function. All you need to specify is the mutate_fun = rollapply and any additional arguments necessary to apply the rollapply function. We’ll specify a 12 week window via width = 12. The FUN argument is our custom regression function, regr_fun. It’s extremely important to specify by.column = FALSE, which tells rollapply to perform the computation using the data as a whole rather than apply the function to each column independently. The col_rename argument is used to rename the added columns.

-
-returns_combined %>%
-    tq_mutate(mutate_fun = rollapply,
-              width      = 12,
-              FUN        = regr_fun,
-              by.column  = FALSE,
-              col_rename = c("coef.0", "coef.1"))
-
## # A tibble: 52 × 5
-##    date       fb.returns xlk.returns coef.0 coef.1
-##    <date>          <dbl>       <dbl>  <dbl>  <dbl>
-##  1 2016-01-08   -0.0478     -0.0516      NA     NA
-##  2 2016-01-15   -0.0242     -0.0187      NA     NA
-##  3 2016-01-22    0.0313      0.0264      NA     NA
-##  4 2016-01-29    0.146       0.0213      NA     NA
-##  5 2016-02-05   -0.0725     -0.0422      NA     NA
-##  6 2016-02-12   -0.0198     -0.00582     NA     NA
-##  7 2016-02-19    0.0251      0.0354      NA     NA
-##  8 2016-02-26    0.0320      0.0148      NA     NA
-##  9 2016-03-04    0.00436     0.0281      NA     NA
-## 10 2016-03-11    0.00941     0.0106      NA     NA
-## # … with 42 more rows
-
-returns_combined
-
## # A tibble: 52 × 3
-##    date       fb.returns xlk.returns
-##    <date>          <dbl>       <dbl>
-##  1 2016-01-08   -0.0478     -0.0516 
-##  2 2016-01-15   -0.0242     -0.0187 
-##  3 2016-01-22    0.0313      0.0264 
-##  4 2016-01-29    0.146       0.0213 
-##  5 2016-02-05   -0.0725     -0.0422 
-##  6 2016-02-12   -0.0198     -0.00582
-##  7 2016-02-19    0.0251      0.0354 
-##  8 2016-02-26    0.0320      0.0148 
-##  9 2016-03-04    0.00436     0.0281 
-## 10 2016-03-11    0.00941     0.0106 
-## # … with 42 more rows
-

As shown above, the rolling regression coefficients were added to the data frame.

-
-
-
-

3.3 _xy Variants, tq_mutate_xy and tq_transmute_xy -

-

Enables working with mutation functions that require two primary inputs (e.g. EVWMA, VWAP, etc).

-
-

Mutate with two primary inputs -

-

EVWMA (exponential volume-weighted moving average) requires two inputs, price and volume. To work with these columns, we can switch to the xy variants, tq_transmute_xy() and tq_mutate_xy(). The only difference is instead of the select argument, you use x and y arguments to pass the columns needed based on the mutate_fun documentation.

-
-FANG %>%
-    group_by(symbol) %>%
-    tq_mutate_xy(x = close, y = volume, 
-                 mutate_fun = EVWMA, col_rename = "EVWMA")
-
## # A tibble: 4,032 × 9
-## # Groups:   symbol [4]
-##    symbol date        open  high   low close    volume adjusted EVWMA
-##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl> <dbl>
-##  1 FB     2013-01-02  27.4  28.2  27.4  28    69846400     28    NA  
-##  2 FB     2013-01-03  27.9  28.5  27.6  27.8  63140600     27.8  NA  
-##  3 FB     2013-01-04  28.0  28.9  27.8  28.8  72715400     28.8  NA  
-##  4 FB     2013-01-07  28.7  29.8  28.6  29.4  83781800     29.4  NA  
-##  5 FB     2013-01-08  29.5  29.6  28.9  29.1  45871300     29.1  NA  
-##  6 FB     2013-01-09  29.7  30.6  29.5  30.6 104787700     30.6  NA  
-##  7 FB     2013-01-10  30.6  31.5  30.3  31.3  95316400     31.3  NA  
-##  8 FB     2013-01-11  31.3  32.0  31.1  31.7  89598000     31.7  NA  
-##  9 FB     2013-01-14  32.1  32.2  30.6  31.0  98892800     31.0  NA  
-## 10 FB     2013-01-15  30.6  31.7  29.9  30.1 173242600     30.1  30.1
-## # … with 4,022 more rows
-
-
-
-
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.1.

-
- -
-
- - - - - - - - diff --git a/docs/articles/TQ01-core-functions-in-tidyquant_files/figure-html/unnamed-chunk-16-1.png b/docs/articles/TQ01-core-functions-in-tidyquant_files/figure-html/unnamed-chunk-16-1.png deleted file mode 100644 index e86ad886..00000000 Binary files a/docs/articles/TQ01-core-functions-in-tidyquant_files/figure-html/unnamed-chunk-16-1.png and /dev/null differ diff --git a/docs/articles/TQ01-core-functions-in-tidyquant_files/figure-html/unnamed-chunk-17-1.png b/docs/articles/TQ01-core-functions-in-tidyquant_files/figure-html/unnamed-chunk-17-1.png deleted file mode 100644 index c9f81b93..00000000 Binary files a/docs/articles/TQ01-core-functions-in-tidyquant_files/figure-html/unnamed-chunk-17-1.png and /dev/null differ diff --git a/docs/articles/TQ01-core-functions-in-tidyquant_files/header-attrs-2.1/header-attrs.js b/docs/articles/TQ01-core-functions-in-tidyquant_files/header-attrs-2.1/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/TQ01-core-functions-in-tidyquant_files/header-attrs-2.1/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/TQ02-quant-integrations-in-tidyquant.html b/docs/articles/TQ02-quant-integrations-in-tidyquant.html deleted file mode 100644 index 442589d8..00000000 --- a/docs/articles/TQ02-quant-integrations-in-tidyquant.html +++ /dev/null @@ -1,915 +0,0 @@ - - - - - - - -R Quantitative Analysis Package Integrations in tidyquant • tidyquant - - - - - - - - - - - - - -
-
- - - - -
-
- - - - -
-

Functions that leverage the quantitative analysis functionality of xts, zoo, quantmod, TTR, and PerformanceAnalytics

-
-
-

Overview -

-

There’s a wide range of useful quantitative analysis functions that work with time-series objects. The problem is that many of these wonderful functions don’t work with data frames or the tidyverse workflow. That is until now! The tidyquant package integrates the most useful functions from the xts, zoo, quantmod, TTR, and PerformanceAnalytics packages. This vignette focuses on the following core functions to demonstrate how the integratation works with the quantitative finance packages:

-
    -
  • Transmute, tq_transmute(): Returns a new tidy data frame typically in a different periodicity than the input.
  • -
  • Mutate, tq_mutate(): Adds columns to the existing tidy data frame.
  • -
-

Refer to Performance Analysis with tidyquant for a full discussion on performance analysis and portfolio attribution with tidyquant.

-
-
-

Prerequisites -

-

Load the tidyquant package to get started.

-
-# Loads tidyquant, lubridate, xts, quantmod, TTR 
-library(tidyverse)
-library(tidyquant)
-
-
-

1.0 Function Compatibility -

-

tq_transmute_fun_options() returns a list the compatible mutate functions by each package. We’ll discuss these options by package briefly.

- -
## List of 5
-##  $ zoo                 : chr [1:14] "rollapply" "rollapplyr" "rollmax" "rollmax.default" ...
-##  $ xts                 : chr [1:27] "apply.daily" "apply.monthly" "apply.quarterly" "apply.weekly" ...
-##  $ quantmod            : chr [1:25] "allReturns" "annualReturn" "ClCl" "dailyReturn" ...
-##  $ TTR                 : chr [1:64] "adjRatios" "ADX" "ALMA" "aroon" ...
-##  $ PerformanceAnalytics: chr [1:7] "Return.annualized" "Return.annualized.excess" "Return.clean" "Return.cumulative" ...
-
-

zoo Functionality -

-
-# Get zoo functions that work with tq_transmute and tq_mutate
-tq_transmute_fun_options()$zoo
-
##  [1] "rollapply"          "rollapplyr"         "rollmax"           
-##  [4] "rollmax.default"    "rollmaxr"           "rollmean"          
-##  [7] "rollmean.default"   "rollmeanr"          "rollmedian"        
-## [10] "rollmedian.default" "rollmedianr"        "rollsum"           
-## [13] "rollsum.default"    "rollsumr"
-

The zoo functions that are compatible are listed above. Generally speaking, these are the:

-
    -
  • Roll Apply Functions: -
      -
    • A generic function for applying a function to rolling margins.
    • -
    • Form: rollapply(data, width, FUN, ..., by = 1, by.column = TRUE, fill = if (na.pad) NA, na.pad = FALSE, partial = FALSE, align = c("center", "left", "right"), coredata = TRUE).
    • -
    • Options include rollmax, rollmean, rollmedian, rollsum, etc.
    • -
    -
  • -
-
-
-

xts Functionality -

-
-# Get xts functions that work with tq_transmute and tq_mutate
-tq_transmute_fun_options()$xts
-
##  [1] "apply.daily"     "apply.monthly"   "apply.quarterly" "apply.weekly"   
-##  [5] "apply.yearly"    "diff.xts"        "lag.xts"         "period.apply"   
-##  [9] "period.max"      "period.min"      "period.prod"     "period.sum"     
-## [13] "periodicity"     "to_period"       "to.daily"        "to.hourly"      
-## [17] "to.minutes"      "to.minutes10"    "to.minutes15"    "to.minutes3"    
-## [21] "to.minutes30"    "to.minutes5"     "to.monthly"      "to.period"      
-## [25] "to.quarterly"    "to.weekly"       "to.yearly"
-

The xts functions that are compatible are listed above. Generally speaking, these are the:

-
    -
  • Period Apply Functions: -
      -
    • Apply a function to a time segment (e.g. max, min, mean, etc).
    • -
    • Form: apply.daily(x, FUN, ...).
    • -
    • Options include apply.daily, weekly, monthly, quarterly, yearly.
    • -
    -
  • -
  • To-Period Functions: -
      -
    • Convert a time series to time series of lower periodicity (e.g. convert daily to monthly periodicity).
    • -
    • Form: to.period(x, period = 'months', k = 1, indexAt, name = NULL, OHLC = TRUE, ...).
    • -
    • Options include to.minutes, hourly, daily, weekly, monthly, quarterly, yearly.
    • -
    • -Note 1 (Important): The return structure is different for to.period and the to.monthly (to.weekly, to.quarterly, etc) forms. to.period returns a date, while to.months returns a character MON YYYY. Best to use to.period if you want to work with time-series via lubridate.
    • -
    -
  • -
-
-
-

quantmod Functionality -

-
-# Get quantmod functions that work with tq_transmute and tq_mutate
-tq_transmute_fun_options()$quantmod
-
##  [1] "allReturns"      "annualReturn"    "ClCl"            "dailyReturn"    
-##  [5] "Delt"            "HiCl"            "Lag"             "LoCl"           
-##  [9] "LoHi"            "monthlyReturn"   "Next"            "OpCl"           
-## [13] "OpHi"            "OpLo"            "OpOp"            "periodReturn"   
-## [17] "quarterlyReturn" "seriesAccel"     "seriesDecel"     "seriesDecr"     
-## [21] "seriesHi"        "seriesIncr"      "seriesLo"        "weeklyReturn"   
-## [25] "yearlyReturn"
-

The quantmod functions that are compatible are listed above. Generally speaking, these are the:

-
    -
  • Percentage Change (Delt) and Lag Functions -
      -
    • Delt: Delt(x1, x2 = NULL, k = 0, type = c("arithmetic", "log")) -
        -
      • Variations of Delt: ClCl, HiCl, LoCl, LoHi, OpCl, OpHi, OpLo, OpOp
      • -
      • Form: OpCl(OHLC) -
      • -
      -
    • -
    • Lag: Lag(x, k = 1) / Next: Next(x, k = 1) (Can also use dplyr::lag and dplyr::lead)
    • -
    -
  • -
  • Period Return Functions: -
      -
    • Get the arithmetic or logarithmic returns for various periodicity, which include daily, weekly, monthly, quarterly, and yearly.
    • -
    • Form: periodReturn(x, period = 'monthly', subset = NULL, type = 'arithmetic', leading = TRUE, ...) -
    • -
    -
  • -
  • Series Functions: -
      -
    • Return values that describe the series. Options include describing the increases/decreases, acceleration/deceleration, and hi/low.
    • -
    • Forms: seriesHi(x), seriesIncr(x, thresh = 0, diff. = 1L), seriesAccel(x) -
    • -
    -
  • -
-
-
-

TTR Functionality -

-
-# Get TTR functions that work with tq_transmute and tq_mutate
-tq_transmute_fun_options()$TTR
-
##  [1] "adjRatios"          "ADX"                "ALMA"              
-##  [4] "aroon"              "ATR"                "BBands"            
-##  [7] "CCI"                "chaikinAD"          "chaikinVolatility" 
-## [10] "CLV"                "CMF"                "CMO"               
-## [13] "CTI"                "DEMA"               "DonchianChannel"   
-## [16] "DPO"                "DVI"                "EMA"               
-## [19] "EMV"                "EVWMA"              "GMMA"              
-## [22] "growth"             "HMA"                "keltnerChannels"   
-## [25] "KST"                "lags"               "MACD"              
-## [28] "MFI"                "momentum"           "OBV"               
-## [31] "PBands"             "ROC"                "rollSFM"           
-## [34] "RSI"                "runCor"             "runCov"            
-## [37] "runMAD"             "runMax"             "runMean"           
-## [40] "runMedian"          "runMin"             "runPercentRank"    
-## [43] "runSD"              "runSum"             "runVar"            
-## [46] "SAR"                "SMA"                "SMI"               
-## [49] "SNR"                "stoch"              "TDI"               
-## [52] "TRIX"               "ultimateOscillator" "VHF"               
-## [55] "VMA"                "volatility"         "VWAP"              
-## [58] "VWMA"               "wilderSum"          "williamsAD"        
-## [61] "WMA"                "WPR"                "ZigZag"            
-## [64] "ZLEMA"
-

Here’ a brief description of the most popular functions from TTR:

-
    -
  • Welles Wilder’s Directional Movement Index: -
      -
    • ADX(HLC, n = 14, maType, ...)
    • -
    -
  • -
  • Bollinger Bands: -
      -
    • -BBands(HLC, n = 20, maType, sd = 2, ...): Bollinger Bands
    • -
    -
  • -
  • Rate of Change / Momentum: -
      -
    • -ROC(x, n = 1, type = c("continuous", "discrete"), na.pad = TRUE): Rate of Change
    • -
    • -momentum(x, n = 1, na.pad = TRUE): Momentum
    • -
    -
  • -
  • Moving Averages (maType): -
      -
    • -SMA(x, n = 10, ...): Simple Moving Average
    • -
    • -EMA(x, n = 10, wilder = FALSE, ratio = NULL, ...): Exponential Moving Average
    • -
    • -DEMA(x, n = 10, v = 1, wilder = FALSE, ratio = NULL): Double Exponential Moving Average
    • -
    • -WMA(x, n = 10, wts = 1:n, ...): Weighted Moving Average
    • -
    • -EVWMA(price, volume, n = 10, ...): Elastic, Volume-Weighted Moving Average
    • -
    • -ZLEMA(x, n = 10, ratio = NULL, ...): Zero Lag Exponential Moving Average
    • -
    • -VWAP(price, volume, n = 10, ...): Volume-Weighted Moving Average Price
    • -
    • -VMA(x, w, ratio = 1, ...): Variable-Length Moving Average
    • -
    • -HMA(x, n = 20, ...): Hull Moving Average
    • -
    • -ALMA(x, n = 9, offset = 0.85, sigma = 6, ...): Arnaud Legoux Moving Average
    • -
    -
  • -
  • MACD Oscillator: -
      -
    • MACD(x, nFast = 12, nSlow = 26, nSig = 9, maType, percent = TRUE, ...)
    • -
    -
  • -
  • Relative Strength Index: -
      -
    • RSI(price, n = 14, maType, ...)
    • -
    -
  • -
  • runFun: -
      -
    • -runSum(x, n = 10, cumulative = FALSE): returns sums over a n-period moving window.
    • -
    • -runMin(x, n = 10, cumulative = FALSE): returns minimums over a n-period moving window.
    • -
    • -runMax(x, n = 10, cumulative = FALSE): returns maximums over a n-period moving window.
    • -
    • -runMean(x, n = 10, cumulative = FALSE): returns means over a n-period moving window.
    • -
    • -runMedian(x, n = 10, non.unique = "mean", cumulative = FALSE): returns medians over a n-period moving window.
    • -
    • -runCov(x, y, n = 10, use = "all.obs", sample = TRUE, cumulative = FALSE): returns covariances over a n-period moving window.
    • -
    • -runCor(x, y, n = 10, use = "all.obs", sample = TRUE, cumulative = FALSE): returns correlations over a n-period moving window.
    • -
    • -runVar(x, y = NULL, n = 10, sample = TRUE, cumulative = FALSE): returns variances over a n-period moving window.
    • -
    • -runSD(x, n = 10, sample = TRUE, cumulative = FALSE): returns standard deviations over a n-period moving window.
    • -
    • -runMAD(x, n = 10, center = NULL, stat = "median", constant = 1.4826, non.unique = "mean", cumulative = FALSE): returns median/mean absolute deviations over a n-period moving window.
    • -
    • -wilderSum(x, n = 10): retuns a Welles Wilder style weighted sum over a n-period moving window.
    • -
    -
  • -
  • Stochastic Oscillator / Stochastic Momentum Index: -
      -
    • -stoch(HLC, nFastK = 14, nFastD = 3, nSlowD = 3, maType, bounded = TRUE, smooth = 1, ...): Stochastic Oscillator
    • -
    • -SMI(HLC, n = 13, nFast = 2, nSlow = 25, nSig = 9, maType, bounded = TRUE, ...): Stochastic Momentum Index
    • -
    -
  • -
-
-
-

PerformanceAnalytics Functionality -

-
-# Get PerformanceAnalytics functions that work with tq_transmute and tq_mutate
-tq_transmute_fun_options()$PerformanceAnalytics
-
## [1] "Return.annualized"        "Return.annualized.excess"
-## [3] "Return.clean"             "Return.cumulative"       
-## [5] "Return.excess"            "Return.Geltner"          
-## [7] "zerofill"
-

The PerformanceAnalytics mutation functions all deal with returns:

-
    -
  • -Return.annualized and Return.annualized.excess: Takes period returns and consolidates into annualized returns
  • -
  • -Return.clean: Removes outliers from returns
  • -
  • -Return.excess: Removes the risk-free rate from the returns to yield returns in excess of the risk-free rate
  • -
  • -zerofill: Used to replace NA values with zeros.
  • -
-
-
-
-

2.0 Quantitative Power In Action -

-

We’ll go through some examples, but first let’s get some data. The FANG data set will be used which consists of stock prices for FB, AMZN, NFLX, and GOOG from the beginning of 2013 to the end of 2016.

-
-data("FANG")
-
-FANG
-
## # A tibble: 4,032 × 8
-##    symbol date        open  high   low close    volume adjusted
-##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl>
-##  1 FB     2013-01-02  27.4  28.2  27.4  28    69846400     28  
-##  2 FB     2013-01-03  27.9  28.5  27.6  27.8  63140600     27.8
-##  3 FB     2013-01-04  28.0  28.9  27.8  28.8  72715400     28.8
-##  4 FB     2013-01-07  28.7  29.8  28.6  29.4  83781800     29.4
-##  5 FB     2013-01-08  29.5  29.6  28.9  29.1  45871300     29.1
-##  6 FB     2013-01-09  29.7  30.6  29.5  30.6 104787700     30.6
-##  7 FB     2013-01-10  30.6  31.5  30.3  31.3  95316400     31.3
-##  8 FB     2013-01-11  31.3  32.0  31.1  31.7  89598000     31.7
-##  9 FB     2013-01-14  32.1  32.2  30.6  31.0  98892800     31.0
-## 10 FB     2013-01-15  30.6  31.7  29.9  30.1 173242600     30.1
-## # … with 4,022 more rows
-
-

Example 1: Use quantmod periodReturn to Convert Prices to Returns -

-

The quantmod::periodReturn() function generates returns by periodicity. We’ll go through a couple usage cases.

-
-

Example 1A: Getting and Charting Annual Returns -

-

We want to use the adjusted closing prices column (adjusted for stock splits, which can make it appear that a stock is performing poorly if a split is included). We set select = adjusted. We research the periodReturn function, and we found that it accepts type = "arithmetic" and period = "yearly", which returns the annual returns.

-
-FANG_annual_returns <- FANG %>%
-    group_by(symbol) %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = periodReturn, 
-                 period     = "yearly", 
-                 type       = "arithmetic")
-FANG_annual_returns
-
## # A tibble: 16 × 3
-## # Groups:   symbol [4]
-##    symbol date       yearly.returns
-##    <chr>  <date>              <dbl>
-##  1 FB     2013-12-31         0.952 
-##  2 FB     2014-12-31         0.428 
-##  3 FB     2015-12-31         0.341 
-##  4 FB     2016-12-30         0.0993
-##  5 AMZN   2013-12-31         0.550 
-##  6 AMZN   2014-12-31        -0.222 
-##  7 AMZN   2015-12-31         1.18  
-##  8 AMZN   2016-12-30         0.109 
-##  9 NFLX   2013-12-31         3.00  
-## 10 NFLX   2014-12-31        -0.0721
-## 11 NFLX   2015-12-31         1.34  
-## 12 NFLX   2016-12-30         0.0824
-## 13 GOOG   2013-12-31         0.550 
-## 14 GOOG   2014-12-31        -0.0597
-## 15 GOOG   2015-12-31         0.442 
-## 16 GOOG   2016-12-30         0.0171
-

Charting annual returns is just a quick use of the ggplot2 package.

-
-FANG_annual_returns %>%
-    ggplot(aes(x = date, y = yearly.returns, fill = symbol)) +
-    geom_col() +
-    geom_hline(yintercept = 0, color = palette_light()[[1]]) +
-    scale_y_continuous(labels = scales::percent) +
-    labs(title = "FANG: Annual Returns",
-         subtitle = "Get annual returns quickly with tq_transmute!",
-         y = "Annual Returns", x = "") + 
-    facet_wrap(~ symbol, ncol = 2, scales = "free_y") +
-    theme_tq() + 
-    scale_fill_tq()
-

-
-
-

Example 1B: Getting Daily Log Returns -

-

Daily log returns follows a similar approach. Normally I go with a transmute function, tq_transmute, because the periodReturn function accepts different periodicity options, and anything other than daily will blow up a mutation. But, in our situation the period returns periodicity is the same as the stock prices periodicity (both daily), so we can use either. We want to use the adjusted closing prices column (adjusted for stock splits, which can make it appear that a stock is performing poorly if a split is included), so we set select = adjusted. We researched the periodReturn function, and we found that it accepts type = "log" and period = "daily", which returns the daily log returns.

-
-FANG_daily_log_returns <- FANG %>%
-    group_by(symbol) %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = periodReturn, 
-                 period     = "daily", 
-                 type       = "log",
-                 col_rename = "monthly.returns")
-
-FANG_daily_log_returns %>%
-    ggplot(aes(x = monthly.returns, fill = symbol)) +
-    geom_density(alpha = 0.5) +
-    labs(title = "FANG: Charting the Daily Log Returns",
-         x = "Monthly Returns", y = "Density") +
-    theme_tq() +
-    scale_fill_tq() + 
-    facet_wrap(~ symbol, ncol = 2)
-

-
-
-
-

Example 2: Use xts to.period to Change the Periodicity from Daily to Monthly -

-

The xts::to.period function is used for periodicity aggregation (converting from a lower level periodicity to a higher level such as minutes to hours or months to years). Because we are seeking a return structure that is on a different time scale than the input (daily versus weekly), we need to use a transmute function. We select tq_transmute() and pass the open, high, low, close and volume columns via select = open:volume. Looking at the documentation for to.period, we see that it accepts a period argument that we can set to "weeks". The result is the OHLCV data returned with the dates changed to one day per week.

-
-FANG %>%
-    group_by(symbol) %>%
-    tq_transmute(select     = open:volume, 
-                 mutate_fun = to.period, 
-                 period     = "months")
-
## # A tibble: 192 × 7
-## # Groups:   symbol [4]
-##    symbol date        open  high   low close    volume
-##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>
-##  1 FB     2013-01-31  29.2  31.5  28.7  31.0 190744900
-##  2 FB     2013-02-28  26.8  27.3  26.3  27.2  83027800
-##  3 FB     2013-03-28  26.1  26.2  25.5  25.6  28585700
-##  4 FB     2013-04-30  27.1  27.8  27.0  27.8  36245700
-##  5 FB     2013-05-31  24.6  25.0  24.3  24.4  35925000
-##  6 FB     2013-06-28  24.7  25.0  24.4  24.9  96778900
-##  7 FB     2013-07-31  38.0  38.3  36.3  36.8 154828700
-##  8 FB     2013-08-30  42.0  42.3  41.1  41.3  67735100
-##  9 FB     2013-09-30  50.1  51.6  49.8  50.2 100095000
-## 10 FB     2013-10-31  47.2  52    46.5  50.2 248809000
-## # … with 182 more rows
-

A common usage case is to reduce the number of points to smooth time series plots. Let’s check out difference between daily and monthly plots.

-
-

Without Periodicity Aggregation -

-
-FANG_daily <- FANG %>%
-    group_by(symbol)
-
-FANG_daily %>%
-    ggplot(aes(x = date, y = adjusted, color = symbol)) +
-    geom_line(size = 1) +
-    labs(title = "Daily Stock Prices",
-         x = "", y = "Adjusted Prices", color = "") +
-    facet_wrap(~ symbol, ncol = 2, scales = "free_y") +
-    scale_y_continuous(labels = scales::dollar) +
-    theme_tq() + 
-    scale_color_tq()
-

-
-
-

With Monthly Periodicity Aggregation -

-
-FANG_monthly <- FANG %>%
-    group_by(symbol) %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = to.period, 
-                 period     = "months")
-
-FANG_monthly %>%
-    ggplot(aes(x = date, y = adjusted, color = symbol)) +
-    geom_line(size = 1) +
-    labs(title = "Monthly Stock Prices",
-         x = "", y = "Adjusted Prices", color = "") +
-    facet_wrap(~ symbol, ncol = 2, scales = "free_y") +
-    scale_y_continuous(labels = scales::dollar) +
-    theme_tq() + 
-    scale_color_tq()
-

-
-
-
-

Example 3: Use TTR runCor to Visualize Rolling Correlations of Returns -

-

Return correlations are a common way to analyze how closely an asset or portfolio mimics a baseline index or fund. We will need a set of returns for both the stocks and baseline. The stock will be the FANG data set and the baseline will be the Spdr XLK technology sector. We have the prices for the “FANG” stocks, so we use tq_get to retrieve the “XLK” prices. The returns can be calculated from the “adjusted” prices using the process in Example 1.

-
-# Asset Returns
-FANG_returns_monthly <- FANG %>%
-    group_by(symbol) %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = periodReturn,
-                 period     = "monthly")
-
-# Baseline Returns
-baseline_returns_monthly <- "XLK" %>%
-    tq_get(get  = "stock.prices",
-           from = "2013-01-01", 
-           to   = "2016-12-31") %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = periodReturn,
-                 period     = "monthly")
-

Next, join the asset returns with the baseline returns by date.

-
-returns_joined <- left_join(FANG_returns_monthly, 
-                            baseline_returns_monthly,
-                            by = "date")
-returns_joined
-
## # A tibble: 192 × 4
-## # Groups:   symbol [4]
-##    symbol date       monthly.returns.x monthly.returns.y
-##    <chr>  <date>                 <dbl>             <dbl>
-##  1 FB     2013-01-31          0.106             -0.0138 
-##  2 FB     2013-02-28         -0.120              0.00782
-##  3 FB     2013-03-28         -0.0613             0.0258 
-##  4 FB     2013-04-30          0.0856             0.0175 
-##  5 FB     2013-05-31         -0.123              0.0279 
-##  6 FB     2013-06-28          0.0218            -0.0289 
-##  7 FB     2013-07-31          0.479              0.0373 
-##  8 FB     2013-08-30          0.122             -0.0104 
-##  9 FB     2013-09-30          0.217              0.0253 
-## 10 FB     2013-10-31         -0.000398           0.0502 
-## # … with 182 more rows
-

The TTR::runCor function can be used to evaluate rolling correlations using the xy pattern. Looking at the documentation (?runCor), we can see that the arguments include x and y along with a few additional arguments including n for the width of the rolling correlation. Because the scale is monthly, we’ll go with n = 6 for a 6-month rolling correlation. The col_rename argument enables easy renaming of the output column(s).

-
-FANG_rolling_corr <- returns_joined %>%
-    tq_transmute_xy(x          = monthly.returns.x, 
-                    y          = monthly.returns.y,
-                    mutate_fun = runCor,
-                    n          = 6,
-                    col_rename = "rolling.corr.6")
-

And, we can plot the rolling correlations for the FANG stocks.

-
-FANG_rolling_corr %>%
-    ggplot(aes(x = date, y = rolling.corr.6, color = symbol)) +
-    geom_hline(yintercept = 0, color = palette_light()[[1]]) +
-    geom_line(size = 1) +
-    labs(title = "FANG: Six Month Rolling Correlation to XLK",
-         x = "", y = "Correlation", color = "") +
-    facet_wrap(~ symbol, ncol = 2) +
-    theme_tq() + 
-    scale_color_tq()
-

-
-
-

Example 4: Use TTR MACD to Visualize Moving Average Convergence Divergence -

-

In reviewing the available options in the TTR package, we see that MACD will get us the Moving Average Convergence Divergence (MACD). In researching the documentation, the return is in the same periodicity as the input and the functions work with OHLC functions, so we can use tq_mutate(). MACD requires a price, so we select close.

-
-FANG_macd <- FANG %>%
-    group_by(symbol) %>%
-    tq_mutate(select     = close, 
-              mutate_fun = MACD, 
-              nFast      = 12, 
-              nSlow      = 26, 
-              nSig       = 9, 
-              maType     = SMA) %>%
-    mutate(diff = macd - signal) %>%
-    select(-(open:volume))
-FANG_macd
-
## # A tibble: 4,032 × 6
-## # Groups:   symbol [4]
-##    symbol date       adjusted  macd signal  diff
-##    <chr>  <date>        <dbl> <dbl>  <dbl> <dbl>
-##  1 FB     2013-01-02     28      NA     NA    NA
-##  2 FB     2013-01-03     27.8    NA     NA    NA
-##  3 FB     2013-01-04     28.8    NA     NA    NA
-##  4 FB     2013-01-07     29.4    NA     NA    NA
-##  5 FB     2013-01-08     29.1    NA     NA    NA
-##  6 FB     2013-01-09     30.6    NA     NA    NA
-##  7 FB     2013-01-10     31.3    NA     NA    NA
-##  8 FB     2013-01-11     31.7    NA     NA    NA
-##  9 FB     2013-01-14     31.0    NA     NA    NA
-## 10 FB     2013-01-15     30.1    NA     NA    NA
-## # … with 4,022 more rows
-

And, we can visualize the data like so.

-
-FANG_macd %>%
-    filter(date >= as_date("2016-10-01")) %>%
-    ggplot(aes(x = date)) + 
-    geom_hline(yintercept = 0, color = palette_light()[[1]]) +
-    geom_line(aes(y = macd, col = symbol)) +
-    geom_line(aes(y = signal), color = "blue", linetype = 2) +
-    geom_bar(aes(y = diff), stat = "identity", color = palette_light()[[1]]) +
-    facet_wrap(~ symbol, ncol = 2, scale = "free_y") +
-    labs(title = "FANG: Moving Average Convergence Divergence",
-         y = "MACD", x = "", color = "") +
-    theme_tq() +
-    scale_color_tq()
-

-
-
-

Example 5: Use xts apply.quarterly to Get the Max and Min Price for Each Quarter -

-

The xts::apply.quarterly() function that is part of the period apply group can be used to apply functions by quarterly time segments. Because we are seeking a return structure that is on a different time scale than the input (quarterly versus daily), we need to use a transmute function. We select tq_transmute and pass the close price using select, and we send this subset of the data to the apply.quarterly function via the mutate_fun argument. Looking at the documentation for apply.quarterly, we see that we can pass a function to the argument, FUN. We want the maximum values, so we set FUN = max. The result is the quarters returned as a date and the maximum closing price during the quarter returned as a double.

-
-FANG_max_by_qtr <- FANG %>%
-    group_by(symbol) %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = apply.quarterly, 
-                 FUN        = max, 
-                 col_rename = "max.close") %>%
-    mutate(year.qtr = paste0(year(date), "-Q", quarter(date))) %>%
-    select(-date)
-FANG_max_by_qtr
-
## # A tibble: 64 × 3
-## # Groups:   symbol [4]
-##    symbol max.close year.qtr
-##    <chr>      <dbl> <chr>   
-##  1 FB          32.5 2013-Q1 
-##  2 FB          29.0 2013-Q2 
-##  3 FB          51.2 2013-Q3 
-##  4 FB          58.0 2013-Q4 
-##  5 FB          72.0 2014-Q1 
-##  6 FB          67.6 2014-Q2 
-##  7 FB          79.0 2014-Q3 
-##  8 FB          81.4 2014-Q4 
-##  9 FB          85.3 2015-Q1 
-## 10 FB          88.9 2015-Q2 
-## # … with 54 more rows
-

The minimum each quarter can be retrieved in much the same way. The data frames can be joined using left_join to get the max and min by quarter.

-
-FANG_min_by_qtr <- FANG %>%
-    group_by(symbol) %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = apply.quarterly, 
-                 FUN        = min, 
-                 col_rename = "min.close") %>%
-    mutate(year.qtr = paste0(year(date), "-Q", quarter(date))) %>%
-    select(-date)
-
-FANG_by_qtr <- left_join(FANG_max_by_qtr, FANG_min_by_qtr,
-                         by = c("symbol"   = "symbol",
-                                "year.qtr" = "year.qtr"))
-FANG_by_qtr
-
## # A tibble: 64 × 4
-## # Groups:   symbol [4]
-##    symbol max.close year.qtr min.close
-##    <chr>      <dbl> <chr>        <dbl>
-##  1 FB          32.5 2013-Q1       25.1
-##  2 FB          29.0 2013-Q2       22.9
-##  3 FB          51.2 2013-Q3       24.4
-##  4 FB          58.0 2013-Q4       44.8
-##  5 FB          72.0 2014-Q1       53.5
-##  6 FB          67.6 2014-Q2       56.1
-##  7 FB          79.0 2014-Q3       62.8
-##  8 FB          81.4 2014-Q4       72.6
-##  9 FB          85.3 2015-Q1       74.1
-## 10 FB          88.9 2015-Q2       77.5
-## # … with 54 more rows
-

And, we can visualize the data like so.

-
-FANG_by_qtr %>%
-    ggplot(aes(x = year.qtr, color = symbol)) +
-    geom_segment(aes(xend = year.qtr, y = min.close, yend = max.close),
-                 size = 1) +
-    geom_point(aes(y = max.close), size = 2) +
-    geom_point(aes(y = min.close), size = 2) +
-    facet_wrap(~ symbol, ncol = 2, scale = "free_y") +
-    labs(title = "FANG: Min/Max Price By Quarter",
-         y = "Stock Price", color = "") +
-    theme_tq() +
-    scale_color_tq() +
-    scale_y_continuous(labels = scales::dollar) +
-    theme(axis.text.x = element_text(angle = 90, hjust = 1),
-          axis.title.x = element_blank())
-

-
-
-

Example 6: Use zoo rollapply to visualize a rolling regression -

-

A good way to analyze relationships over time is using rolling calculations that compare two assets. Pairs trading is a common mechanism for similar assets. While we will not go into a pairs trade analysis, we will analyze the relationship between two similar assets as a precursor to a pairs trade. In this example we will analyze two similar assets, Mastercard (MA) and Visa (V) to show the relationship via regression.

-

Before we analyze a rolling regression, it’s helpful to view the overall trend in returns. To do this, we use tq_get() to get stock prices for the assets and tq_transmute() to transform the daily prices to daily returns. We’ll collect the data and visualize via a scatter plot.

-
-# Get stock pairs
-stock_prices <- c("MA", "V") %>%
-    tq_get(get  = "stock.prices",
-           from = "2015-01-01",
-           to   = "2016-12-31") %>%
-    group_by(symbol) 
-
-stock_pairs <- stock_prices %>%
-    tq_transmute(select     = adjusted,
-                 mutate_fun = periodReturn,
-                 period     = "daily",
-                 type       = "log",
-                 col_rename = "returns") %>%
-    spread(key = symbol, value = returns)
-

We can visualize the relationship between the returns of the stock pairs like so.

-
-stock_pairs %>%
-    ggplot(aes(x = V, y = MA)) +
-    geom_point(color = palette_light()[[1]], alpha = 0.5) +
-    geom_smooth(method = "lm") +
-    labs(title = "Visualizing Returns Relationship of Stock Pairs") +
-    theme_tq()
-

-

We can get statistcs on the relationship from the lm function. The model is highly correlated with a p-value of essential zero. The coefficient estimate for V (Coefficient 1) is 0.8134 indicating a positive relationship, meaning as V increases MA also tends to increase.

-
-lm(MA ~ V, data = stock_pairs) %>%
-    summary()
-
## 
-## Call:
-## lm(formula = MA ~ V, data = stock_pairs)
-## 
-## Residuals:
-##       Min        1Q    Median        3Q       Max 
-## -0.026957 -0.003966  0.000215  0.003965  0.028946 
-## 
-## Coefficients:
-##              Estimate Std. Error t value Pr(>|t|)    
-## (Intercept) 0.0001130  0.0003097   0.365    0.715    
-## V           0.8133667  0.0226394  35.927   <2e-16 ***
-## ---
-## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
-## 
-## Residual standard error: 0.00695 on 502 degrees of freedom
-## Multiple R-squared:   0.72,  Adjusted R-squared:  0.7194 
-## F-statistic:  1291 on 1 and 502 DF,  p-value: < 2.2e-16
-

While this characterizes the overall relationship, it’s missing the time aspect. Fortunately, we can use the rollapply function from the zoo package to plot a rolling regression, showing how the model coefficent varies on a rolling basis over time. We calculate rolling regressions with tq_mutate() in two additional steps:

-
    -
  1. Create a custom function
  2. -
  3. Apply the function with tq_mutate(mutate_fun = rollapply) -
  4. -
-

First, create a custom regression function. An important point is that the “data” will be passed to the regression function as an xts object. The timetk::tk_tbl function takes care of converting to a data frame.

-
-regr_fun <- function(data) {
-    coef(lm(MA ~ V, data = timetk::tk_tbl(data, silent = TRUE)))
-}
-

Now we can use tq_mutate() to apply the custom regression function over a rolling window using rollapply from the zoo package. Internally, the returns_combined data frame is being passed automatically to the data argument of the rollapply function. All you need to specify is the mutate_fun = rollapply and any additional arguments necessary to apply the rollapply function. We’ll specify a 90 day window via width = 90. The FUN argument is our custom regression function, regr_fun. It’s extremely important to specify by.column = FALSE, which tells rollapply to perform the computation using the data as a whole rather than apply the function to each column independently. The col_rename argument is used to rename the added columns.

-
-stock_pairs <- stock_pairs %>%
-         tq_mutate(mutate_fun = rollapply,
-                   width      = 90,
-                   FUN        = regr_fun,
-                   by.column  = FALSE,
-                   col_rename = c("coef.0", "coef.1"))
-stock_pairs
-
## # A tibble: 504 × 5
-##    date             MA        V coef.0 coef.1
-##    <date>        <dbl>    <dbl>  <dbl>  <dbl>
-##  1 2015-01-02  0        0           NA     NA
-##  2 2015-01-05 -0.0285  -0.0223      NA     NA
-##  3 2015-01-06 -0.00216 -0.00646     NA     NA
-##  4 2015-01-07  0.0154   0.0133      NA     NA
-##  5 2015-01-08  0.0154   0.0133      NA     NA
-##  6 2015-01-09 -0.0128  -0.0149      NA     NA
-##  7 2015-01-12 -0.0129  -0.00196     NA     NA
-##  8 2015-01-13  0.00228  0.00292     NA     NA
-##  9 2015-01-14 -0.00108 -0.0202      NA     NA
-## 10 2015-01-15 -0.0146  -0.00955     NA     NA
-## # … with 494 more rows
-

Finally, we can visualize the first coefficient like so. A horizontal line is added using the full data set model. This gives us insight as to points in time where the relationship deviates significantly from the long run trend which can be explored for potential pair trade opportunities.

-
-stock_pairs %>%
-    ggplot(aes(x = date, y = coef.1)) +
-    geom_line(size = 1, color = palette_light()[[1]]) +
-    geom_hline(yintercept = 0.8134, size = 1, color = palette_light()[[2]]) +
-    labs(title = "MA ~ V: Visualizing Rolling Regression Coefficient", x = "") +
-    theme_tq()
-

-

Stock returns during this time period.

-
-stock_prices %>%
-    tq_transmute(adjusted, 
-                 periodReturn, 
-                 period = "daily", 
-                 type = "log", 
-                 col_rename = "returns") %>%
-    mutate(wealth.index = 100 * cumprod(1 + returns)) %>%
-    ggplot(aes(x = date, y = wealth.index, color = symbol)) +
-    geom_line(size = 1) +
-    labs(title = "MA and V: Stock Prices") +
-    theme_tq() + 
-    scale_color_tq()
-

-
-
-

Example 7: Use Return.clean and Return.excess to clean and calculate excess returns -

-

In this example we use several of the PerformanceAnalytics functions to clean and format returns. The example uses three progressive applications of tq_transmute to apply various quant functions to the grouped stock prices from the FANG data set. First, we calculate daily returns using quantmod::periodReturn. Next, we use Return.clean to clean outliers from the return data. The alpha parameter is the percentage of oultiers to be cleaned. Finally, the excess returns are calculated using a risk-free rate of 3% (divided by 252 for 252 trade days in one year).

-
-FANG %>%
-    group_by(symbol) %>%
-    tq_transmute(adjusted, periodReturn, period = "daily") %>%
-    tq_transmute(daily.returns, Return.clean, alpha = 0.05) %>%
-    tq_transmute(daily.returns, Return.excess, Rf = 0.03 / 252)
-
## # A tibble: 4,032 × 3
-## # Groups:   symbol [4]
-##    symbol date       `daily.returns > Rf`
-##    <chr>  <date>                    <dbl>
-##  1 FB     2013-01-02            -0.000119
-##  2 FB     2013-01-03            -0.00833 
-##  3 FB     2013-01-04             0.0355  
-##  4 FB     2013-01-07             0.0228  
-##  5 FB     2013-01-08            -0.0124  
-##  6 FB     2013-01-09             0.0525  
-##  7 FB     2013-01-10             0.0231  
-##  8 FB     2013-01-11             0.0133  
-##  9 FB     2013-01-14            -0.0244  
-## 10 FB     2013-01-15            -0.0276  
-## # … with 4,022 more rows
-
-
-
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.1.

-
- -
-
- - - - - - - - diff --git a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-11-1.png b/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-11-1.png deleted file mode 100644 index 492f5d09..00000000 Binary files a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-11-1.png and /dev/null differ diff --git a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-13-1.png b/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-13-1.png deleted file mode 100644 index 03411711..00000000 Binary files a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-13-1.png and /dev/null differ diff --git a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-15-1.png b/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-15-1.png deleted file mode 100644 index 91ac5e1b..00000000 Binary files a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-15-1.png and /dev/null differ diff --git a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-16-1.png b/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-16-1.png deleted file mode 100644 index 811153cf..00000000 Binary files a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-16-1.png and /dev/null differ diff --git a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-20-1.png b/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-20-1.png deleted file mode 100644 index 58af9399..00000000 Binary files a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-20-1.png and /dev/null differ diff --git a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-22-1.png b/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-22-1.png deleted file mode 100644 index bf13b30f..00000000 Binary files a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-22-1.png and /dev/null differ diff --git a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-25-1.png b/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-25-1.png deleted file mode 100644 index 74b4e4f5..00000000 Binary files a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-25-1.png and /dev/null differ diff --git a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-27-1.png b/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-27-1.png deleted file mode 100644 index 5fe8e1b6..00000000 Binary files a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-27-1.png and /dev/null differ diff --git a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-31-1.png b/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-31-1.png deleted file mode 100644 index db9f9859..00000000 Binary files a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-31-1.png and /dev/null differ diff --git a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-32-1.png b/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-32-1.png deleted file mode 100644 index f9548550..00000000 Binary files a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/figure-html/unnamed-chunk-32-1.png and /dev/null differ diff --git a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/header-attrs-2.1/header-attrs.js b/docs/articles/TQ02-quant-integrations-in-tidyquant_files/header-attrs-2.1/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/TQ02-quant-integrations-in-tidyquant_files/header-attrs-2.1/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/TQ03-scaling-and-modeling-with-tidyquant.html b/docs/articles/TQ03-scaling-and-modeling-with-tidyquant.html deleted file mode 100644 index bca86316..00000000 --- a/docs/articles/TQ03-scaling-and-modeling-with-tidyquant.html +++ /dev/null @@ -1,575 +0,0 @@ - - - - - - - -Scaling and Modeling with tidyquant • tidyquant - - - - - - - - - - - - - -
-
- - - - -
-
- - - - -
-

Designed for the data science workflow of the tidyverse

-
-
-

Overview -

-

The greatest benefit to tidyquant is the ability to apply the data science workflow to easily model and scale your financial analysis as described in R for Data Science. Scaling is the process of creating an analysis for one asset and then extending it to multiple groups. This idea of scaling is incredibly useful to financial analysts because typically one wants to compare many assets to make informed decisions. Fortunately, the tidyquant package integrates with the tidyverse making scaling super simple!

-

All tidyquant functions return data in the tibble (tidy data frame) format, which allows for interaction within the tidyverse. This means we can:

-
    -
  • Seamlessly scale data retrieval and mutations
  • -
  • Use the pipe (%>%) for chaining operations
  • -
  • Use dplyr and tidyr: select, filter, group_by, nest/unnest, spread/gather, etc
  • -
  • Use purrr: mapping functions with map -
  • -
  • Model financial analysis using the data science workflow in R for Data Science -
  • -
-

We’ll go through some useful techniques for getting and manipulating groups of data.

-
-
-

Prerequisites -

-

Load the tidyquant package to get started.

-
-# Loads tidyquant, lubridate, xts, quantmod, TTR, and PerformanceAnalytics
-library(tidyverse)
-library(tidyquant)  
-
-
-

1.0 Scaling the Getting of Financial Data -

-

A very basic example is retrieving the stock prices for multiple stocks. There are three primary ways to do this:

-
-

Method 1: Map a character vector with multiple stock symbols -

-
-c("AAPL", "GOOG", "FB") %>%
-    tq_get(get = "stock.prices", from = "2016-01-01", to = "2017-01-01")
-
## # A tibble: 756 × 8
-##    symbol date        open  high   low close    volume adjusted
-##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl>
-##  1 AAPL   2016-01-04  25.7  26.3  25.5  26.3 270597600     24.3
-##  2 AAPL   2016-01-05  26.4  26.5  25.6  25.7 223164000     23.6
-##  3 AAPL   2016-01-06  25.1  25.6  25.0  25.2 273829600     23.2
-##  4 AAPL   2016-01-07  24.7  25.0  24.1  24.1 324377600     22.2
-##  5 AAPL   2016-01-08  24.6  24.8  24.2  24.2 283192000     22.3
-##  6 AAPL   2016-01-11  24.7  24.8  24.3  24.6 198957600     22.7
-##  7 AAPL   2016-01-12  25.1  25.2  24.7  25.0 196616800     23.0
-##  8 AAPL   2016-01-13  25.1  25.3  24.3  24.3 249758400     22.4
-##  9 AAPL   2016-01-14  24.5  25.1  23.9  24.9 252680400     22.9
-## 10 AAPL   2016-01-15  24.0  24.4  23.8  24.3 319335600     22.4
-## # … with 746 more rows
-

The output is a single level tibble with all or the stock prices in one tibble. The auto-generated column name is “symbol”, which can be pre-emptively renamed by giving the vector a name (e.g. stocks <- c("AAPL", "GOOG", "FB")) and then piping to tq_get.

-
-
-

Method 2: Map a tibble with stocks in first column -

-

First, get a stock list in data frame format either by making the tibble or retrieving from tq_index / tq_exchange. The stock symbols must be in the first column.

-
-

Method 2A: Make a tibble -

-
-stock_list <- tibble(stocks = c("AAPL", "JPM", "CVX"),
-                     industry = c("Technology", "Financial", "Energy"))
-stock_list
-
## # A tibble: 3 × 2
-##   stocks industry  
-##   <chr>  <chr>     
-## 1 AAPL   Technology
-## 2 JPM    Financial 
-## 3 CVX    Energy
-

Second, send the stock list to tq_get. Notice how the symbol and industry columns are automatically expanded the length of the stock prices.

-
-stock_list %>%
-    tq_get(get = "stock.prices", from = "2016-01-01", to = "2017-01-01")
-
## # A tibble: 756 × 9
-##    stocks industry   date        open  high   low close    volume adjusted
-##    <chr>  <chr>      <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl>
-##  1 AAPL   Technology 2016-01-04  25.7  26.3  25.5  26.3 270597600     24.3
-##  2 AAPL   Technology 2016-01-05  26.4  26.5  25.6  25.7 223164000     23.6
-##  3 AAPL   Technology 2016-01-06  25.1  25.6  25.0  25.2 273829600     23.2
-##  4 AAPL   Technology 2016-01-07  24.7  25.0  24.1  24.1 324377600     22.2
-##  5 AAPL   Technology 2016-01-08  24.6  24.8  24.2  24.2 283192000     22.3
-##  6 AAPL   Technology 2016-01-11  24.7  24.8  24.3  24.6 198957600     22.7
-##  7 AAPL   Technology 2016-01-12  25.1  25.2  24.7  25.0 196616800     23.0
-##  8 AAPL   Technology 2016-01-13  25.1  25.3  24.3  24.3 249758400     22.4
-##  9 AAPL   Technology 2016-01-14  24.5  25.1  23.9  24.9 252680400     22.9
-## 10 AAPL   Technology 2016-01-15  24.0  24.4  23.8  24.3 319335600     22.4
-## # … with 746 more rows
-
-
-

Method 2B: Use index or exchange -

-

Get an index…

-
-tq_index("DOW")
-
## # A tibble: 31 × 8
-##    symbol company    identifier sedol  weight sector  shares_held local_currency
-##    <chr>  <chr>      <chr>      <chr>   <dbl> <chr>         <dbl> <chr>         
-##  1 UNH    UnitedHea… 91324P10   29177… 0.0913 Health…     5482197 USD           
-##  2 HD     Home Depo… 43707610   24342… 0.0742 Consum…     5482197 USD           
-##  3 GS     Goldman S… 38141G10   24079… 0.0698 Financ…     5482197 USD           
-##  4 MSFT   Microsoft… 59491810   25881… 0.0618 Inform…     5482197 USD           
-##  5 MCD    McDonald'… 58013510   25507… 0.0485 Consum…     5482197 USD           
-##  6 CRM    salesforc… 79466L30   23105… 0.0460 Inform…     5482197 USD           
-##  7 AMGN   Amgen Inc. 03116210   20236… 0.0411 Health…     5482197 USD           
-##  8 V      Visa Inc.… 92826C83   B2PZN… 0.0394 Inform…     5482197 USD           
-##  9 HON    Honeywell… 43851610   20204… 0.0375 Indust…     5482197 USD           
-## 10 CAT    Caterpill… 14912310   21802… 0.0374 Indust…     5482197 USD           
-## # … with 21 more rows
-

…or, get an exchange.

-
-tq_exchange("NYSE")
-

Send the index or exchange to tq_get. Important Note: This can take several minutes depending on the size of the index or exchange, which is why only the first three stocks are evaluated in the vignette.

-
-tq_index("DOW") %>%
-    slice(1:3) %>%
-    tq_get(get = "stock.prices")
-
## # A tibble: 8,301 × 15
-##    symbol company     identifier sedol  weight sector shares_held local_currency
-##    <chr>  <chr>       <chr>      <chr>   <dbl> <chr>        <dbl> <chr>         
-##  1 UNH    UnitedHeal… 91324P10   29177… 0.0913 Healt…     5482197 USD           
-##  2 UNH    UnitedHeal… 91324P10   29177… 0.0913 Healt…     5482197 USD           
-##  3 UNH    UnitedHeal… 91324P10   29177… 0.0913 Healt…     5482197 USD           
-##  4 UNH    UnitedHeal… 91324P10   29177… 0.0913 Healt…     5482197 USD           
-##  5 UNH    UnitedHeal… 91324P10   29177… 0.0913 Healt…     5482197 USD           
-##  6 UNH    UnitedHeal… 91324P10   29177… 0.0913 Healt…     5482197 USD           
-##  7 UNH    UnitedHeal… 91324P10   29177… 0.0913 Healt…     5482197 USD           
-##  8 UNH    UnitedHeal… 91324P10   29177… 0.0913 Healt…     5482197 USD           
-##  9 UNH    UnitedHeal… 91324P10   29177… 0.0913 Healt…     5482197 USD           
-## 10 UNH    UnitedHeal… 91324P10   29177… 0.0913 Healt…     5482197 USD           
-## # … with 8,291 more rows, and 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 stock in an index or an exchange! This includes: “stock.prices”, “key.ratios”, “key.stats”, and more.

-
-
-
-
-

2.0 Scaling the Mutation of Financial Data -

-

Once you get the data, you typically want to do something with it. You can easily do this at scale. Let’s get the yearly returns for multiple stocks using tq_transmute. First, get the prices. We’ll use the FANG data set, but you typically will use tq_get to retrieve data in “tibble” format.

-
-data("FANG")
-
-FANG
-
## # A tibble: 4,032 × 8
-##    symbol date        open  high   low close    volume adjusted
-##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl>
-##  1 FB     2013-01-02  27.4  28.2  27.4  28    69846400     28  
-##  2 FB     2013-01-03  27.9  28.5  27.6  27.8  63140600     27.8
-##  3 FB     2013-01-04  28.0  28.9  27.8  28.8  72715400     28.8
-##  4 FB     2013-01-07  28.7  29.8  28.6  29.4  83781800     29.4
-##  5 FB     2013-01-08  29.5  29.6  28.9  29.1  45871300     29.1
-##  6 FB     2013-01-09  29.7  30.6  29.5  30.6 104787700     30.6
-##  7 FB     2013-01-10  30.6  31.5  30.3  31.3  95316400     31.3
-##  8 FB     2013-01-11  31.3  32.0  31.1  31.7  89598000     31.7
-##  9 FB     2013-01-14  32.1  32.2  30.6  31.0  98892800     31.0
-## 10 FB     2013-01-15  30.6  31.7  29.9  30.1 173242600     30.1
-## # … with 4,022 more rows
-

Second, use group_by to group by stock symbol. Third, apply the mutation. We can do this in one easy workflow. The periodReturns function is applied to each group of stock prices, and a new data frame was returned with the annual returns in the correct periodicity.

-
-FANG_returns_yearly <- FANG %>%
-    group_by(symbol) %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = periodReturn, 
-                 period     = "yearly", 
-                 col_rename = "yearly.returns") 
-

Last, we can visualize the returns.

-
-FANG_returns_yearly %>%
-    ggplot(aes(x = year(date), y = yearly.returns, fill = symbol)) +
-    geom_bar(position = "dodge", stat = "identity") +
-    labs(title = "FANG: Annual Returns", 
-         subtitle = "Mutating at scale is quick and easy!",
-         y = "Returns", x = "", color = "") +
-    scale_y_continuous(labels = scales::percent) +
-    coord_flip() +
-    theme_tq() +
-    scale_fill_tq()
-

-

-
-
-

3.0 Modeling Financial Data using purrr -

-

Eventually you will want to begin modeling (or more generally applying functions) at scale! One of the best features of the tidyverse is the ability to map functions to nested tibbles using purrr. From the Many Models chapter of “R for Data Science”, we can apply the same modeling workflow to financial analysis. Using a two step workflow:

-
    -
  1. Model a single stock
  2. -
  3. Scale to many stocks
  4. -
-

Let’s go through an example to illustrate.

-
-

Example: Applying a Regression Model to Detect a Positive Trend -

-

In this example, we’ll use a simple linear model to identify the trend in annual returns to determine if the stock returns are decreasing or increasing over time.

-
-

Analyze a Single Stock -

-

First, let’s collect stock data with tq_get()

-
-AAPL <- tq_get("AAPL", from = "2007-01-01", to = "2016-12-31")
-AAPL
-
## # A tibble: 2,518 × 8
-##    symbol date        open  high   low close     volume adjusted
-##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>      <dbl>    <dbl>
-##  1 AAPL   2007-01-03  3.08  3.09  2.92  2.99 1238319600     2.57
-##  2 AAPL   2007-01-04  3.00  3.07  2.99  3.06  847260400     2.62
-##  3 AAPL   2007-01-05  3.06  3.08  3.01  3.04  834741600     2.60
-##  4 AAPL   2007-01-08  3.07  3.09  3.05  3.05  797106800     2.62
-##  5 AAPL   2007-01-09  3.09  3.32  3.04  3.31 3349298400     2.83
-##  6 AAPL   2007-01-10  3.38  3.49  3.34  3.46 2952880000     2.97
-##  7 AAPL   2007-01-11  3.43  3.46  3.40  3.42 1440252800     2.93
-##  8 AAPL   2007-01-12  3.38  3.40  3.33  3.38 1312690400     2.90
-##  9 AAPL   2007-01-16  3.42  3.47  3.41  3.47 1244076400     2.97
-## 10 AAPL   2007-01-17  3.48  3.49  3.39  3.39 1646260000     2.91
-## # … with 2,508 more rows
-

Next, come up with a function to help us collect annual log returns. The function below mutates the stock prices to period returns using tq_transmute(). We add the type = "log" and period = "monthly" arguments to ensure we retrieve a tibble of monthly log returns. Last, we take the mean of the monthly returns to get MMLR.

-
-get_annual_returns <- function(stock.returns) {
-    stock.returns %>%
-        tq_transmute(select     = adjusted, 
-                     mutate_fun = periodReturn, 
-                     type       = "log", 
-                     period     = "yearly")
-}
-

Let’s test get_annual_returns out. We now have the annual log returns over the past ten years.

-
-AAPL_annual_log_returns <- get_annual_returns(AAPL)
-AAPL_annual_log_returns
-
## # A tibble: 10 × 2
-##    date       yearly.returns
-##    <date>              <dbl>
-##  1 2007-12-31         0.860 
-##  2 2008-12-31        -0.842 
-##  3 2009-12-31         0.904 
-##  4 2010-12-31         0.426 
-##  5 2011-12-30         0.228 
-##  6 2012-12-31         0.282 
-##  7 2013-12-31         0.0776
-##  8 2014-12-31         0.341 
-##  9 2015-12-31        -0.0306
-## 10 2016-12-30         0.118
-

Let’s visualize to identify trends. We can see from the linear trend line that AAPL’s stock returns are declining.

-
-AAPL_annual_log_returns %>%
-    ggplot(aes(x = year(date), y = yearly.returns)) + 
-    geom_hline(yintercept = 0, color = palette_light()[[1]]) +
-    geom_point(size = 2, color = palette_light()[[3]]) +
-    geom_line(size = 1, color = palette_light()[[3]]) + 
-    geom_smooth(method = "lm", se = FALSE) +
-    labs(title = "AAPL: Visualizing Trends in Annual Returns",
-         x = "", y = "Annual Returns", color = "") +
-    theme_tq()
-

-

Now, we can get the linear model using the lm() function. However, there is one problem: the output is not “tidy”.

-
-mod <- lm(yearly.returns ~ year(date), data = AAPL_annual_log_returns)
-mod
-
## 
-## Call:
-## lm(formula = yearly.returns ~ year(date), data = AAPL_annual_log_returns)
-## 
-## Coefficients:
-## (Intercept)   year(date)  
-##    58.86283     -0.02915
-

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

-
    -
  1. -augment: adds columns to the original data such as predictions, residuals and cluster assignments
  2. -
  3. -glance: provides a one-row summary of model-level statistics
  4. -
  5. -tidy: summarizes a model’s statistical findings such as coefficients of a regression
  6. -
-

We’ll use tidy to retrieve the model coefficients.

- -
## # A tibble: 2 × 5
-##   term        estimate std.error statistic p.value
-##   <chr>          <dbl>     <dbl>     <dbl>   <dbl>
-## 1 (Intercept)  58.9     113.         0.520   0.617
-## 2 year(date)   -0.0291    0.0562    -0.518   0.618
-

Adding to our workflow, we have the following:

-
-get_model <- function(stock_data) {
-    annual_returns <- get_annual_returns(stock_data)
-    mod <- lm(yearly.returns ~ year(date), data = annual_returns)
-    tidy(mod)
-}
-

Testing it out on a single stock. We can see that the “term” that contains the direction of the trend (the slope) is “year(date)”. The interpetation is that as year increases one unit, the annual returns decrease by 3%.

-
-get_model(AAPL)
-
## # A tibble: 2 × 5
-##   term        estimate std.error statistic p.value
-##   <chr>          <dbl>     <dbl>     <dbl>   <dbl>
-## 1 (Intercept)  58.9     113.         0.520   0.617
-## 2 year(date)   -0.0291    0.0562    -0.518   0.618
-

Now that we have identified the trend direction, it looks like we are ready to scale.

-
-
-

Scale to Many Stocks -

-

Once the analysis for one stock is done scale to many stocks is simple. For brevity, we’ll randomly sample ten stocks from the S&P500 with a call to dplyr::sample_n().

-
-set.seed(10)
-stocks_tbl <- tq_index("SP500") %>%
-    sample_n(5) 
-stocks_tbl
-
## # A tibble: 5 × 8
-##   symbol company    identifier sedol   weight sector  shares_held local_currency
-##   <chr>  <chr>      <chr>      <chr>    <dbl> <chr>         <dbl> <chr>         
-## 1 PVH    PVH Corp.  69365610   B3V9F… 1.86e-4 Consum…      801860 USD           
-## 2 BSX    Boston Sc… 10113710   21134… 1.51e-3 Health…    15943267 USD           
-## 3 KEY    KeyCorp    49326710   24909… 5.48e-4 Financ…    10703584 USD           
-## 4 RJF    Raymond J… 75473010   27189… 4.66e-4 Financ…     2076146 USD           
-## 5 REG    Regency C… 75884910   27261… 2.79e-4 Real E…     1712376 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 map() function maps our custom get_model function to our tibble of stocks using the symbol column. The tidyr::unnest function unrolls the nested data frame so all of the model statistics are accessable in the top data frame level. The filter, arrange and select steps just manipulate the data frame to isolate and arrange the data for our viewing.

-
-stocks_model_stats <- stocks_tbl %>%
-    select(symbol, company) %>%
-    tq_get(from = "2007-01-01", to = "2016-12-31") %>%
-    
-    # Nest 
-    group_by(symbol, company) %>%
-    nest() %>%
-    
-    # Apply the get_model() function to the new "nested" data column
-    mutate(model = map(data, get_model)) %>%
-    
-    # Unnest and collect slope
-    unnest(model) %>%
-    filter(term == "year(date)") %>%
-    arrange(desc(estimate)) %>%
-    select(-term)
-
-stocks_model_stats
-
## # A tibble: 5 × 7
-## # Groups:   symbol, company [5]
-##   symbol company              data          estimate std.error statistic p.value
-##   <chr>  <chr>                <list>           <dbl>     <dbl>     <dbl>   <dbl>
-## 1 KEY    KeyCorp              <tibble [2,5…  0.0982     0.0403     2.44   0.0408
-## 2 BSX    Boston Scientific C… <tibble [2,5…  0.0780     0.0319     2.44   0.0402
-## 3 REG    Regency Centers Cor… <tibble [2,5…  0.0419     0.0199     2.11   0.0683
-## 4 RJF    Raymond James Finan… <tibble [2,5…  0.0281     0.0319     0.879  0.405 
-## 5 PVH    PVH Corp.            <tibble [2,5…  0.00559    0.0513     0.109  0.916
-

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 S&P500 could be analyzed removing the sample_n() following the call to tq_index("SP500").

-
-
-
-
-

4.0 Error Handling when Scaling -

-

Eventually you will run into a stock index, stock symbol, FRED data code, etc that cannot be retrieved. Possible reasons are:

-
    -
  • An index becomes out of date
  • -
  • A company goes private
  • -
  • A stock ticker symbol changes
  • -
  • Yahoo / FRED just doesn’t like your stock symbol / FRED code
  • -
-

This becomes painful when scaling if the functions return errors. So, the tq_get() function is designed to handle errors gracefully. What this means is an NA value is returned when an error is generated along with a gentle error warning.

-
-tq_get("XYZ", "stock.prices")
-
## [1] NA
-
-

Pros and Cons to Built-In Error-Handling -

-

There are pros and cons to this approach that you may not agree with, but I believe helps in the long run. Just be aware of what happens:

-
    -
  • Pros: Long running scripts are not interrupted because of one error

  • -
  • Cons: Errors can be inadvertently handled or flow downstream if the users does not read the warnings

  • -
-
-
-

Bad Apples Fail Gracefully, tq_get -

-

Let’s see an example when using tq_get() to get the stock prices for a long list of stocks with one BAD APPLE. The argument complete_cases comes in handy. The default is TRUE, which removes “bad apples” so future analysis have complete cases to compute on. Note that a gentle warning stating that an error occurred and was dealt with by removing the rows from the results.

-
-c("AAPL", "GOOG", "BAD APPLE") %>%
-    tq_get(get = "stock.prices", complete_cases = TRUE)
-
## Warning: x = 'BAD APPLE', get = 'stock.prices': Error in getSymbols.yahoo(Symbols = "BAD APPLE", env = <environment>, : Unable to import "BAD APPLE".
-## argument "conn" is missing, with no default
-##  Removing BAD APPLE.
-
## # A tibble: 5,534 × 8
-##    symbol date        open  high   low close    volume adjusted
-##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl>
-##  1 AAPL   2011-01-03  11.6  11.8  11.6  11.8 445138400     10.1
-##  2 AAPL   2011-01-04  11.9  11.9  11.7  11.8 309080800     10.1
-##  3 AAPL   2011-01-05  11.8  11.9  11.8  11.9 255519600     10.2
-##  4 AAPL   2011-01-06  12.0  12.0  11.9  11.9 300428800     10.2
-##  5 AAPL   2011-01-07  11.9  12.0  11.9  12.0 311931200     10.3
-##  6 AAPL   2011-01-10  12.1  12.3  12.0  12.2 448560000     10.5
-##  7 AAPL   2011-01-11  12.3  12.3  12.1  12.2 444108000     10.5
-##  8 AAPL   2011-01-12  12.3  12.3  12.2  12.3 302590400     10.5
-##  9 AAPL   2011-01-13  12.3  12.4  12.3  12.3 296780400     10.6
-## 10 AAPL   2011-01-14  12.4  12.4  12.3  12.4 308840000     10.7
-## # … with 5,524 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 NA values exist in the output and the return is a “nested” data structure.

-
-c("AAPL", "GOOG", "BAD APPLE") %>%
-    tq_get(get = "stock.prices", complete_cases = FALSE)
-
## Warning: x = 'BAD APPLE', get = 'stock.prices': Error in getSymbols.yahoo(Symbols = "BAD APPLE", env = <environment>, : Unable to import "BAD APPLE".
-## argument "conn" is missing, with no default
-
## # A tibble: 5,535 × 8
-##    symbol date        open  high   low close    volume adjusted
-##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl>
-##  1 AAPL   2011-01-03  11.6  11.8  11.6  11.8 445138400     10.1
-##  2 AAPL   2011-01-04  11.9  11.9  11.7  11.8 309080800     10.1
-##  3 AAPL   2011-01-05  11.8  11.9  11.8  11.9 255519600     10.2
-##  4 AAPL   2011-01-06  12.0  12.0  11.9  11.9 300428800     10.2
-##  5 AAPL   2011-01-07  11.9  12.0  11.9  12.0 311931200     10.3
-##  6 AAPL   2011-01-10  12.1  12.3  12.0  12.2 448560000     10.5
-##  7 AAPL   2011-01-11  12.3  12.3  12.1  12.2 444108000     10.5
-##  8 AAPL   2011-01-12  12.3  12.3  12.2  12.3 302590400     10.5
-##  9 AAPL   2011-01-13  12.3  12.4  12.3  12.3 296780400     10.6
-## 10 AAPL   2011-01-14  12.4  12.4  12.3  12.4 308840000     10.7
-## # … with 5,525 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 perform downstream computations at scale, the computations will likely fail grinding the analysis to a hault. But, the advantage is that the user will more easily be able to filter to the problem childs to determine what happened and decide whether this is acceptable or not.

-
-
-
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.1.

-
- -
-
- - - - - - - - diff --git a/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-11-1.png b/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-11-1.png deleted file mode 100644 index 5ca60432..00000000 Binary files a/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-11-1.png and /dev/null differ diff --git a/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-13-1.png b/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-13-1.png deleted file mode 100644 index 441074d6..00000000 Binary files a/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-13-1.png and /dev/null differ diff --git a/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-15-1.png b/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-15-1.png deleted file mode 100644 index b629cec2..00000000 Binary files a/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-15-1.png and /dev/null differ diff --git a/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-16-1.png b/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-16-1.png deleted file mode 100644 index e682204b..00000000 Binary files a/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/figure-html/unnamed-chunk-16-1.png and /dev/null differ diff --git a/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/header-attrs-2.1/header-attrs.js b/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/header-attrs-2.1/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/TQ03-scaling-and-modeling-with-tidyquant_files/header-attrs-2.1/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/TQ04-charting-with-tidyquant.html b/docs/articles/TQ04-charting-with-tidyquant.html deleted file mode 100644 index 27c08720..00000000 --- a/docs/articles/TQ04-charting-with-tidyquant.html +++ /dev/null @@ -1,599 +0,0 @@ - - - - - - - -Charting with tidyquant • tidyquant - - - - - - - - - - - - - -
-
- - - - -
-
- - - - -
-

Charting financial data using ggplot2

-
-
-

Overview -

-

The tidyquant package includes charting tools to assist users in developing quick visualizations in ggplot2 using the grammar of graphics format and workflow. There are currently three primary geometry (geom) categories and one coordinate manipulation (coord) category within tidyquant:

-
    -
  • -Chart Types: Two chart type visualizations are available using geom_barchart and geom_candlestick.
  • -
  • -Moving Averages: Seven moving average visualizations are available using geom_ma.
  • -
  • -Bollinger Bands: Bollinger bands can be visualized using geom_bbands. The BBand moving average can be one of the seven available in Moving Averages.
  • -
  • -Zooming in on Date Ranges: Two coord functions are available (coord_x_date and coord_x_datetime), which prevent data loss when zooming in on specific regions of a chart. This is important when using the moving average and Bollinger band geoms.
  • -
-
-
-

Prerequisites -

-

Load the tidyquant package to get started.

-
-# Loads tidyquant, lubridate, xts, quantmod, TTR, and PerformanceAnalytics
-library(tidyverse)
-library(tidyquant)  
-

The following stock data will be used for the examples. Use tq_get to get the stock prices.

-
-# Use FANG data set
-data("FANG") 
-
-# Get AAPL and AMZN Stock Prices
-AAPL <- tq_get("AAPL", get = "stock.prices", from = "2015-09-01", to = "2016-12-31")
-AMZN <- tq_get("AMZN", get = "stock.prices", from = "2000-01-01", to = "2016-12-31")
-

The end date parameter will be used when setting date limits throughout the examples.

-
-end <- as_date("2016-12-31")
-
-
-

Chart Types -

-

Financial charts provide visual cues to open, high, low, and close prices. The following chart geoms are available:

- -
-

Line Chart -

-

Before we visualize bar charts and candlestick charts using the tidyquant geoms, let’s visualize stock prices with a simple line chart to get a sense of the “grammar of graphics” workflow. This is done using the geom_line from the ggplot2 package. The workflow begins with the stock data, and uses the pipe operator (%>%) to send to the ggplot() function.

-

The primary features controlling the chart are the aesthetic arguments: these are used to add data to the chart by way of the aes() function. When added inside the ggplot() function, the aesthetic arguments are available to all underlying layers. Alternatively, the aesthetic arguments can be applied to each geom individually, but typically this is minimized in practice because it duplicates code. We set aesthetic arguments, x = date and y = close, to chart the closing price versus date. The geom_line() function inherits the aesthetic arguments from the ggplot() function and produces a line on the chart. Labels are added separately using the labs() function. Thus, the chart is built from the ground up by starting with data and progressively adding geoms, labels, coordinates / scales and other attributes to create a the final chart. This is enables maximum flexibility wherein the analyst can create very complex charts using the “grammar of graphics”.

-
-AAPL %>%
-    ggplot(aes(x = date, y = close)) +
-    geom_line() +
-    labs(title = "AAPL Line Chart", y = "Closing Price", x = "") + 
-    theme_tq()
-

-
-
-

Bar Chart -

-

Visualizing the bar chart is as simple as replacing geom_line with geom_barchart in the ggplot workflow. Because the bar chart uses open, high, low, and close prices in the visualization, we need to specify these as part of the aesthetic arguments, aes(). We can do so internal to the geom or in the ggplot() function.

-
-AAPL %>%
-    ggplot(aes(x = date, y = close)) +
-    geom_barchart(aes(open = open, high = high, low = low, close = close)) +
-    labs(title = "AAPL Bar Chart", y = "Closing Price", x = "") + 
-    theme_tq()
-

-

We zoom into specific sections using coord_x_date, which has xlim and ylim arguments specified as c(start, end) to focus on a specific region of the chart. For xlim, we’ll use lubridate to convert a character date to date class, and then subtract six weeks using the weeks() function. For ylim we zoom in on prices in the range from 100 to 120.

-
-AAPL %>%
-    ggplot(aes(x = date, y = close)) +
-    geom_barchart(aes(open = open, high = high, low = low, close = close)) +
-    labs(title = "AAPL Bar Chart", 
-         subtitle = "Zoomed in using coord_x_date",
-         y = "Closing Price", x = "") + 
-    coord_x_date(xlim = c(end - weeks(6), end),
-                 ylim = c(100, 120)) + 
-    theme_tq()
-

-

The colors can be modified using colour_up and colour_down arguments, and parameters such as size can be used to control the appearance.

-
-AAPL %>%
-    ggplot(aes(x = date, y = close)) +
-    geom_barchart(aes(open = open, high = high, low = low, close = close),
-                     colour_up = "darkgreen", colour_down = "darkred", size = 1) +
-    labs(title = "AAPL Bar Chart", 
-         subtitle = "Zoomed in, Experimenting with Formatting",
-         y = "Closing Price", x = "") + 
-    coord_x_date(xlim = c(end - weeks(6), end),
-                 ylim = c(100, 120)) + 
-    theme_tq()
-

-
-
-

Candlestick Chart -

-

Creating a candlestick chart is very similar to the process with the bar chart. Using geom_candlestick, we can insert into the ggplot workflow.

-
-AAPL %>%
-    ggplot(aes(x = date, y = close)) +
-    geom_candlestick(aes(open = open, high = high, low = low, close = close)) +
-    labs(title = "AAPL Candlestick Chart", y = "Closing Price", x = "") +
-    theme_tq()
-

-

We zoom into specific sections using coord_x_date.

-
-AAPL %>%
-    ggplot(aes(x = date, y = close)) +
-    geom_candlestick(aes(open = open, high = high, low = low, close = close)) +
-    labs(title = "AAPL Candlestick Chart", 
-         subtitle = "Zoomed in using coord_x_date",
-         y = "Closing Price", x = "") + 
-    coord_x_date(xlim = c(end - weeks(6), end),
-                 ylim = c(100, 120)) + 
-    theme_tq()
-

-

The colors can be modified using colour_up and colour_down, which control the line color, and fill_up and fill_down, which control the rectangle fills.

-
-AAPL %>%
-    ggplot(aes(x = date, y = close)) +
-    geom_candlestick(aes(open = open, high = high, low = low, close = close),
-                        colour_up = "darkgreen", colour_down = "darkred", 
-                        fill_up  = "darkgreen", fill_down  = "darkred") +
-    labs(title = "AAPL Candlestick Chart", 
-         subtitle = "Zoomed in, Experimenting with Formatting",
-         y = "Closing Price", x = "") + 
-    coord_x_date(xlim = c(end - weeks(6), end),
-                 ylim = c(100, 120)) + 
-    theme_tq()
-

-

-
-
-

Charting Multiple Securities -

-

We can use facet_wrap to visualize multiple stocks at the same time. By adding a group aesthetic in the main ggplot() function and combining with a facet_wrap() function at the end of the ggplot workflow, all four “FANG” stocks can be viewed simultaneously. You may notice an odd filter() call before the call to ggplot(). I’ll discuss this next.

-
-start <- end - weeks(6)
-FANG %>%
-    filter(date >= start - days(2 * 15)) %>%
-    ggplot(aes(x = date, y = close, group = symbol)) +
-    geom_candlestick(aes(open = open, high = high, low = low, close = close)) +
-    labs(title = "FANG Candlestick Chart", 
-         subtitle = "Experimenting with Mulitple Stocks",
-         y = "Closing Price", x = "") + 
-    coord_x_date(xlim = c(start, end)) +
-    facet_wrap(~ symbol, ncol = 2, scale = "free_y") + 
-    theme_tq()
-

-

A note about out-of-bounds data (or “clipping”), which is particularly important with faceting and charting moving averages:

-

The coord_x_date coordinate function is designed to zoom into specific sections of a chart without “clipping” data that is outside of the view. This is in contrast to scale_x_date, which removes out-of-bounds data from the charting. Under normal circumstances clipping is not a big deal (and is actually helpful for scaling the y-axis), but with financial applications users want to chart rolling/moving averages, lags, etc that depend on data outside of the view port. Because of this need for out-of-bounds data, there is a trade-off when charting: Too much out-of-bounds data distorts the scale of the y-axis, and too little and we cannot get a moving average. The optimal method is to include “just enough” out-of-bounds data to get the chart we want. This is why below the FANG data is filtered by date from double the number of moving-average days (2 * n) previous to the start date. This yields a nice y-axis scale and still allows us to create a moving average line using geom_ma.

-
-start <- end - weeks(6)
-FANG %>%
-    filter(date >= start - days(2 * 15)) %>%
-    ggplot(aes(x = date, y = close, group = symbol)) +
-    geom_candlestick(aes(open = open, high = high, low = low, close = close)) +
-    geom_ma(ma_fun = SMA, n = 15, color = "darkblue", size = 1) +
-    labs(title = "FANG Candlestick Chart", 
-         subtitle = "Experimenting with Mulitple Stocks",
-         y = "Closing Price", x = "") + 
-    coord_x_date(xlim = c(start, end)) +
-    facet_wrap(~ symbol, ncol = 2, scale = "free_y") +
-    theme_tq()
-

-
-
-
-

Visualizing Trends -

-

Moving averages are critical to evaluating time-series trends. tidyquant includes geoms to enable “rapid prototyping” to quickly visualize signals using moving averages and Bollinger bands.

-

-
-

Moving Averages -

-

The following moving averages are available:

- -

Moving averages are applied as an added layer to a chart with the geom_ma function. The geom is a wrapper for the underlying moving average functions from the TTR package: SMA, EMA, WMA, DEMA, ZLEMA, VWMA, and EVWMA. Here’s how to use the geom:

-
    -
  1. Select a moving average function, ma_fun, that you want to apply.
  2. -
  3. Determine the function arguments that need to be passed to the ma_fun. You can investigate the underlying function by searching ?TTR::SMA.
  4. -
  5. Determine the aesthetic arguments to pass. These will typically be aes(x = date, y = close). The volume-weighted functions will require the volume argument in the aes() function.
  6. -
  7. Apply the moving average geom in your ggplot workflow.
  8. -
-

Important Note: When zooming in on a section, use coord_x_date or coord_x_datetime to prevent out-of-bounds data loss. Do not use scale_x_date, which will affect the moving average calculation. Refer to Charting Multiple Securities.

-
-

Example 1: Charting the 50-day and 200-day simple moving average -

-

We want to apply a SMA, so we research the TTR function and we see that it accepts, n, the number of periods to average over. We see that the aesthetics required are x, a date, and y, a price. Since these are already in the main ggplot() function, we don’t need to add the aesthetics to the geom. We apply the moving average geoms after the candlestick geom to overlay the moving averages on top of the candlesticks. We add two moving average calls, one for the 50-day and the other for the 200-day. We add color = "red" and linetype = 5 to distinguish the 200-day from the 50-day.

-
-AAPL %>%
-    ggplot(aes(x = date, y = close)) +
-    geom_candlestick(aes(open = open, high = high, low = low, close = close)) +
-    geom_ma(ma_fun = SMA, n = 50, linetype = 5, size = 1.25) +
-    geom_ma(ma_fun = SMA, n = 200, color = "red", size = 1.25) + 
-    labs(title = "AAPL Candlestick Chart", 
-         subtitle = "50 and 200-Day SMA", 
-         y = "Closing Price", x = "") + 
-    coord_x_date(xlim = c(end - weeks(24), end),
-                 ylim = c(100, 120)) + 
-    theme_tq()
-

-
-
-

Example 2: Charting exponential moving averages -

-

We want an EMA, so we research the TTR function and we see that it accepts, n, the number of periods to average over, wilder a Boolean, and ratio arguments. We will use wilder = TRUE and go with the default for the ratio arg. We see that the aesthetics required are x, a date, and y, a price. Since these are already in the main ggplot() function, we don’t need to modify the geom. We are ready to apply after the bar chart geom.

-
-AAPL %>%
-    ggplot(aes(x = date, y = close)) +
-    geom_barchart(aes(open = open, high = high, low = low, close = close)) +
-    geom_ma(ma_fun = EMA, n = 50, wilder = TRUE, linetype = 5, size = 1.25) +
-    geom_ma(ma_fun = EMA, n = 200, wilder = TRUE, color = "red", size = 1.25) + 
-    labs(title = "AAPL Bar Chart", 
-         subtitle = "50 and 200-Day EMA", 
-         y = "Closing Price", x = "") + 
-    coord_x_date(xlim = c(end - weeks(24), end),
-                 ylim = c(100, 120)) +
-    theme_tq()
-

-
-
-

Example 3: Charting moving averages for multiple stocks at once -

-

We’ll double up using a volume-weighted average (VWMA) and apply it to the FANG stocks at once. Since VWMA is a volume-weighted function, we need to add volume as an aesthetic. Because we are viewing multiple stocks, we add a group aesthetic setting it to the symbol column which contains the FANG stock symbols. The facet wrap is added at the end to create four charts instead of one overlayed chart.

-
-start <- end - weeks(6)
-FANG %>%
-    filter(date >= start - days(2 * 50)) %>%
-    ggplot(aes(x = date, y = close, volume = volume, group = symbol)) +
-    geom_candlestick(aes(open = open, high = high, low = low, close = close)) +
-    geom_ma(ma_fun = VWMA, n = 15, wilder = TRUE, linetype = 5) +
-    geom_ma(ma_fun = VWMA, n = 50, wilder = TRUE, color = "red") + 
-    labs(title = "FANG Bar Chart", 
-         subtitle = "50 and 200-Day EMA, Experimenting with Multiple Stocks", 
-         y = "Closing Price", x = "") + 
-    coord_x_date(xlim = c(start, end)) +
-    facet_wrap(~ symbol, ncol = 2, scales = "free_y") + 
-    theme_tq()
-

-
-
-
-

Bollinger Bands -

-

Bollinger Bands are used to visualize volatility by plotting a range around a moving average typically two standard deviations up and down. Because they use a moving average, the geom_bbands function works almost identically to geom_ma. The same seven moving averages are compatible. The main difference is the addition of the standard deviation, sd, argument which is 2 by default, and the high, low and close aesthetics which are required to calculate the bands. Refer to Moving Averages for a detailed discussion on what moving averages are available.

-

Important Note: When zooming in on a section, use coord_x_date or coord_x_datetime to prevent out-of-bounds data loss. Do not use scale_x_date, which will affect the moving average calculation. Refer to Charting Multiple Securities.

-
-

Example 1: Applying BBands using a SMA -

-

Let’s do a basic example to add Bollinger Bands using a simple moving average. Because both the candlestick geom and the BBands geom use high, low and close prices, we move these aesthetics to the main ggplot() function to avoid duplication. We add BBands after the candlestick geom to overlay the BBands on top.

-
-AAPL %>%
-    ggplot(aes(x = date, y = close, open = open,
-               high = high, low = low, close = close)) +
-    geom_candlestick() +
-    geom_bbands(ma_fun = SMA, sd = 2, n = 20) +
-    labs(title = "AAPL Candlestick Chart", 
-         subtitle = "BBands with SMA Applied", 
-         y = "Closing Price", x = "") + 
-    coord_x_date(xlim = c(end - weeks(24), end),
-                 ylim = c(100, 120)) + 
-    theme_tq()
-

-
-
-

Example 2: Modifying the appearance of Bollinger Bands -

-

The appearance can be modified using color_ma, color_bands, alpha, and fill arguments. Here’s the same plot from Example 1, with new formatting applied to the BBands.

-
-AAPL %>%
-    ggplot(aes(x = date, y = close, open = open,
-               high = high, low = low, close = close)) +
-    geom_candlestick() +
-    geom_bbands(ma_fun = SMA, sd = 2, n = 20, 
-                linetype = 4, size = 1, alpha = 0.2, 
-                fill        = palette_light()[[1]], 
-                color_bands = palette_light()[[1]], 
-                color_ma    = palette_light()[[2]]) +
-    labs(title = "AAPL Candlestick Chart", 
-         subtitle = "BBands with SMA Applied, Experimenting with Formatting", 
-         y = "Closing Price", x = "") + 
-    coord_x_date(xlim = c(end - weeks(24), end),
-                 ylim = c(100, 120)) + 
-    theme_tq()
-

-
-
-

Example 3: Adding BBands to multiple stocks -

-

The process is very similar to charting moving averages for multiple stocks.

-
-start <- end - weeks(24)
-FANG %>%
-    filter(date >= start - days(2 * 20)) %>%
-    ggplot(aes(x = date, y = close, 
-               open = open, high = high, low = low, close = close, 
-               group = symbol)) +
-    geom_barchart() +
-    geom_bbands(ma_fun = SMA, sd = 2, n = 20, linetype = 5) +
-    labs(title = "FANG Bar Chart", 
-         subtitle = "BBands with SMA Applied, Experimenting with Multiple Stocks", 
-         y = "Closing Price", x = "") + 
-    coord_x_date(xlim = c(start, end)) +
-    facet_wrap(~ symbol, ncol = 2, scales = "free_y") + 
-    theme_tq()
-

-
-
-
-
-

ggplot2 Functionality -

-

Base ggplot2 has a ton of functionality that can be useful for analyzing financial data. We’ll go through some brief examples using Amazon (AMZN).

-
-

Example 1: Log Scale with scale_y_log10 -

-

ggplot2 has the scale_y_log10() function to scale the y-axis on a logarithmic scale. This is extremely helpful as it tends to expose linear trends that can be analyzed.

-

Continuous Scale:

-
-AMZN %>%
-    ggplot(aes(x = date, y = adjusted)) +
-    geom_line(color = palette_light()[[1]]) + 
-    scale_y_continuous() +
-    labs(title = "AMZN Line Chart", 
-         subtitle = "Continuous Scale", 
-         y = "Closing Price", x = "") + 
-    theme_tq()
-

-

Log Scale:

-
-AMZN %>%
-    ggplot(aes(x = date, y = adjusted)) +
-    geom_line(color = palette_light()[[1]]) + 
-    scale_y_log10() +
-    labs(title = "AMZN Line Chart", 
-         subtitle = "Log Scale", 
-         y = "Closing Price", x = "") + 
-    theme_tq()
-

-
-
-

Example 2: Regression trendlines with geom_smooth -

-

We can apply a trend line quickly adding the geom_smooth() function to our workflow. The function has several prediction methods including linear ("lm") and loess ("loess") to name a few.

-

Linear:

-
-AMZN %>%
-    ggplot(aes(x = date, y = adjusted)) +
-    geom_line(color = palette_light()[[1]]) + 
-    scale_y_log10() +
-    geom_smooth(method = "lm") +
-    labs(title = "AMZN Line Chart", 
-         subtitle = "Log Scale, Applying Linear Trendline", 
-         y = "Adjusted Closing Price", x = "") + 
-    theme_tq()
-

-
-
-

Example 3: Charting volume with geom_segment -

-

We can use the geom_segment() function to chart daily volume, which uses xy points for the beginning and end of the line. Using the aesthetic color argument, we color based on the value of volume to make these data stick out.

-
-AMZN %>%
-    ggplot(aes(x = date, y = volume)) +
-    geom_segment(aes(xend = date, yend = 0, color = volume)) + 
-    geom_smooth(method = "loess", se = FALSE) +
-    labs(title = "AMZN Volume Chart", 
-         subtitle = "Charting Daily Volume", 
-         y = "Volume", x = "") +
-    theme_tq() +
-    theme(legend.position = "none") 
-

-

And, we can zoom in on a specific region. Using scale_color_gradient we can quickly visualize the high and low points, and using geom_smooth we can see the trend.

-
-start <- end - weeks(24)
-AMZN %>%
-    filter(date >= start - days(50)) %>%
-    ggplot(aes(x = date, y = volume)) +
-    geom_segment(aes(xend = date, yend = 0, color = volume)) +
-    geom_smooth(method = "loess", se = FALSE) +
-    labs(title = "AMZN Bar Chart", 
-         subtitle = "Charting Daily Volume, Zooming In", 
-         y = "Volume", x = "") + 
-    coord_x_date(xlim = c(start, end)) +
-    scale_color_gradient(low = "red", high = "darkblue") +
-    theme_tq() + 
-    theme(legend.position = "none") 
-

-
-
-
-

Themes -

-

The tidyquant package comes with three themes to help quickly customize financial charts:

- -
-

Dark -

-
-n_mavg <- 50 # Number of periods (days) for moving average
-FANG %>%
-    filter(date >= start - days(2 * n_mavg)) %>%
-    ggplot(aes(x = date, y = close, color = symbol)) +
-    geom_line(size = 1) +
-    geom_ma(n = 15, color = "darkblue", size = 1) + 
-    geom_ma(n = n_mavg, color = "red", size = 1) +
-    labs(title = "Dark Theme",
-         x = "", y = "Closing Price") +
-    coord_x_date(xlim = c(start, end)) +
-    facet_wrap(~ symbol, scales = "free_y") +
-    theme_tq_dark() +
-    scale_color_tq(theme = "dark") +
-    scale_y_continuous(labels = scales::dollar)
-

-
-
-
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.1.

-
- -
-
- - - - - - - - diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-10-1.png deleted file mode 100644 index 6e342ff8..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-10-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-11-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-11-1.png deleted file mode 100644 index 6e40dcb7..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-11-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-12-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-12-1.png deleted file mode 100644 index 68d72038..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-12-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-13-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-13-1.png deleted file mode 100644 index 5af83623..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-13-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-14-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-14-1.png deleted file mode 100644 index 3c352edb..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-14-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-15-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-15-1.png deleted file mode 100644 index 77b0e261..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-15-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-16-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-16-1.png deleted file mode 100644 index dfd20676..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-16-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-17-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-17-1.png deleted file mode 100644 index 38e07f25..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-17-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-18-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-18-1.png deleted file mode 100644 index fce705c9..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-18-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-19-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-19-1.png deleted file mode 100644 index 2c30b96e..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-19-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-20-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-20-1.png deleted file mode 100644 index 49d40479..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-20-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-21-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-21-1.png deleted file mode 100644 index 0d096116..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-21-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-22-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-22-1.png deleted file mode 100644 index 2abbac4a..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-22-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-23-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-23-1.png deleted file mode 100644 index a611e567..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-23-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-24-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-24-1.png deleted file mode 100644 index 6face064..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-24-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-25-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-25-1.png deleted file mode 100644 index 56cf199d..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-25-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-26-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-26-1.png deleted file mode 100644 index 482f5220..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-26-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-27-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-27-1.png deleted file mode 100644 index 746ab411..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-27-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-28-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-28-1.png deleted file mode 100644 index 142821ac..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-28-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-29-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-29-1.png deleted file mode 100644 index 657d94d7..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-29-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-5-1.png deleted file mode 100644 index a8313452..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-5-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-6-1.png deleted file mode 100644 index b2df192f..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-6-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-7-1.png deleted file mode 100644 index 61c102d3..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-7-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-8-1.png deleted file mode 100644 index dfed88b9..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-8-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-9-1.png deleted file mode 100644 index e38defa9..00000000 Binary files a/docs/articles/TQ04-charting-with-tidyquant_files/figure-html/unnamed-chunk-9-1.png and /dev/null differ diff --git a/docs/articles/TQ04-charting-with-tidyquant_files/header-attrs-2.1/header-attrs.js b/docs/articles/TQ04-charting-with-tidyquant_files/header-attrs-2.1/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/TQ04-charting-with-tidyquant_files/header-attrs-2.1/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/TQ05-performance-analysis-with-tidyquant.html b/docs/articles/TQ05-performance-analysis-with-tidyquant.html deleted file mode 100644 index 2b24c671..00000000 --- a/docs/articles/TQ05-performance-analysis-with-tidyquant.html +++ /dev/null @@ -1,1167 +0,0 @@ - - - - - - - -Performance Analysis with tidyquant • tidyquant - - - - - - - - - - - - - -
-
- - - - -
-
- - - - -
-

Tidy analysis of stock and portfolio return performance with PerformanceAnalytics

-
-
-

Overview -

-

Financial asset (individual stocks, securities, etc) and portfolio (groups of stocks, securities, etc) performance analysis is a deep field with a wide range of theories and methods for analyzing risk versus reward. The PerformanceAnalytics package consolidates functions to compute many of the most widely used performance metrics. tidquant integrates this functionality so it can be used at scale using the split, apply, combine framework within the tidyverse. Two primary functions integrate the performance analysis functionality:

-
    -
  • -tq_performance implements the performance analysis functions in a tidy way, enabling scaling analysis using the split, apply, combine framework.
  • -
  • -tq_portfolio provides a useful tool set for aggregating a group of individual asset returns into one or many portfolios.
  • -
-

This vignette aims to cover three aspects of performance analysis:

-
    -
  1. The general workflow to go from start to finish on both an asset and a portfolio level

  2. -
  3. Some of the available techniques to implement once the workflow is implemented

  4. -
  5. How to customize tq_portfolio and tq_performance using the ... parameter

  6. -
-
-
-

1.0 Key Concepts -

-

An important concept is that performance analysis is based on the statistical properties of returns (not prices). As a result, this package uses inputs of time-based returns as opposed to stock prices. The arguments change to Ra for the asset returns and Rb for the baseline returns. We’ll go over how to get returns in the Workflow section.

-

Another important concept is the baseline. The baseline is what you are measuring performance against. A baseline can be anything, but in many cases it’s a representative average of how an investment might perform with little or no effort. Often indexes such as the S&P500 are used for general market performance. Other times more specific Exchange Traded Funds (ETFs) are used such as the SPDR Technology ETF (XLK). The important concept here is that you measure the asset performance (Ra) against the baseline (Rb).

-

Now for a quick tutorial to show off the PerformanceAnalytics package integration.

-
-
-

2.0 Quick Example -

-

One of the most widely used risk to return metrics is the Capital Asset Pricing Model (CAPM). According to Investopedia:

-
-

The capital asset pricing model (CAPM) is a model that describes the relationship between systematic risk and expected return for assets, particularly stocks. CAPM is widely used throughout finance for the pricing of risky securities, generating expected returns for assets given the risk of those assets and calculating costs of capital.

-
-

We’ll use the PerformanceAnalytics function, table.CAPM, to evaluate the returns of several technology stocks against the SPDR Technology ETF (XLK).

-

First, load the tidyquant package.

- -

Second, get the stock returns for the stocks we wish to evaluate. We use tq_get to get stock prices from Yahoo Finance, group_by to group the stock prices related to each symbol, and tq_transmute to retrieve period returns in a monthly periodicity using the “adjusted” stock prices (adjusted for stock splits, which can throw off returns, affecting the performance analysis). Review the output and see that there are three groups of symbols indicating the data has been grouped appropriately.

-
-Ra <- c("AAPL", "GOOG", "NFLX") %>%
-    tq_get(get  = "stock.prices",
-           from = "2010-01-01",
-           to   = "2015-12-31") %>%
-    group_by(symbol) %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = periodReturn, 
-                 period     = "monthly", 
-                 col_rename = "Ra")
-Ra
-
## # A tibble: 216 × 3
-## # Groups:   symbol [3]
-##    symbol date            Ra
-##    <chr>  <date>       <dbl>
-##  1 AAPL   2010-01-29 -0.103 
-##  2 AAPL   2010-02-26  0.0654
-##  3 AAPL   2010-03-31  0.148 
-##  4 AAPL   2010-04-30  0.111 
-##  5 AAPL   2010-05-28 -0.0161
-##  6 AAPL   2010-06-30 -0.0208
-##  7 AAPL   2010-07-30  0.0227
-##  8 AAPL   2010-08-31 -0.0550
-##  9 AAPL   2010-09-30  0.167 
-## 10 AAPL   2010-10-29  0.0607
-## # … with 206 more rows
-

Next, we get the baseline prices. We’ll use the XLK. Note that there is no need to group because we are just getting one data set.

-
-Rb <- "XLK" %>%
-    tq_get(get  = "stock.prices",
-           from = "2010-01-01",
-           to   = "2015-12-31") %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = periodReturn, 
-                 period     = "monthly", 
-                 col_rename = "Rb")
-Rb
-
## # A tibble: 72 × 2
-##    date            Rb
-##    <date>       <dbl>
-##  1 2010-01-29 -0.0993
-##  2 2010-02-26  0.0348
-##  3 2010-03-31  0.0684
-##  4 2010-04-30  0.0126
-##  5 2010-05-28 -0.0748
-##  6 2010-06-30 -0.0540
-##  7 2010-07-30  0.0745
-##  8 2010-08-31 -0.0561
-##  9 2010-09-30  0.117 
-## 10 2010-10-29  0.0578
-## # … with 62 more rows
-

Now, we combine the two data sets using the “date” field using left_join from the dplyr package. Review the results and see that we still have three groups of returns, and columns “Ra” and “Rb” are side-by-side.

-
-RaRb <- left_join(Ra, Rb, by = c("date" = "date"))
-RaRb
-
## # A tibble: 216 × 4
-## # Groups:   symbol [3]
-##    symbol date            Ra      Rb
-##    <chr>  <date>       <dbl>   <dbl>
-##  1 AAPL   2010-01-29 -0.103  -0.0993
-##  2 AAPL   2010-02-26  0.0654  0.0348
-##  3 AAPL   2010-03-31  0.148   0.0684
-##  4 AAPL   2010-04-30  0.111   0.0126
-##  5 AAPL   2010-05-28 -0.0161 -0.0748
-##  6 AAPL   2010-06-30 -0.0208 -0.0540
-##  7 AAPL   2010-07-30  0.0227  0.0745
-##  8 AAPL   2010-08-31 -0.0550 -0.0561
-##  9 AAPL   2010-09-30  0.167   0.117 
-## 10 AAPL   2010-10-29  0.0607  0.0578
-## # … with 206 more rows
-

Finally, we can retrieve the performance metrics using tq_performance(). You can use tq_performance_fun_options() to see the full list of compatible performance functions.

-
-RaRb_capm <- RaRb %>%
-    tq_performance(Ra = Ra, 
-                   Rb = Rb, 
-                   performance_fun = table.CAPM)
-RaRb_capm
-
## # A tibble: 3 × 13
-## # Groups:   symbol [3]
-##   symbol ActivePremium  Alpha AnnualizedAlpha  Beta `Beta-` `Beta+` Correlation
-##   <chr>          <dbl>  <dbl>           <dbl> <dbl>   <dbl>   <dbl>       <dbl>
-## 1 AAPL           0.119 0.0089           0.112 1.11    0.578  1.04        0.659 
-## 2 GOOG           0.034 0.0028           0.034 1.14    1.39   1.16        0.644 
-## 3 NFLX           0.447 0.053            0.859 0.384  -1.52   0.0045      0.0817
-## # … with 5 more variables: Correlationp-value <dbl>, InformationRatio <dbl>,
-## #   R-squared <dbl>, TrackingError <dbl>, TreynorRatio <dbl>
-

We can quickly isolate attributes, such as alpha, the measure of growth, and beta, the measure of risk.

-
-RaRb_capm %>% select(symbol, Alpha, Beta)
-
## # A tibble: 3 × 3
-## # Groups:   symbol [3]
-##   symbol  Alpha  Beta
-##   <chr>   <dbl> <dbl>
-## 1 AAPL   0.0089 1.11 
-## 2 GOOG   0.0028 1.14 
-## 3 NFLX   0.053  0.384
-

With tidyquant it’s efficient and easy to get the CAPM information! And, that’s just one of 129 available functions to analyze stock and portfolio return performance. Just use tq_performance_fun_options() to see the full list.

-

-
-
-

3.0 Workflow -

-

The general workflow is shown in the diagram below. We’ll step through the workflow first with a group of individual assets (stocks) and then with portfolios of stocks.

-
-

Performance Analysis Workflow

-
-
-

3.1 Individual Assets -

-

Individual assets are the simplest form of analysis because there is no portfolio aggregation (Step 3A). We’ll re-do the “Quick Example” this time getting the Sharpe Ratio, a measure of reward-to-risk.

-

Before we get started let’s find the performance function we want to use from PerformanceAnalytics. Searching tq_performance_fun_options, we can see that SharpeRatio is available. Type ?SharpeRatio, and we can see that the arguments are:

-
-args(SharpeRatio)
-
## function (R, Rf = 0, p = 0.95, FUN = c("StdDev", "VaR", "ES"), 
-##     weights = NULL, annualize = FALSE, SE = FALSE, SE.control = NULL, 
-##     ...) 
-## NULL
-

We can actually skip the baseline path because the function does not require Rb. The function takes R, which is passed using Ra in tq_performance(Ra, Rb, performance_fun, ...). A little bit of foresight saves us some work.

-
-

Step 1A: Get stock prices -

-

Use tq_get() to get stock prices.

-
-stock_prices <- c("AAPL", "GOOG", "NFLX") %>%
-    tq_get(get  = "stock.prices",
-           from = "2010-01-01",
-           to   = "2015-12-31")
-stock_prices
-
## # A tibble: 4,527 × 8
-##    symbol date        open  high   low close    volume adjusted
-##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl>
-##  1 AAPL   2010-01-04  7.62  7.66  7.58  7.64 493729600     6.55
-##  2 AAPL   2010-01-05  7.66  7.70  7.62  7.66 601904800     6.56
-##  3 AAPL   2010-01-06  7.66  7.69  7.53  7.53 552160000     6.46
-##  4 AAPL   2010-01-07  7.56  7.57  7.47  7.52 477131200     6.45
-##  5 AAPL   2010-01-08  7.51  7.57  7.47  7.57 447610800     6.49
-##  6 AAPL   2010-01-11  7.6   7.61  7.44  7.50 462229600     6.43
-##  7 AAPL   2010-01-12  7.47  7.49  7.37  7.42 594459600     6.36
-##  8 AAPL   2010-01-13  7.42  7.53  7.29  7.52 605892000     6.45
-##  9 AAPL   2010-01-14  7.50  7.52  7.46  7.48 432894000     6.41
-## 10 AAPL   2010-01-15  7.53  7.56  7.35  7.35 594067600     6.31
-## # … with 4,517 more rows
-
-
-

Step 2A: Mutate to returns -

-

Using the tidyverse split, apply, combine framework, we can mutate groups of stocks by first “grouping” with group_by and then applying a mutating function using tq_transmute. We use the quantmod function periodReturn as the mutating function. We pass along the arguments period = "monthly" to return the results in monthly periodicity. Last, we use the col_rename argument to rename the output column.

-
-stock_returns_monthly <- stock_prices %>%
-    group_by(symbol) %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = periodReturn, 
-                 period     = "monthly", 
-                 col_rename = "Ra")
-stock_returns_monthly
-
## # A tibble: 216 × 3
-## # Groups:   symbol [3]
-##    symbol date            Ra
-##    <chr>  <date>       <dbl>
-##  1 AAPL   2010-01-29 -0.103 
-##  2 AAPL   2010-02-26  0.0654
-##  3 AAPL   2010-03-31  0.148 
-##  4 AAPL   2010-04-30  0.111 
-##  5 AAPL   2010-05-28 -0.0161
-##  6 AAPL   2010-06-30 -0.0208
-##  7 AAPL   2010-07-30  0.0227
-##  8 AAPL   2010-08-31 -0.0550
-##  9 AAPL   2010-09-30  0.167 
-## 10 AAPL   2010-10-29  0.0607
-## # … with 206 more rows
-
-
-

Step 3A: Aggregate to Portfolio Returns (Skipped) -

-

Step 3A can be skipped because we are only interested in the Sharpe Ratio for individual stocks (not a portfolio).

-

Step 3B can also be skipped because the SharpeRatio function from PerformanceAnalytics does not require a baseline.

-
-
-

Step 4: Analyze Performance -

-

The last step is to apply the SharpeRatio function to our groups of stock returns. We do this using tq_performance() with the arguments Ra = Ra, Rb = NULL (not required), and performance_fun = SharpeRatio. We can also pass other arguments of the SharpeRatio function such as Rf, p, FUN, and annualize. We will just use the defaults for this example.

-
-stock_returns_monthly %>%
-    tq_performance(
-        Ra = Ra, 
-        Rb = NULL, 
-        performance_fun = SharpeRatio
-    )
-
## # A tibble: 3 × 4
-## # Groups:   symbol [3]
-##   symbol `ESSharpe(Rf=0%,p=95%)` `StdDevSharpe(Rf=0%,p=95%)` `VaRSharpe(Rf=0%,p…
-##   <chr>                    <dbl>                       <dbl>               <dbl>
-## 1 AAPL                     0.173                       0.292               0.218
-## 2 GOOG                     0.129                       0.203               0.157
-## 3 NFLX                     0.237                       0.284               0.272
-

Now we have the Sharpe Ratio for each of the three stocks. What if we want to adjust the parameters of the function? We can just add on the arguments of the underlying function.

-
-stock_returns_monthly %>%
-    tq_performance(
-        Ra = Ra, 
-        Rb = NULL, 
-        performance_fun = SharpeRatio, 
-        Rf = 0.03 / 12, 
-        p  = 0.99
-    )
-
## # A tibble: 3 × 4
-## # Groups:   symbol [3]
-##   symbol `ESSharpe(Rf=0.2%,p=99%)` `StdDevSharpe(Rf=0.2%,… `VaRSharpe(Rf=0.2%,p…
-##   <chr>                      <dbl>                   <dbl>                 <dbl>
-## 1 AAPL                      0.116                    0.258                0.134 
-## 2 GOOG                      0.0826                   0.170                0.0998
-## 3 NFLX                      0.115                    0.272                0.142
-
-
-
-

3.2 Portfolios (Asset Groups) -

-

Portfolios are slightly more complicated because we are now dealing with groups of assets versus individual stocks, and we need to aggregate weighted returns. Fortunately, this is only one extra step with tidyquant using tq_portfolio().

-
-

Single Portfolio -

-

Let’s recreate the CAPM analysis in the “Quick Example” this time comparing a portfolio of technology stocks to the SPDR Technology ETF (XLK).

-
-

Steps 1A and 2A: Asset Period Returns -

-

This is the same as what we did previously to get the monthly returns for groups of individual stock prices. We use the split, apply, combine framework using the workflow of tq_get, group_by, and tq_transmute.

-
-stock_returns_monthly <- c("AAPL", "GOOG", "NFLX") %>%
-    tq_get(get  = "stock.prices",
-           from = "2010-01-01",
-           to   = "2015-12-31") %>%
-    group_by(symbol) %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = periodReturn, 
-                 period     = "monthly", 
-                 col_rename = "Ra")
-stock_returns_monthly
-
## # A tibble: 216 × 3
-## # Groups:   symbol [3]
-##    symbol date            Ra
-##    <chr>  <date>       <dbl>
-##  1 AAPL   2010-01-29 -0.103 
-##  2 AAPL   2010-02-26  0.0654
-##  3 AAPL   2010-03-31  0.148 
-##  4 AAPL   2010-04-30  0.111 
-##  5 AAPL   2010-05-28 -0.0161
-##  6 AAPL   2010-06-30 -0.0208
-##  7 AAPL   2010-07-30  0.0227
-##  8 AAPL   2010-08-31 -0.0550
-##  9 AAPL   2010-09-30  0.167 
-## 10 AAPL   2010-10-29  0.0607
-## # … with 206 more rows
-
-
-

Steps 1B and 2B: Baseline Period Returns -

-

This was also done previously.

-
-baseline_returns_monthly <- "XLK" %>%
-    tq_get(get  = "stock.prices",
-           from = "2010-01-01",
-           to   = "2015-12-31") %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = periodReturn, 
-                 period     = "monthly", 
-                 col_rename = "Rb")
-baseline_returns_monthly
-
## # A tibble: 72 × 2
-##    date            Rb
-##    <date>       <dbl>
-##  1 2010-01-29 -0.0993
-##  2 2010-02-26  0.0348
-##  3 2010-03-31  0.0684
-##  4 2010-04-30  0.0126
-##  5 2010-05-28 -0.0748
-##  6 2010-06-30 -0.0540
-##  7 2010-07-30  0.0745
-##  8 2010-08-31 -0.0561
-##  9 2010-09-30  0.117 
-## 10 2010-10-29  0.0578
-## # … with 62 more rows
-
-
-

Step 3A: Aggregate to Portfolio Period Returns -

-

The tidyquant function, tq_portfolio() aggregates a group of individual assets into a single return using a weighted composition of the underlying assets. To do this we need to first develop portfolio weights. There are two ways to do this for a single portfolio:

-
    -
  1. Supplying a vector of weights
  2. -
  3. Supplying a two column tidy data frame (tibble) with stock symbols in the first column and weights to map in the second.
  4. -
-

Suppose we want to split our portfolio evenly between AAPL and NFLX. We’ll show this using both methods.

-
-
Method 1: Aggregating a Portfolio using Vector of Weights -
-

We’ll use the weight vector, c(0.5, 0, 0.5). Two important aspects to supplying a numeric vector of weights: First, notice that the length (3) is equal to the number of assets (3). This is a requirement. Second, notice that the sum of the weighting vector is equal to 1. This is not “required”, but is best practice. If the sum is not 1, the weights will be distributed accordingly by scaling the vector to 1, and a warning message will appear.

-
-wts <- c(0.5, 0.0, 0.5)
-portfolio_returns_monthly <- stock_returns_monthly %>%
-    tq_portfolio(assets_col  = symbol, 
-                 returns_col = Ra, 
-                 weights     = wts, 
-                 col_rename  = "Ra")
-portfolio_returns_monthly
-
## # A tibble: 72 × 2
-##    date            Ra
-##    <date>       <dbl>
-##  1 2010-01-29  0.0307
-##  2 2010-02-26  0.0629
-##  3 2010-03-31  0.130 
-##  4 2010-04-30  0.239 
-##  5 2010-05-28  0.0682
-##  6 2010-06-30 -0.0219
-##  7 2010-07-30 -0.0272
-##  8 2010-08-31  0.116 
-##  9 2010-09-30  0.251 
-## 10 2010-10-29  0.0674
-## # … with 62 more rows
-

We now have an aggregated portfolio that is a 50/50 blend of AAPL and NFLX.

-

You may be asking why didn’t we use GOOG? The important thing to understand is that all of the assets from the asset returns don’t need to be used when creating the portfolio! This enables us to scale individual stock returns and then vary weights to optimize the portfolio (this will be a further subject that we address in the future!)

-
-
-
Method 2: Aggregating a Portfolio using Two Column Tibble with Symbols and Weights -
-

A possibly more useful method of aggregating returns is using a tibble of symbols and weights that are mapped to the portfolio. We’ll recreate the previous portfolio example using mapped weights.

-
-wts_map <- tibble(
-    symbols = c("AAPL", "NFLX"),
-    weights = c(0.5, 0.5)
-)
-wts_map
-
## # A tibble: 2 × 2
-##   symbols weights
-##   <chr>     <dbl>
-## 1 AAPL        0.5
-## 2 NFLX        0.5
-

Next, supply this two column tibble, with symbols in the first column and weights in the second, to the weights argument in tq_performance().

-
-stock_returns_monthly %>%
-    tq_portfolio(assets_col  = symbol, 
-                 returns_col = Ra, 
-                 weights     = wts_map, 
-                 col_rename  = "Ra_using_wts_map")
-
## # A tibble: 72 × 2
-##    date       Ra_using_wts_map
-##    <date>                <dbl>
-##  1 2010-01-29           0.0307
-##  2 2010-02-26           0.0629
-##  3 2010-03-31           0.130 
-##  4 2010-04-30           0.239 
-##  5 2010-05-28           0.0682
-##  6 2010-06-30          -0.0219
-##  7 2010-07-30          -0.0272
-##  8 2010-08-31           0.116 
-##  9 2010-09-30           0.251 
-## 10 2010-10-29           0.0674
-## # … with 62 more rows
-

The aggregated returns are exactly the same. The advantage with this method is that not all symbols need to be specified. Any symbol not specified by default gets a weight of zero.

-

Now, imagine if you had an entire index, such as the Russell 2000, of 2000 individual stock returns in a nice tidy data frame. It would be very easy to adjust portfolios and compute blended returns, and you only need to supply the symbols that you want to blend. All other symbols default to zero!

-
-
-
-

Step 3B: Merging Ra and Rb -

-

Now that we have the aggregated portfolio returns (“Ra”) from Step 3A and the baseline returns (“Rb”) from Step 2B, we can merge to get our consolidated table of asset and baseline returns. Nothing new here.

-
-RaRb_single_portfolio <- left_join(portfolio_returns_monthly, 
-                                   baseline_returns_monthly,
-                                   by = "date")
-RaRb_single_portfolio
-
## # A tibble: 72 × 3
-##    date            Ra      Rb
-##    <date>       <dbl>   <dbl>
-##  1 2010-01-29  0.0307 -0.0993
-##  2 2010-02-26  0.0629  0.0348
-##  3 2010-03-31  0.130   0.0684
-##  4 2010-04-30  0.239   0.0126
-##  5 2010-05-28  0.0682 -0.0748
-##  6 2010-06-30 -0.0219 -0.0540
-##  7 2010-07-30 -0.0272  0.0745
-##  8 2010-08-31  0.116  -0.0561
-##  9 2010-09-30  0.251   0.117 
-## 10 2010-10-29  0.0674  0.0578
-## # … with 62 more rows
-
-
-

Step 4: Computing the CAPM Table -

-

The CAPM table is computed with the function table.CAPM from PerformanceAnalytics. We just perform the same task that we performed in the “Quick Example”.

-
-RaRb_single_portfolio %>%
-    tq_performance(Ra = Ra, Rb = Rb, performance_fun = table.CAPM)
-
## # A tibble: 1 × 12
-##   ActivePremium  Alpha AnnualizedAlpha  Beta `Beta-` `Beta+` Correlation
-##           <dbl>  <dbl>           <dbl> <dbl>   <dbl>   <dbl>       <dbl>
-## 1         0.327 0.0299           0.425 0.754  -0.243   0.503       0.283
-## # … with 5 more variables: Correlationp-value <dbl>, InformationRatio <dbl>,
-## #   R-squared <dbl>, TrackingError <dbl>, TreynorRatio <dbl>
-

Now we have the CAPM performance metrics for a portfolio! While this is cool, it’s cooler to do multiple portfolios. Let’s see how.

-
-
-
-

Multiple Portfolios -

-

Once you understand the process for a single portfolio using Step 3A, Method 2 (aggregating weights by mapping), scaling to multiple portfolios is just building on this concept. Let’s recreate the same example from the “Single Portfolio” Example this time with three portfolios:

-
    -
  1. 50% AAPL, 25% GOOG, 25% NFLX
  2. -
  3. 25% AAPL, 50% GOOG, 25% NFLX
  4. -
  5. 25% AAPL, 25% GOOG, 50% NFLX
  6. -
-
-

Steps 1 and 2 are the Exact Same as the Single Portfolio Example -

-

First, get individual asset returns grouped by asset, which is the exact same as Steps 1A and 1B from the Single Portfolio example.

-
-stock_returns_monthly <- c("AAPL", "GOOG", "NFLX") %>%
-    tq_get(get  = "stock.prices",
-           from = "2010-01-01",
-           to   = "2015-12-31") %>%
-    group_by(symbol) %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = periodReturn, 
-                 period     = "monthly", 
-                 col_rename = "Ra")
-

Second, get baseline asset returns, which is the exact same as Steps 1B and 2B from the Single Portfolio example.

-
-baseline_returns_monthly <- "XLK" %>%
-    tq_get(get  = "stock.prices",
-           from = "2010-01-01",
-           to   = "2015-12-31") %>%
-    tq_transmute(select     = adjusted, 
-                 mutate_fun = periodReturn, 
-                 period     = "monthly", 
-                 col_rename = "Rb")
-
-
-

Step 3A: Aggregate Portfolio Returns for Multiple Portfolios -

-

This is where it gets fun. If you picked up on Single Portfolio, Step3A, Method 2 (mapping weights), this is just an extension for multiple portfolios.

-

First, we need to grow our portfolios. tidyquant has a handy, albeit simple, function, tq_repeat_df(), for scaling a single portfolio to many. It takes a data frame, and the number of repeats, n, and the index_col_name, which adds a sequential index. Let’s see how it works for our example. We need three portfolios:

-
-stock_returns_monthly_multi <- stock_returns_monthly %>%
-    tq_repeat_df(n = 3)
-stock_returns_monthly_multi
-
## # A tibble: 648 × 4
-## # Groups:   portfolio [3]
-##    portfolio symbol date            Ra
-##        <int> <chr>  <date>       <dbl>
-##  1         1 AAPL   2010-01-29 -0.103 
-##  2         1 AAPL   2010-02-26  0.0654
-##  3         1 AAPL   2010-03-31  0.148 
-##  4         1 AAPL   2010-04-30  0.111 
-##  5         1 AAPL   2010-05-28 -0.0161
-##  6         1 AAPL   2010-06-30 -0.0208
-##  7         1 AAPL   2010-07-30  0.0227
-##  8         1 AAPL   2010-08-31 -0.0550
-##  9         1 AAPL   2010-09-30  0.167 
-## 10         1 AAPL   2010-10-29  0.0607
-## # … with 638 more rows
-

Examining the results, we can see that a few things happened:

-
    -
  1. The length (number of rows) has tripled. This is the essence of tq_repeat_df: it grows the data frame length-wise, repeating the data frame n times. In our case, n = 3.
  2. -
  3. Our data frame, which was grouped by symbol, was ungrouped. This is needed to prevent tq_portfolio from blending on the individual stocks. tq_portfolio only works on groups of stocks.
  4. -
  5. We have a new column, named “portfolio”. The “portfolio” column name is a key that tells tq_portfolio that multiple groups exist to analyze. Just note that for multiple portfolio analysis, the “portfolio” column name is required.
  6. -
  7. We have three groups of portfolios. This is what tq_portfolio will split, apply (aggregate), then combine on.
  8. -
-

Now the tricky part: We need a new table of weights to map on. There’s a few requirements:

-
    -
  1. We must supply a three column tibble with the following columns: “portfolio”, asset, and weight in that order.
  2. -
  3. The “portfolio” column must be named “portfolio” since this is a key name for mapping.
  4. -
  5. The tibble must be grouped by the portfolio column.
  6. -
-

Here’s what the weights table should look like for our example:

-
-weights <- c(
-    0.50, 0.25, 0.25,
-    0.25, 0.50, 0.25,
-    0.25, 0.25, 0.50
-)
-stocks <- c("AAPL", "GOOG", "NFLX")
-weights_table <-  tibble(stocks) %>%
-    tq_repeat_df(n = 3) %>%
-    bind_cols(tibble(weights)) %>%
-    group_by(portfolio)
-weights_table
-
## # A tibble: 9 × 3
-## # Groups:   portfolio [3]
-##   portfolio stocks weights
-##       <int> <chr>    <dbl>
-## 1         1 AAPL      0.5 
-## 2         1 GOOG      0.25
-## 3         1 NFLX      0.25
-## 4         2 AAPL      0.25
-## 5         2 GOOG      0.5 
-## 6         2 NFLX      0.25
-## 7         3 AAPL      0.25
-## 8         3 GOOG      0.25
-## 9         3 NFLX      0.5
-

Now just pass the the expanded stock_returns_monthly_multi and the weights_table to tq_portfolio for portfolio aggregation.

-
-portfolio_returns_monthly_multi <- stock_returns_monthly_multi %>%
-    tq_portfolio(assets_col  = symbol, 
-                 returns_col = Ra, 
-                 weights     = weights_table, 
-                 col_rename  = "Ra")
-portfolio_returns_monthly_multi
-
## # A tibble: 216 × 3
-## # Groups:   portfolio [3]
-##    portfolio date              Ra
-##        <int> <date>         <dbl>
-##  1         1 2010-01-29 -0.0489  
-##  2         1 2010-02-26  0.0482  
-##  3         1 2010-03-31  0.123   
-##  4         1 2010-04-30  0.145   
-##  5         1 2010-05-28  0.0245  
-##  6         1 2010-06-30 -0.0308  
-##  7         1 2010-07-30  0.000600
-##  8         1 2010-08-31  0.0474  
-##  9         1 2010-09-30  0.222   
-## 10         1 2010-10-29  0.0789  
-## # … with 206 more rows
-

Let’s assess the output. We now have a single, “long” format data frame of portfolio returns. It has three groups with the aggregated portfolios blended by mapping the weight_table.

-
-
-

Steps 3B and 4: Merging and Assessing Performance -

-

These steps are the exact same as the Single Portfolio example.

-

First, we merge with the baseline using “date” as the key.

-
-RaRb_multiple_portfolio <- left_join(portfolio_returns_monthly_multi, 
-                                     baseline_returns_monthly,
-                                     by = "date")
-RaRb_multiple_portfolio
-
## # A tibble: 216 × 4
-## # Groups:   portfolio [3]
-##    portfolio date              Ra      Rb
-##        <int> <date>         <dbl>   <dbl>
-##  1         1 2010-01-29 -0.0489   -0.0993
-##  2         1 2010-02-26  0.0482    0.0348
-##  3         1 2010-03-31  0.123     0.0684
-##  4         1 2010-04-30  0.145     0.0126
-##  5         1 2010-05-28  0.0245   -0.0748
-##  6         1 2010-06-30 -0.0308   -0.0540
-##  7         1 2010-07-30  0.000600  0.0745
-##  8         1 2010-08-31  0.0474   -0.0561
-##  9         1 2010-09-30  0.222     0.117 
-## 10         1 2010-10-29  0.0789    0.0578
-## # … with 206 more rows
-

Finally, we calculate the performance of each of the portfolios using tq_performance. Make sure the data frame is grouped on “portfolio”.

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra = Ra, Rb = Rb, performance_fun = table.CAPM)
-
## # A tibble: 3 × 13
-## # Groups:   portfolio [3]
-##   portfolio ActivePremium  Alpha AnnualizedAlpha  Beta `Beta-` `Beta+`
-##       <int>         <dbl>  <dbl>           <dbl> <dbl>   <dbl>   <dbl>
-## 1         1         0.231 0.0193           0.258 0.908   0.312   0.741
-## 2         2         0.219 0.0192           0.256 0.886   0.436   0.660
-## 3         3         0.319 0.0308           0.439 0.721  -0.179   0.394
-## # … with 6 more variables: Correlation <dbl>, Correlationp-value <dbl>,
-## #   InformationRatio <dbl>, R-squared <dbl>, TrackingError <dbl>,
-## #   TreynorRatio <dbl>
-

Inspecting the results, we now have a multiple portfolio comparison of the CAPM table from PerformanceAnalytics. We can do the same thing with SharpeRatio as well.

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra = Ra, Rb = NULL, performance_fun = SharpeRatio)
-
## # A tibble: 3 × 4
-## # Groups:   portfolio [3]
-##   portfolio `ESSharpe(Rf=0%,p=95%)` `StdDevSharpe(Rf=0%,p=95%)` `VaRSharpe(Rf=0…
-##       <int>                   <dbl>                       <dbl>            <dbl>
-## 1         1                   0.172                       0.355            0.263
-## 2         2                   0.146                       0.334            0.236
-## 3         3                   0.150                       0.317            0.238
-
-
-
-
-
-

4.0 Available Functions -

-

We’ve only scratched the surface of the analysis functions available through PerformanceAnalytics. The list below includes all of the compatible functions grouped by function type. The table functions are the most useful to get a cross section of metrics. We’ll touch on a few. We’ll also go over VaR and SharpeRatio as these are very commonly used as performance measures.

- -
## $table.funs
-##  [1] "table.AnnualizedReturns" "table.Arbitrary"        
-##  [3] "table.Autocorrelation"   "table.CAPM"             
-##  [5] "table.CaptureRatios"     "table.Correlation"      
-##  [7] "table.Distributions"     "table.DownsideRisk"     
-##  [9] "table.DownsideRiskRatio" "table.DrawdownsRatio"   
-## [11] "table.HigherMoments"     "table.InformationRatio" 
-## [13] "table.RollingPeriods"    "table.SFM"              
-## [15] "table.SpecificRisk"      "table.Stats"            
-## [17] "table.TrailingPeriods"   "table.UpDownRatios"     
-## [19] "table.Variability"      
-## 
-## $CAPM.funs
-##  [1] "CAPM.alpha"       "CAPM.beta"        "CAPM.beta.bear"   "CAPM.beta.bull"  
-##  [5] "CAPM.CML"         "CAPM.CML.slope"   "CAPM.dynamic"     "CAPM.epsilon"    
-##  [9] "CAPM.jensenAlpha" "CAPM.RiskPremium" "CAPM.SML.slope"   "TimingRatio"     
-## [13] "MarketTiming"    
-## 
-## $SFM.funs
-## [1] "SFM.alpha"       "SFM.beta"        "SFM.CML"         "SFM.CML.slope"  
-## [5] "SFM.dynamic"     "SFM.epsilon"     "SFM.jensenAlpha"
-## 
-## $descriptive.funs
-## [1] "mean"           "sd"             "min"            "max"           
-## [5] "cor"            "mean.geometric" "mean.stderr"    "mean.LCL"      
-## [9] "mean.UCL"      
-## 
-## $annualized.funs
-## [1] "Return.annualized"        "Return.annualized.excess"
-## [3] "sd.annualized"            "SharpeRatio.annualized"  
-## 
-## $VaR.funs
-## [1] "VaR"  "ES"   "ETL"  "CDD"  "CVaR"
-## 
-## $moment.funs
-##  [1] "var"              "cov"              "skewness"         "kurtosis"        
-##  [5] "CoVariance"       "CoSkewness"       "CoSkewnessMatrix" "CoKurtosis"      
-##  [9] "CoKurtosisMatrix" "M3.MM"            "M4.MM"            "BetaCoVariance"  
-## [13] "BetaCoSkewness"   "BetaCoKurtosis"  
-## 
-## $drawdown.funs
-## [1] "AverageDrawdown"   "AverageLength"     "AverageRecovery"  
-## [4] "DrawdownDeviation" "DrawdownPeak"      "maxDrawdown"      
-## 
-## $Bacon.risk.funs
-## [1] "MeanAbsoluteDeviation" "Frequency"             "SharpeRatio"          
-## [4] "MSquared"              "MSquaredExcess"        "HurstIndex"           
-## 
-## $Bacon.regression.funs
-##  [1] "CAPM.alpha"       "CAPM.beta"        "CAPM.epsilon"     "CAPM.jensenAlpha"
-##  [5] "SystematicRisk"   "SpecificRisk"     "TotalRisk"        "TreynorRatio"    
-##  [9] "AppraisalRatio"   "FamaBeta"         "Selectivity"      "NetSelectivity"  
-## 
-## $Bacon.relative.risk.funs
-## [1] "ActivePremium"    "ActiveReturn"     "TrackingError"    "InformationRatio"
-## 
-## $Bacon.drawdown.funs
-## [1] "PainIndex"     "PainRatio"     "CalmarRatio"   "SterlingRatio"
-## [5] "BurkeRatio"    "MartinRatio"   "UlcerIndex"   
-## 
-## $Bacon.downside.risk.funs
-##  [1] "DownsideDeviation"     "DownsidePotential"     "DownsideFrequency"    
-##  [4] "SemiDeviation"         "SemiVariance"          "UpsideRisk"           
-##  [7] "UpsidePotentialRatio"  "UpsideFrequency"       "BernardoLedoitRatio"  
-## [10] "DRatio"                "Omega"                 "OmegaSharpeRatio"     
-## [13] "OmegaExcessReturn"     "SortinoRatio"          "M2Sortino"            
-## [16] "Kappa"                 "VolatilitySkewness"    "AdjustedSharpeRatio"  
-## [19] "SkewnessKurtosisRatio" "ProspectRatio"        
-## 
-## $misc.funs
-## [1] "KellyRatio"   "Modigliani"   "UpDownRatios"
-
-

4.1 table.Stats -

-

Returns a basic set of statistics that match the period of the data passed in (e.g., monthly returns will get monthly statistics, daily will be daily stats, and so on).

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra = Ra, Rb = NULL, performance_fun = table.Stats)
-
## # A tibble: 3 × 17
-## # Groups:   portfolio [3]
-##   portfolio ArithmeticMean GeometricMean Kurtosis `LCLMean(0.95)` Maximum Median
-##       <int>          <dbl>         <dbl>    <dbl>           <dbl>   <dbl>  <dbl>
-## 1         1         0.0293        0.0259     1.14          0.0099   0.222 0.0307
-## 2         2         0.029         0.0252     1.65          0.0086   0.227 0.037 
-## 3         3         0.0388        0.0313     1.81          0.01     0.370 0.046 
-## # … with 10 more variables: Minimum <dbl>, NAs <dbl>, Observations <dbl>,
-## #   Quartile1 <dbl>, Quartile3 <dbl>, SEMean <dbl>, Skewness <dbl>,
-## #   Stdev <dbl>, UCLMean(0.95) <dbl>, Variance <dbl>
-
-
-

4.2 table.CAPM -

-

Takes a set of returns and relates them to a benchmark return. Provides a set of measures related to an excess return single factor model, or CAPM.

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra = Ra, Rb = Rb, performance_fun = table.CAPM)
-
## # A tibble: 3 × 13
-## # Groups:   portfolio [3]
-##   portfolio ActivePremium  Alpha AnnualizedAlpha  Beta `Beta-` `Beta+`
-##       <int>         <dbl>  <dbl>           <dbl> <dbl>   <dbl>   <dbl>
-## 1         1         0.231 0.0193           0.258 0.908   0.312   0.741
-## 2         2         0.219 0.0192           0.256 0.886   0.436   0.660
-## 3         3         0.319 0.0308           0.439 0.721  -0.179   0.394
-## # … with 6 more variables: Correlation <dbl>, Correlationp-value <dbl>,
-## #   InformationRatio <dbl>, R-squared <dbl>, TrackingError <dbl>,
-## #   TreynorRatio <dbl>
-
-
-

4.3 table.AnnualizedReturns -

-

Table of Annualized Return, Annualized Std Dev, and Annualized Sharpe.

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra = Ra, Rb = NULL, performance_fun = table.AnnualizedReturns)
-
## # A tibble: 3 × 4
-## # Groups:   portfolio [3]
-##   portfolio AnnualizedReturn `AnnualizedSharpe(Rf=0%)` AnnualizedStdDev
-##       <int>            <dbl>                     <dbl>            <dbl>
-## 1         1            0.360                      1.26            0.286
-## 2         2            0.348                      1.16            0.301
-## 3         3            0.448                      1.06            0.424
-
-
-

4.4 table.Correlation -

-

This is a wrapper for calculating correlation and significance against each column of the data provided.

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra = Ra, Rb = Rb, performance_fun = table.Correlation)
-
## # A tibble: 3 × 5
-## # Groups:   portfolio [3]
-##   portfolio `p-value` `Lower CI` `Upper CI` to.Rb
-##       <int>     <dbl>      <dbl>      <dbl> <dbl>
-## 1         1 0.0000284     0.270       0.634 0.472
-## 2         2 0.000122      0.229       0.608 0.438
-## 3         3 0.0325        0.0220      0.457 0.252
-
-
-

4.5 table.DownsideRisk -

-

Creates a table of estimates of downside risk measures for comparison across multiple instruments or funds.

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra = Ra, Rb = NULL, performance_fun = table.DownsideRisk)
-
## # A tibble: 3 × 12
-## # Groups:   portfolio [3]
-##   portfolio `DownsideDeviati… `DownsideDeviatio… `DownsideDeviati… GainDeviation
-##       <int>             <dbl>              <dbl>             <dbl>         <dbl>
-## 1         1            0.045              0.0488            0.045         0.0538
-## 2         2            0.0501             0.0538            0.0501        0.0528
-## 3         3            0.0684             0.0721            0.0684        0.0831
-## # … with 7 more variables: HistoricalES(95%) <dbl>, HistoricalVaR(95%) <dbl>,
-## #   LossDeviation <dbl>, MaximumDrawdown <dbl>, ModifiedES(95%) <dbl>,
-## #   ModifiedVaR(95%) <dbl>, SemiDeviation <dbl>
-
-
-

4.6 table.DownsideRiskRatio -

-

Table of Monthly downside risk, Annualized downside risk, Downside potential, Omega, Sortino ratio, Upside potential, Upside potential ratio and Omega-Sharpe ratio.

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra = Ra, Rb = NULL, performance_fun = table.DownsideRiskRatio)
-
## # A tibble: 3 × 9
-## # Groups:   portfolio [3]
-##   portfolio Annualiseddownsiderisk Downsidepotential monthlydownsiderisk Omega
-##       <int>                  <dbl>             <dbl>               <dbl> <dbl>
-## 1         1                  0.156            0.0198              0.045   2.48
-## 2         2                  0.173            0.0217              0.0501  2.34
-## 3         3                  0.237            0.0294              0.0684  2.32
-## # … with 4 more variables: Omega-sharperatio <dbl>, Sortinoratio <dbl>,
-## #   Upsidepotential <dbl>, Upsidepotentialratio <dbl>
-
-
-

4.7 table.HigherMoments -

-

Summary of the higher moments and Co-Moments of the return distribution. Used to determine diversification potential. Also called “systematic” moments by several papers.

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra = Ra, Rb = Rb, performance_fun = table.HigherMoments)
-
## # A tibble: 3 × 6
-## # Groups:   portfolio [3]
-##   portfolio BetaCoKurtosis BetaCoSkewness BetaCoVariance CoKurtosis CoSkewness
-##       <int>          <dbl>          <dbl>          <dbl>      <dbl>      <dbl>
-## 1         1          0.756          0.196          0.908          0          0
-## 2         2          0.772          1.71           0.886          0          0
-## 3         3          0.455          0.369          0.721          0          0
-
-
-

4.8 table.InformationRatio -

-

Table of Tracking error, Annualized tracking error and Information ratio.

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra = Ra, Rb = Rb, performance_fun = table.InformationRatio)
-
## # A tibble: 3 × 4
-## # Groups:   portfolio [3]
-##   portfolio AnnualisedTrackingError InformationRatio TrackingError
-##       <int>                   <dbl>            <dbl>         <dbl>
-## 1         1                   0.252            0.917        0.0728
-## 2         2                   0.271            0.809        0.0782
-## 3         3                   0.412            0.774        0.119
-
-
-

4.9 table.Variability -

-

Table of Mean absolute difference, Monthly standard deviation and annualized standard deviation.

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra = Ra, Rb = NULL, performance_fun = table.Variability)
-
## # A tibble: 3 × 4
-## # Groups:   portfolio [3]
-##   portfolio AnnualizedStdDev MeanAbsolutedeviation monthlyStdDev
-##       <int>            <dbl>                 <dbl>         <dbl>
-## 1         1            0.286                0.0658        0.0825
-## 2         2            0.301                0.0679        0.0868
-## 3         3            0.424                0.091         0.122
-
-
-

4.10 VaR -

-

Calculates Value-at-Risk (VaR) for univariate, component, and marginal cases using a variety of analytical methods.

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra = Ra, Rb = NULL, performance_fun = VaR)
-
## # A tibble: 3 × 2
-## # Groups:   portfolio [3]
-##   portfolio    VaR
-##       <int>  <dbl>
-## 1         1 -0.111
-## 2         2 -0.123
-## 3         3 -0.163
-
-
-

4.11 SharpeRatio -

-

The Sharpe ratio is simply the return per unit of risk (represented by variability). In the classic case, the unit of risk is the standard deviation of the returns.

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra = Ra, Rb = NULL, performance_fun = SharpeRatio)
-
## # A tibble: 3 × 4
-## # Groups:   portfolio [3]
-##   portfolio `ESSharpe(Rf=0%,p=95%)` `StdDevSharpe(Rf=0%,p=95%)` `VaRSharpe(Rf=0…
-##       <int>                   <dbl>                       <dbl>            <dbl>
-## 1         1                   0.172                       0.355            0.263
-## 2         2                   0.146                       0.334            0.236
-## 3         3                   0.150                       0.317            0.238
-
-
-
-

5.0 Customizing using the … -

-

One of the best features of tq_portfolio and tq_performance is to be able to pass features through to the underlying functions. After all, these are just wrappers for PerformanceAnalytics, so you probably want to be able to make full use of the underlying functions. Passing through parameters using the ... can be incredibly useful, so let’s see how.

-
-

5.1 Customizing tq_portfolio -

-

The tq_portfolio function is a wrapper for Return.portfolio. This means that during the portfolio aggregation process, we can make use of most of the Return.portfolio arguments such as wealth.index, contribution, geometric, rebalance_on, and value. Here’s the arguments of the underlying function:

-
-args(Return.portfolio)
-
## function (R, weights = NULL, wealth.index = FALSE, contribution = FALSE, 
-##     geometric = TRUE, rebalance_on = c(NA, "years", "quarters", 
-##         "months", "weeks", "days"), value = 1, verbose = FALSE, 
-##     ...) 
-## NULL
-

Let’s see an example of passing parameters to the .... Suppose we want to instead see how our money is grows for a $10,000 investment. We’ll use the “Single Portfolio” example, where our portfolio mix was 50% AAPL, 0% GOOG, and 50% NFLX.

-

Method 3A, Aggregating Portfolio Returns, showed us two methods to aggregate for a single portfolio. Either will work for this example. For simplicity, we’ll examine the first.

-

Here’s the original output, without adjusting parameters.

-
-wts <- c(0.5, 0.0, 0.5)
-portfolio_returns_monthly <- stock_returns_monthly %>%
-    tq_portfolio(assets_col  = symbol, 
-                 returns_col = Ra, 
-                 weights     = wts, 
-                 col_rename  = "Ra")
-
-portfolio_returns_monthly %>%
-    ggplot(aes(x = date, y = Ra)) +
-    geom_bar(stat = "identity", fill = palette_light()[[1]]) +
-    labs(title = "Portfolio Returns",
-         subtitle = "50% AAPL, 0% GOOG, and 50% NFLX",
-         caption = "Shows an above-zero trend meaning positive returns",
-         x = "", y = "Monthly Returns") +
-    geom_smooth(method = "lm") +
-    theme_tq() +
-    scale_color_tq() +
-    scale_y_continuous(labels = scales::percent)
-

-

This is good, but we want to see how our $10,000 initial investment is growing. This is simple with the underlying Return.portfolio argument, wealth.index = TRUE. All we need to do is add these as additional parameters to tq_portfolio!

-
-wts <- c(0.5, 0, 0.5)
-portfolio_growth_monthly <- stock_returns_monthly %>%
-    tq_portfolio(assets_col   = symbol, 
-                 returns_col  = Ra, 
-                 weights      = wts, 
-                 col_rename   = "investment.growth",
-                 wealth.index = TRUE) %>%
-    mutate(investment.growth = investment.growth * 10000)
-
-portfolio_growth_monthly %>%
-    ggplot(aes(x = date, y = investment.growth)) +
-    geom_line(size = 2, color = palette_light()[[1]]) +
-    labs(title = "Portfolio Growth",
-         subtitle = "50% AAPL, 0% GOOG, and 50% NFLX",
-         caption = "Now we can really visualize performance!",
-         x = "", y = "Portfolio Value") +
-    geom_smooth(method = "loess") +
-    theme_tq() +
-    scale_color_tq() +
-    scale_y_continuous(labels = scales::dollar)
-

-

Finally, taking this one step further, we apply the same process to the “Multiple Portfolio” example:

-
    -
  1. 50% AAPL, 25% GOOG, 25% NFLX
  2. -
  3. 25% AAPL, 50% GOOG, 25% NFLX
  4. -
  5. 25% AAPL, 25% GOOG, 50% NFLX
  6. -
-
-portfolio_growth_monthly_multi <- stock_returns_monthly_multi %>%
-    tq_portfolio(assets_col   = symbol, 
-                 returns_col  = Ra, 
-                 weights      = weights_table, 
-                 col_rename   = "investment.growth",
-                 wealth.index = TRUE) %>%
-    mutate(investment.growth = investment.growth * 10000)
-
-portfolio_growth_monthly_multi %>%
-    ggplot(aes(x = date, y = investment.growth, color = factor(portfolio))) +
-    geom_line(size = 2) +
-    labs(title = "Portfolio Growth",
-         subtitle = "Comparing Multiple Portfolios",
-         caption = "Portfolio 3 is a Standout!",
-         x = "", y = "Portfolio Value",
-         color = "Portfolio") +
-    geom_smooth(method = "loess") +
-    theme_tq() +
-    scale_color_tq() +
-    scale_y_continuous(labels = scales::dollar)
-

-
-
-

5.2 Customizing tq_performance -

-

Finally, the same concept of passing arguments works with all the tidyquant functions that are wrappers including tq_transmute, tq_mutate, tq_performance, etc. Let’s use a final example with the SharpeRatio, which has the following arguments.

-
-args(SharpeRatio)
-
## function (R, Rf = 0, p = 0.95, FUN = c("StdDev", "VaR", "ES"), 
-##     weights = NULL, annualize = FALSE, SE = FALSE, SE.control = NULL, 
-##     ...) 
-## NULL
-

We can see that the parameters Rf allows us to apply a risk-free rate and p allows us to vary the confidence interval. Let’s compare the Sharpe ratio with an annualized risk-free rate of 3% and a confidence interval of 0.99.

-

Default:

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra              = Ra, 
-                   performance_fun = SharpeRatio)
-
## # A tibble: 3 × 4
-## # Groups:   portfolio [3]
-##   portfolio `ESSharpe(Rf=0%,p=95%)` `StdDevSharpe(Rf=0%,p=95%)` `VaRSharpe(Rf=0…
-##       <int>                   <dbl>                       <dbl>            <dbl>
-## 1         1                   0.172                       0.355            0.263
-## 2         2                   0.146                       0.334            0.236
-## 3         3                   0.150                       0.317            0.238
-

With Rf = 0.03 / 12 (adjusted for monthly periodicity):

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra              = Ra, 
-                   performance_fun = SharpeRatio,
-                   Rf              = 0.03 / 12)
-
## # A tibble: 3 × 4
-## # Groups:   portfolio [3]
-##   portfolio `ESSharpe(Rf=0.2%,p=95%)` `StdDevSharpe(Rf=0.2%… `VaRSharpe(Rf=0.2%…
-##       <int>                     <dbl>                  <dbl>               <dbl>
-## 1         1                     0.157                  0.325               0.241
-## 2         2                     0.134                  0.305               0.216
-## 3         3                     0.141                  0.296               0.222
-

And, with both Rf = 0.03 / 12 (adjusted for monthly periodicity) and p = 0.99:

-
-RaRb_multiple_portfolio %>%
-    tq_performance(Ra              = Ra, 
-                   performance_fun = SharpeRatio,
-                   Rf              = 0.03 / 12, 
-                   p               = 0.99)
-
## # A tibble: 3 × 4
-## # Groups:   portfolio [3]
-##   portfolio `ESSharpe(Rf=0.2%,p=99%)` `StdDevSharpe(Rf=0.2%… `VaRSharpe(Rf=0.2%…
-##       <int>                     <dbl>                  <dbl>               <dbl>
-## 1         1                    0.105                   0.325               0.134
-## 2         2                    0.0952                  0.305               0.115
-## 3         3                    0.0915                  0.296               0.117
-
-
-
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.1.

-
- -
-
- - - - - - - - diff --git a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-44-1.png b/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-44-1.png deleted file mode 100644 index f2956baa..00000000 Binary files a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-44-1.png and /dev/null differ diff --git a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-45-1.png b/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-45-1.png deleted file mode 100644 index aea27170..00000000 Binary files a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-45-1.png and /dev/null differ diff --git a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-46-1.png b/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-46-1.png deleted file mode 100644 index 3058b256..00000000 Binary files a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-46-1.png and /dev/null differ diff --git a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-47-1.png b/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-47-1.png deleted file mode 100644 index 86749f35..00000000 Binary files a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-47-1.png and /dev/null differ diff --git a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-48-1.png b/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-48-1.png deleted file mode 100644 index e0d370ff..00000000 Binary files a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-48-1.png and /dev/null differ diff --git a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-49-1.png b/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-49-1.png deleted file mode 100644 index 1b161713..00000000 Binary files a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/figure-html/unnamed-chunk-49-1.png and /dev/null differ diff --git a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/header-attrs-2.1/header-attrs.js b/docs/articles/TQ05-performance-analysis-with-tidyquant_files/header-attrs-2.1/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/TQ05-performance-analysis-with-tidyquant_files/header-attrs-2.1/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/TQ06-excel-in-r.html b/docs/articles/TQ06-excel-in-r.html deleted file mode 100644 index 04be6194..00000000 --- a/docs/articles/TQ06-excel-in-r.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - -Excel in R - tidyquant 1.0.0 • tidyquant - - - - - - - - - - - - - -
-
- - - - -
-
- - - - -

New business and financial analysts are finding R every day. Most of these new userRs (R users) are coming from a non-programming background. They have ample domain experience in functions like finance, marketing, and business, but their tool of choice is Excel (or more recently Tableau & PowerBI).

-

Learning R can be a major hurdle. You need to learn data structures, algorithms, data science, machine learning, web applications with Shiny and more to be able to accomplish a basic dashboard. This is a BIG ASK for non-coders. This is the problem I aim to begin solving with the upcoming release of tidyquant v1.0.0. Read the updated “R for Excel Users” Tutorial on Business Science.

-

-

- R for Excel Users Tutorial -

-
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.1.

-
- -
-
- - - - - - - - diff --git a/docs/articles/TQ06-excel-in-r_files/header-attrs-2.1/header-attrs.js b/docs/articles/TQ06-excel-in-r_files/header-attrs-2.1/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/TQ06-excel-in-r_files/header-attrs-2.1/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/index.html b/docs/articles/index.html deleted file mode 100644 index f6941c09..00000000 --- a/docs/articles/index.html +++ /dev/null @@ -1,127 +0,0 @@ - -Articles • tidyquant - - -
-
- - - -
- - -
- -
-

Site built with pkgdown 2.0.1.

-
- -
- - - - - - - - diff --git a/docs/articles/perfomance_analysis_workflow.png b/docs/articles/perfomance_analysis_workflow.png deleted file mode 100644 index de67e5c7..00000000 Binary files a/docs/articles/perfomance_analysis_workflow.png and /dev/null differ diff --git a/docs/articles/r-for-excel-users.jpg b/docs/articles/r-for-excel-users.jpg deleted file mode 100644 index 6af500f3..00000000 Binary files a/docs/articles/r-for-excel-users.jpg and /dev/null differ diff --git a/docs/authors.html b/docs/authors.html deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css deleted file mode 100644 index 5a859415..00000000 --- a/docs/bootstrap-toc.css +++ /dev/null @@ -1,60 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ - -/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ - -/* All levels of nav */ -nav[data-toggle='toc'] .nav > li > a { - display: block; - padding: 4px 20px; - font-size: 13px; - font-weight: 500; - color: #767676; -} -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 19px; - color: #563d7c; - text-decoration: none; - background-color: transparent; - border-left: 1px solid #563d7c; -} -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 18px; - font-weight: bold; - color: #563d7c; - background-color: transparent; - border-left: 2px solid #563d7c; -} - -/* Nav: second level (shown on .active) */ -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} -nav[data-toggle='toc'] .nav .nav > li > a { - padding-top: 1px; - padding-bottom: 1px; - padding-left: 30px; - font-size: 12px; - font-weight: normal; -} -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 29px; -} -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 28px; - font-weight: 500; -} - -/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ -nav[data-toggle='toc'] .nav > .active > ul { - display: block; -} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js deleted file mode 100644 index 1cdd573b..00000000 --- a/docs/bootstrap-toc.js +++ /dev/null @@ -1,159 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ -(function() { - 'use strict'; - - window.Toc = { - helpers: { - // return all matching elements in the set, or their descendants - findOrFilter: function($el, selector) { - // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ - // http://stackoverflow.com/a/12731439/358804 - var $descendants = $el.find(selector); - return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); - }, - - generateUniqueIdBase: function(el) { - var text = $(el).text(); - var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); - return anchor || el.tagName.toLowerCase(); - }, - - generateUniqueId: function(el) { - var anchorBase = this.generateUniqueIdBase(el); - for (var i = 0; ; i++) { - var anchor = anchorBase; - if (i > 0) { - // add suffix - anchor += '-' + i; - } - // check if ID already exists - if (!document.getElementById(anchor)) { - return anchor; - } - } - }, - - generateAnchor: function(el) { - if (el.id) { - return el.id; - } else { - var anchor = this.generateUniqueId(el); - el.id = anchor; - return anchor; - } - }, - - createNavList: function() { - return $(''); - }, - - createChildNavList: function($parent) { - var $childList = this.createNavList(); - $parent.append($childList); - return $childList; - }, - - generateNavEl: function(anchor, text) { - var $a = $(''); - $a.attr('href', '#' + anchor); - $a.text(text); - var $li = $('
  • '); - $li.append($a); - return $li; - }, - - generateNavItem: function(headingEl) { - var anchor = this.generateAnchor(headingEl); - var $heading = $(headingEl); - var text = $heading.data('toc-text') || $heading.text(); - return this.generateNavEl(anchor, text); - }, - - // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). - getTopLevel: function($scope) { - for (var i = 1; i <= 6; i++) { - var $headings = this.findOrFilter($scope, 'h' + i); - if ($headings.length > 1) { - return i; - } - } - - return 1; - }, - - // returns the elements for the top level, and the next below it - getHeadings: function($scope, topLevel) { - var topSelector = 'h' + topLevel; - - var secondaryLevel = topLevel + 1; - var secondarySelector = 'h' + secondaryLevel; - - return this.findOrFilter($scope, topSelector + ',' + secondarySelector); - }, - - getNavLevel: function(el) { - return parseInt(el.tagName.charAt(1), 10); - }, - - populateNav: function($topContext, topLevel, $headings) { - var $context = $topContext; - var $prevNav; - - var helpers = this; - $headings.each(function(i, el) { - var $newNav = helpers.generateNavItem(el); - var navLevel = helpers.getNavLevel(el); - - // determine the proper $context - if (navLevel === topLevel) { - // use top level - $context = $topContext; - } else if ($prevNav && $context === $topContext) { - // create a new level of the tree and switch to it - $context = helpers.createChildNavList($prevNav); - } // else use the current $context - - $context.append($newNav); - - $prevNav = $newNav; - }); - }, - - parseOps: function(arg) { - var opts; - if (arg.jquery) { - opts = { - $nav: arg - }; - } else { - opts = arg; - } - opts.$scope = opts.$scope || $(document.body); - return opts; - } - }, - - // accepts a jQuery object, or an options object - init: function(opts) { - opts = this.helpers.parseOps(opts); - - // ensure that the data attribute is in place for styling - opts.$nav.attr('data-toggle', 'toc'); - - var $topContext = this.helpers.createChildNavList(opts.$nav); - var topLevel = this.helpers.getTopLevel(opts.$scope); - var $headings = this.helpers.getHeadings(opts.$scope, topLevel); - this.helpers.populateNav($topContext, topLevel, $headings); - } - }; - - $(function() { - $('nav[data-toggle="toc"]').each(function(i, el) { - var $nav = $(el); - Toc.init($nav); - }); - }); -})(); diff --git a/docs/docsearch.css b/docs/docsearch.css deleted file mode 100644 index e5f1fe1d..00000000 --- a/docs/docsearch.css +++ /dev/null @@ -1,148 +0,0 @@ -/* Docsearch -------------------------------------------------------------- */ -/* - Source: https://github.com/algolia/docsearch/ - License: MIT -*/ - -.algolia-autocomplete { - display: block; - -webkit-box-flex: 1; - -ms-flex: 1; - flex: 1 -} - -.algolia-autocomplete .ds-dropdown-menu { - width: 100%; - min-width: none; - max-width: none; - padding: .75rem 0; - background-color: #fff; - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, .1); - box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); -} - -@media (min-width:768px) { - .algolia-autocomplete .ds-dropdown-menu { - width: 175% - } -} - -.algolia-autocomplete .ds-dropdown-menu::before { - display: none -} - -.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { - padding: 0; - background-color: rgb(255,255,255); - border: 0; - max-height: 80vh; -} - -.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { - margin-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion { - padding: 0; - overflow: visible -} - -.algolia-autocomplete .algolia-docsearch-suggestion--category-header { - padding: .125rem 1rem; - margin-top: 0; - font-size: 1.3em; - font-weight: 500; - color: #00008B; - border-bottom: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { - float: none; - padding-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { - float: none; - width: auto; - padding: 0; - text-align: left -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content { - float: none; - width: auto; - padding: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content::before { - display: none -} - -.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { - padding-top: .75rem; - margin-top: .75rem; - border-top: 1px solid rgba(0, 0, 0, .1) -} - -.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { - display: block; - padding: .1rem 1rem; - margin-bottom: 0.1; - font-size: 1.0em; - font-weight: 400 - /* display: none */ -} - -.algolia-autocomplete .algolia-docsearch-suggestion--title { - display: block; - padding: .25rem 1rem; - margin-bottom: 0; - font-size: 0.9em; - font-weight: 400 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--text { - padding: 0 1rem .5rem; - margin-top: -.25rem; - font-size: 0.8em; - font-weight: 400; - line-height: 1.25 -} - -.algolia-autocomplete .algolia-docsearch-footer { - width: 110px; - height: 20px; - z-index: 3; - margin-top: 10.66667px; - float: right; - font-size: 0; - line-height: 0; -} - -.algolia-autocomplete .algolia-docsearch-footer--logo { - background-image: url("data:image/svg+xml;utf8,"); - background-repeat: no-repeat; - background-position: 50%; - background-size: 100%; - overflow: hidden; - text-indent: -9000px; - width: 100%; - height: 100%; - display: block; - transform: translate(-8px); -} - -.algolia-autocomplete .algolia-docsearch-suggestion--highlight { - color: #FF8C00; - background: rgba(232, 189, 54, 0.1) -} - - -.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { - box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) -} - -.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { - background-color: rgba(192, 192, 192, .15) -} diff --git a/docs/docsearch.js b/docs/docsearch.js deleted file mode 100644 index b35504cd..00000000 --- a/docs/docsearch.js +++ /dev/null @@ -1,85 +0,0 @@ -$(function() { - - // register a handler to move the focus to the search bar - // upon pressing shift + "/" (i.e. "?") - $(document).on('keydown', function(e) { - if (e.shiftKey && e.keyCode == 191) { - e.preventDefault(); - $("#search-input").focus(); - } - }); - - $(document).ready(function() { - // do keyword highlighting - /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ - var mark = function() { - - var referrer = document.URL ; - var paramKey = "q" ; - - if (referrer.indexOf("?") !== -1) { - var qs = referrer.substr(referrer.indexOf('?') + 1); - var qs_noanchor = qs.split('#')[0]; - var qsa = qs_noanchor.split('&'); - var keyword = ""; - - for (var i = 0; i < qsa.length; i++) { - var currentParam = qsa[i].split('='); - - if (currentParam.length !== 2) { - continue; - } - - if (currentParam[0] == paramKey) { - keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); - } - } - - if (keyword !== "") { - $(".contents").unmark({ - done: function() { - $(".contents").mark(keyword); - } - }); - } - } - }; - - mark(); - }); -}); - -/* Search term highlighting ------------------------------*/ - -function matchedWords(hit) { - var words = []; - - var hierarchy = hit._highlightResult.hierarchy; - // loop to fetch from lvl0, lvl1, etc. - for (var idx in hierarchy) { - words = words.concat(hierarchy[idx].matchedWords); - } - - var content = hit._highlightResult.content; - if (content) { - words = words.concat(content.matchedWords); - } - - // return unique words - var words_uniq = [...new Set(words)]; - return words_uniq; -} - -function updateHitURL(hit) { - - var words = matchedWords(hit); - var url = ""; - - if (hit.anchor) { - url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; - } else { - url = hit.url + '?q=' + escape(words.join(" ")); - } - - return url; -} diff --git a/docs/extra.css b/docs/extra.css deleted file mode 100644 index 76358758..00000000 --- a/docs/extra.css +++ /dev/null @@ -1,31 +0,0 @@ -h1, h2, h3, h4 { - padding-top:20px; -} - -div.comparison thead tr th:first-child, -div.comparison tbody tr td:first-child { - width: 12em; - min-width: 12em; - max-width: 12em; - word-break: break-all; -} - -div.comparison table { - border-collapse: collapse; -} - -div.comparison tr { - border-color: #b4bcc2; - border: solid; - border-width: 1px 0; -} - -div.comparison .header { - border-color: #b4bcc2; - border: solid; - border-width: 2px 0; -} - -.ref-index h3 { - color: #18bc9c; -} diff --git a/docs/favicon.ico b/docs/favicon.ico deleted file mode 100644 index ac7676c5..00000000 Binary files a/docs/favicon.ico and /dev/null differ diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index ce3506e1..00000000 --- a/docs/index.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - -Tidy Quantitative Financial Analysis • tidyquant - - - - - - - - - - - - - -
    -
    - - - - -
    -
    - -
    - - -
    -

    Bringing financial and business analysis to the tidyverse

    -
    -
    -

    2-Minutes To Tidyquant -

    -

    Our short introduction to tidyquant on YouTube.

    -

    Anomalize

    -
    -
    -
    -

    Features of Tidyquant -

    -

    tidyquant integrates the best resources for collecting and analyzing financial data, zoo, xts, quantmod, TTR, and PerformanceAnalytics, with the tidy data infrastructure of the tidyverse allowing for seamless interaction between each. You can now perform complete financial analyses in the tidyverse.

    -
      -
    • A few core functions with a lot of power
    • -
    • Integrates the quantitative analysis functionality of zoo, xts, quantmod, TTR, and now PerformanceAnalytics
    • -
    • Designed for modeling and scaling analyses using the the tidyverse tools in R for Data Science
    • -
    • Implements ggplot2 functionality for beautiful and meaningful financial visualizations
    • -
    • User-friendly documentation to get you up to speed quickly!
    • -
    -
    -

    NEW EXCEL in tidyquant 1.0.0 -

    -

    Tidyquant 1.0.0 is the “R for Excel Users” release. My aim is to build functionality that helps users coming from an Excel Background (background I came from). It’s important to have these users feel at home. I have a full suite of functionality to accomplish your Excel-to-R transition.

    -

    EXCEL Tutorials:

    - -
    -
    -

    One-Stop Shop for Serious Financial Analysis -

    -

    With tidyquant all the benefits add up to one thing: a one-stop shop for serious financial analysis!

    -
    -

    Core Functions -

    -
      -
    • Getting Financial Data from the web: tq_get(). This is a one-stop shop for getting web-based financial data in a “tidy” data frame format. Get data for daily stock prices (historical), key statistics (real-time), key ratios (historical), financial statements, dividends, splits, economic data from the FRED, FOREX rates from Oanda.

    • -
    • Manipulating Financial Data: tq_transmute() and tq_mutate(). Integration for many financial functions from xts, zoo, quantmod,TTR and PerformanceAnalytics packages. tq_mutate() is used to add a column to the data frame, and tq_transmute() is used to return a new data frame which is necessary for periodicity changes.

    • -
    • Performance Analysis and Portfolio Analysis: tq_performance() and tq_portfolio(). The newest additions to the tidyquant family integrate PerformanceAnalytics functions. tq_performance() converts investment returns into performance metrics. tq_portfolio() aggregates a group (or multiple groups) of asset returns into one or more portfolios.

    • -
    -
    -
    -

    Comparing Stock Prices -

    -

    Visualizing the stock price volatility of four stocks side-by-side is quick and easy…

    -

    -
    -
    -

    Evaluating Stock Performance -

    -

    What about stock performance? Quickly visualize how a $10,000 investment in various stocks would perform.

    -

    -
    -
    -

    Evaluating Portfolio Performance -

    -

    Ok, stocks are too easy. What about portfolios? With the PerformanceAnalytics integration, visualizing blended portfolios are easy too!

    -
      -
    • Portfolio 1: 50% FB, 25% AMZN, 25% NFLX, 0% GOOG
    • -
    • Portfolio 2: 0% FB, 50% AMZN, 25% NFLX, 25% GOOG
    • -
    • Portfolio 3: 25% FB, 0% AMZN, 50% NFLX, 25% GOOG
    • -
    • Portfolio 4: 25% FB, 25% AMZN, 0% NFLX, 50% GOOG
    • -
    -

    -

    This just scratches the surface of tidyquant. Here’s how to install to get started.

    -
    -
    -
    -

    Installation -

    -

    Development Version with Latest Features:

    -
    -# install.packages("devtools")
    -devtools::install_github("business-science/tidyquant")
    -

    CRAN Approved Version:

    -
    -install.packages("tidyquant")
    -
    - -
    -
    -

    Want to Learn tidyquant? -

    -
      -
    • -

      Learning Lab #9:

      -
        -
      • -Performance Analysis & Portfolio Optimization with tidyquant - A 1-hour course on tidyquant in Learning Labs PRO
      • -
      -
    • -
    • -

      Learning Lab #10:

      -
        -
      • -Building an API with plumber - Build a stock optimization API with plumber and tidyquant -
      • -
      -
    • -
    • -

      Learning Lab #16:

      -
        -
      • -Stock Portfolio Optimization and Nonlinear Programming - Use the ROI package with tidyquant to calculate optimal minimum variance portfolios and develop an efficient frontier.
      • -
      -
    • -
    • -

      Learning Lab #30:

      -
        -
      • -Shiny Financial Analysis with Tidyquant API & Excel Pivot Tables - Learn how to use the new Excel Functionality to make Pivot Tables, VLOOKUPs, Sum-If’s, and more!
      • -
      -
    • -
    -
    - -
    - - -
    - - -
    - -
    -

    -

    Site built with pkgdown 2.0.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/jquery.sticky-kit.min.js b/docs/jquery.sticky-kit.min.js deleted file mode 100644 index e2a3c6de..00000000 --- a/docs/jquery.sticky-kit.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net -*/ -(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k)); -if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("
    "))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q, -u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),eb&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}), -a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize", -y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n - - - - - diff --git a/docs/news/index.html b/docs/news/index.html deleted file mode 100644 index 53e47dee..00000000 --- a/docs/news/index.html +++ /dev/null @@ -1,437 +0,0 @@ - -Changelog • tidyquant - - -
    -
    - - - -
    -
    - - -
    - -
    -

    Fixes

    -
    -
    -
    - -
    -

    Fixes

    -
    • -tq_exchange(): Fix issue with NASDAQ changes to website.
    • -
    • -theme_tq(): Fix issues with %+replace%, theme_gray, and rel not found.
    • -
    -
    -
    - -
    -

    Improvements

    -
    • -tq_get() - Add "dividends" and "splits" get options, which have been fixed in quantmod 0.4-16. Issue 150.
    • -
    -
    -

    Bug Fixes

    -
    • Issue 157 - Error on package load with rstudioapi::getThemeInfo() returns NULL.
    • -
    • -pivot_table - Fix issues with tidyverse functions not being found.
    • -
    -
    -

    Deprecation

    -
    -
    -
    - -
    -

    This is the “R for Excel Users” release. My aim is to build functionality that helps users coming from an Excel Background (background I came from). It’s important to have these users feel at home. I have a full suite of functionality to accomplish your Excel-to-R transition.

    -

    -Matt

    -
    -
    • -

      Excel Functions

      -
      • -Why Excel functions? Designed to help users coming from an Excel Background more easily transition to the tidyverse and “tidy- finance / business analysis” in R.
      • -
      • -Pivot Table -
        • -pivot_table() - A tidyverse-style function to perform data summarizations just like the popular Excel Pivot Table. Enables stacking calculations using a tidy-esque syntax: .rows = ~ YEAR(order_date).
        • -
      • -
      • -Reference Functions -
        • -VLOOKUP() - Performs the classic Excel VLOOKUP. Excel user’s: rejoice.
        • -
      • -
      • -Summarising “IFS” Functions -
        • -Summarising “IFS” Functions - Filtering versions of Excel summarization counterparts. Simply add “cases” that filter if a condition is true. SUM_IFS(), COUNT_IFS(), AVERAGE_IFS() -
        • -
        • -Create your own “IFS” functions - Have and idea for a new “IFS” function that hasn’t been made yet? Use CREATE_IFS() to make your own by supplying a summarization function.
        • -
      • -
      • -Statistical, Date, and Financial Math Functions -
      • -
    • -
    • -

      NEW Tidyverse Functionality

      -
      • -summarise_by_time() - This is a new time-based variant of summarise() that allows collapsing the time-series by “day”, “week”, “month”, “quarter”, “year”, and more.
      • -
      • Note: I will evaluate the need for summarise_at_by_time(), summarise_all_by_time(), and summarise_if_by_time() after the release of dplyr v1.0.0.
      • -
    • -
    • -

      NEW API Integrations

      -
      • -Tiingo API - A popular Open-Source for stock prices, cryptocurrencies, and intraday feeds from the IEX (Investors Exchange). This can serve as an alternate source of data to Yahoo Finance. Integrated via the riingo package.
      • -
    • -
    • -

      Bug Fixes & Improvements

      -
      • -theme_tq() - Fix issues with collisions with dials::margin() and ggplot2::margin(). Similar potential ggplot2 collisions have been fixed.
      • -
      • -theme_tq() - Increased default top/bottom text margin on facet strips
      • -
    • -
    • -

      Deprecation & Breaking Changes

      -
      • -Potential Breaking Change - Single values now return the symbol column (i.e. tq_get("AAPL") returns symbol = “AAPL” for the 1st column).
      • -
      • -Deprecated Sources: The following sources have been deprecated due to lack of support from the API: -
        • Google Finance
        • -
        • Morningstar Key Ratios & Financials (Fundamentals) Data
        • -
        • Yahoo Dividends and Splits
        • -
        • Oanda FX and Metal Prices
        • -
      • -
      • -Deprecated Compound Getters - Stacking multiple get options (tq_get("AAPL", get = c("stock.prices", "stock.prices.japan"))) is no longer available. Solution: Split these up into two calls to tq_get().
      • -
    • -
    -
    - -
    • -tq_get() - Temporarily adjust tests for tq_get(get = "dividends") and tq_get(get = "splits") until API is stabilizes. Yahoo! Dividends and Splits intermitently returns errors.
    • -
    • Fix documentation warnings during package build checks. Documentation moved from tq_stocklist to ?tq_index.
    • -
    -
    - -
    • -tq_index() -
      • Fix issue #144 - tq_index() download issue. Note that “RUSSEL1000”, “RUSSELL2000”, “RUSSELL3000”, and “SP1000” are no longer available due to changes from www.us.spdrs.com.
      • -
      • Update Stock Index Fallback.
      • -
    • -
    -
    - -
    • -tq_index() - Fix naming issue with stock index data downloaded from www.us.spdrs.com.
    • -
    -
    - -

    Stock Index & Exchanges

    -

    Visualizations & Color Palettes

    -
    • -geom_candlestick and geom_barchart - Issue #112.
    • -
    • Added color names of theme_tq palettes (palette_light, palette_dark, and palette_green) for easier identification.
    • -

    Compatability with tidyr v1.0.0

    -
    • Improvements to ensure compatability with tidyr v1.0.0
    • -

    [Potential Breaking Change] Move tidyverse to suggests

    -
    • This is actually potentially a “breaking change” (although most users will see no difference since you likely load tidyverse in your scripts) - if you do not load tidyverse, then you will now need to do so. Previously tidyquant loaded tidyverse behind the scenes.
    • -
    -
    - -
    • Morningstar Key Ratios: The tq_get() argument get = "key.ratios" has been deprecated due to a change in Morningstar’s website. (Help Wanted - Ref. Issue #125)

    • -
    • Remove dependency on XLConnect. Replace with readxl. Issue #119.

    • -
    -
    - -
    • -

      Bux fix

      -
      • tq_get() get = "financials" now returns a warning and NA as Google Finance no longer provides data. We are actively looking for alternative data sources.

      • -
      • tq_get() get = "stock.prices.google" now returns a warning and NA as Google Finance no longer provides data. Use get = "stock.prices" instead to use Yahoo Finance, or use the riingo package to download from Tiingo.

      • -
      • Catch duplicate names in col_rename when you are renaming more than 1 column. Duplicate names are not allowed and return an error.

      • -
      • Fix duplicate name collision issue when the original name already includes a .. Duplicate names now get a ..1, ..2, etc. as opposed to .1, .2.

      • -
    • -
    -
    - -
    • Features: -
      • Incorporate alphavantager, a lightweight API to the Alpha Vantage financial data provider.
      • -
      • Integrate Rblpapi, R interface to “Bloomberg”. You must have a Bloomberg account to use this.
      • -
      • Add Google Finance as a source in tq_get(get = "stock.prices.google") -
      • -
    • -
    • Important Changes: -
      • Remove Key Statistics from tq_get(get = "key.stats"). Yahoo Finance no longer supports the Key Statistics CSV API.
      • -
      • Completed deprecation of tidyquant::as_tibble() and tidyquant::as_xts(). Use timetk::tk_tbl() and timetk::tk_xts() instead.
      • -
      • -tibbletime support was added so that all tidyquant functions play nicely with tbl_time objects.
      • -
      • A hard dependency on XLConnect was removed. This should ease the use of the package, especially for Mac users.
      • -
    • -
    • Bug Fixes: -
      • Some tests failed with testthat 2.0. They have been updated.
      • -
    • -
    -
    - -
    • Fixes for compatibility with purrr v0.2.3.
    • -
    -
    - -
    • Incorporated more robust timetk coercion functions. Deprecated tidyquant::as_xts() and tidyquant::as_tibble(). Use timetk::tk_xts() and timetk::tk_tbl() instead.
    • -
    • Fixes: -
      • -tq_index() no longer pulls from marketvolume. Instead, 9 indices are available from SPDR. These indices are more reliable, and include weights for each stock in the index.
      • -
      • Fixed 2 tests where the results of tq_get(get = "stock.prices") were 1 or 2 rows off of what the tests expected. This likely has to do with the new yahoo finance API.
      • -
    • -
    -
    - -
    • Improvements -
      • Added pkgdown integration.
      • -
    • -
    • Fixes: -
      • Require new quantmod version 0.4-8 to fix Oanda and Yahoo bugs.
      • -
      • Quandl data returned newest to oldest. For consistency with other tq_get() data, it now returns oldest to newest.
      • -
      • Oanda only returns 180 days of FX and Metals data now. Updated the tests to account for this. Also added error handling to check for valid date ranges.
      • -
      • Fixed bug with tq_portfolio() where weights = NULL would not execute an equal weighting scheme.
      • -
      • Added error handling during dollar and percent conversion for get = “key.ratios” and get = “key.stats”.
      • -
    • -
    -
    - -
    • New Data: -
      • Quandl Integration: -
      • -
      • Yahoo Japan Integration: tq_get(get = "stock.prices.japan") is a wrapper for quantmod::getSymbols(src = "yahooj") that enables getting stocks from Yahoo Finance Japan.
      • -
    • -
    • Improvements and Fixes: -
      • -tq_mutate() and tq_transmute() now accept non-OHLC data through the select argument. They also now work with rollapply.
      • -
      • -tq_mutate() and tq_transmute() now accept PerformanceAnalytics functions that work to clean and transform asset returns.
      • -
      • Deprecated the ohlc_fun argument to instead use select in tq_mutate() and tq_transmute -
      • -
      • -.Deprecated -> .Defunct for tq_transform() and tq_transform_xy(). Use tq_transmute() and tq_transmute_xy(). Move the sign post functions to deprecated.R
      • -
      • Remove the previously deprecated argument, transform_fun from tq_transmute(). Use mutate_fun instead.
      • -
      • Fix issue with tq_mutate returning rows incorrectly sorted
      • -
      • Fix issue with tq_get returning data frames as nested
      • -
      • Fix tq_get error to return full error when issues are present.
      • -
    • -
    -
    - -
    • New Features: -
      • -tq_transmute() replaces tq_transform() for consistency with dplyr.
      • -
      • -tq_performance() which integrates the performance analysis functions of PerformanceAnalytics.
      • -
      • -tq_portfolio() which enables aggregating portfolios from individual stock returns.
      • -
      • -tq_tranform(): Added the NA-handling functions from zoo to the list of compatible, which provide a number of useful methods for handling NA values in data sets. Added Return.calculate and Return.excess for calculating returns and returns in excess of the risk-free rate, respectively.
      • -
    • -
    • Documentation: -
      • -tq_mutate() and tq_transmute() help pages have been combined.
      • -
      • Split introduction into four separate vignettes, which improves flow and enables readers to more easily get to needed documentation. Now five docs total covering the primary needs of tidyquant users!
      • -
    • -
    • New data: -
      • -tq_exchange() gets the stock list for NASDAQ, NYSE, and AMEX exchanges. Use tq_exchange_options() to exchange options.
      • -
      • -FANG data set that can be loaded with data(FANG).
      • -
    • -
    • New visualizations that integrate with ggplot2: -
      • -palette_() functions used to create scales are exported.
      • -
      • -theme_tq() creates light, dark, and green themes for tidyquant visualizations.
      • -
      • -scale_color_tq() and scale_fill_tq() add color/fill scales for the data used in tidyquant visualizations.
      • -
    • -
    • Improvements and Fixes: -
      • The transform_fun argument of tq_transmute() has been replaced with mutate_fun for consistency with tq_mutate().
      • -
      • Core functions are now generics to allow for extendability.
      • -
      • Issue #11: Part 2. Fix multiple stocks that only return 110 lines. Handle stocks that return csv with “We’re sorry” message.
      • -
      • Issue #11: Part 1. Fix instability with get = key.ratios failing with HTTP 500 error on download. Use httr RETRY in case of failure.
      • -
      • Fixed issue with get = "key.ratios" where stocks listed on AMEX exchange were not able to return key ratios.
      • -
      • Issue #9: Fix problem with get = "key.stats" where NA’s in multiple x (e.g. c("AAPL", "GOOG")) cause call to fail during coercion.
      • -
      • Issue #8, Part 2: Enable compound gets (e.g. tq_get("AAPL", get = c("stock.prices", "financials"))).
      • -
      • Issue #8, Part 1: Create tq_index() function to return a stock index. tq_get(get = "stock.index") is deprecated and will be removed during the next version after 0.4.0. Use tq_index_options() for index options.
      • -
      • Issue #7: Fixed issue with date column inadvertently being coerced to dttm.
      • -
    • -
    -
    - -
    • New data: -
      • New tq_get option get = "key.stats", which retrieves the current key statistics (55 total) from www.finance.yahoo.com/. These include various current data such as Ask, Bid, Day’s High, Day’s Low, Last Trade Price, current P/E Ratio, EPS, Current Market Cap, EPS Projected Current Year, EPS Projected Next Year and many more. Example: tq_get("AAPL", get = "key.stats").
      • -
    • -
    • New visualizations that integrate with ggplot2: -
      • Chart geoms: Bar charts (geom_barchart) and candlestick charts (geom_candlestick) can be quickly created with the new geoms.
      • -
      • Moving Averages: Seven moving averages can be quickly visualized / prototyped using geom_ma. The geom wraps the TTR::SMA functions.
      • -
      • Bollinger bands can be visualized with geom_bbands. The same seven moving averages are compatible with the geom.
      • -
      • Zooming Into Chart Sections: Two functions (coord_x_date and coord_x_datetime) were added to enable zooming into chart sections using dates with no out-of-bounds data loss (e.g. out-of-bounds data loss with the scale_x_ functions).
      • -
    • -
    • New Vignette: Covers “Charting with tidyquant”.
    • -
    • Fixes: -
      • Issue #5: tq_get can now accept character vectors and data frames for the x arg, in addition to a single character input. This streamlines the getting of data for multiple inputs (e.g. stock symbols, stock indexes, etc).
      • -
      • Issue #4: Added col_rename arg to tq_mutate and tq_transform, which enables fast and easy renaming during the operation.
      • -
      • Issue #3: Integrated dplyr::group_by() with tq_mutate() and tq_transform(). The transform and mutate functions now work properly with grouped data frames.
      • -
      • Issue #2: Fixed bug with tq_get(), get = "key.ratios", where key ratios for stocks from the NYSE returned NA.
      • -
    • -
    • Removed support for deprecated arguments: x_fun, .x, and .y in the respective transform and mutate functions.
    • -
    -
    - -
    • New get = "key.ratios" option for tq_get(), which retrieves 10-years of key performance ratios (89 total) from www.morningstar.com. These include various historical measures of financial performance including profitability, growth, cash flow, financial health, efficiency, and valuation ratios. Example: tq_get("AAPL", get = "key.ratios").
    • -
    • Added zoo rollapply() functions to list of compatible / integrated functions used with tq_transform() and tq_mutate(). See tq_transform_fun_options() for the full list.
    • -
    • Changed tq_mutate(), tq_transform(), tq_mutate_xy() and tq_transform_xy() arguments to be more obvious: -
    • -
    • Fixed duplication of column names during tq_mutate. Names are now sequentually indexed with duplicate names starting at .1 suffix.
    • -
    -
    - -
    • Initial release of tidyquant, for seamless quantitative financial analysis (xts, quantmod, TTR) package integration with the tidyverse.
    • -
    -
    - - - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/pkgdown.css b/docs/pkgdown.css deleted file mode 100644 index 80ea5b83..00000000 --- a/docs/pkgdown.css +++ /dev/null @@ -1,384 +0,0 @@ -/* Sticky footer */ - -/** - * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ - * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css - * - * .Site -> body > .container - * .Site-content -> body > .container .row - * .footer -> footer - * - * Key idea seems to be to ensure that .container and __all its parents__ - * have height set to 100% - * - */ - -html, body { - height: 100%; -} - -body { - position: relative; -} - -body > .container { - display: flex; - height: 100%; - flex-direction: column; -} - -body > .container .row { - flex: 1 0 auto; -} - -footer { - margin-top: 45px; - padding: 35px 0 36px; - border-top: 1px solid #e5e5e5; - color: #666; - display: flex; - flex-shrink: 0; -} -footer p { - margin-bottom: 0; -} -footer div { - flex: 1; -} -footer .pkgdown { - text-align: right; -} -footer p { - margin-bottom: 0; -} - -img.icon { - float: right; -} - -/* Ensure in-page images don't run outside their container */ -.contents img { - max-width: 100%; - height: auto; -} - -/* Fix bug in bootstrap (only seen in firefox) */ -summary { - display: list-item; -} - -/* Typographic tweaking ---------------------------------*/ - -.contents .page-header { - margin-top: calc(-60px + 1em); -} - -dd { - margin-left: 3em; -} - -/* Section anchors ---------------------------------*/ - -a.anchor { - display: none; - margin-left: 5px; - width: 20px; - height: 20px; - - background-image: url(./link.svg); - background-repeat: no-repeat; - background-size: 20px 20px; - background-position: center center; -} - -h1:hover .anchor, -h2:hover .anchor, -h3:hover .anchor, -h4:hover .anchor, -h5:hover .anchor, -h6:hover .anchor { - display: inline-block; -} - -/* Fixes for fixed navbar --------------------------*/ - -.contents h1, .contents h2, .contents h3, .contents h4 { - padding-top: 60px; - margin-top: -40px; -} - -/* Navbar submenu --------------------------*/ - -.dropdown-submenu { - position: relative; -} - -.dropdown-submenu>.dropdown-menu { - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - border-radius: 0 6px 6px 6px; -} - -.dropdown-submenu:hover>.dropdown-menu { - display: block; -} - -.dropdown-submenu>a:after { - display: block; - content: " "; - float: right; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 5px 0 5px 5px; - border-left-color: #cccccc; - margin-top: 5px; - margin-right: -10px; -} - -.dropdown-submenu:hover>a:after { - border-left-color: #ffffff; -} - -.dropdown-submenu.pull-left { - float: none; -} - -.dropdown-submenu.pull-left>.dropdown-menu { - left: -100%; - margin-left: 10px; - border-radius: 6px 0 6px 6px; -} - -/* Sidebar --------------------------*/ - -#pkgdown-sidebar { - margin-top: 30px; - position: -webkit-sticky; - position: sticky; - top: 70px; -} - -#pkgdown-sidebar h2 { - font-size: 1.5em; - margin-top: 1em; -} - -#pkgdown-sidebar h2:first-child { - margin-top: 0; -} - -#pkgdown-sidebar .list-unstyled li { - margin-bottom: 0.5em; -} - -/* bootstrap-toc tweaks ------------------------------------------------------*/ - -/* All levels of nav */ - -nav[data-toggle='toc'] .nav > li > a { - padding: 4px 20px 4px 6px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; -} - -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 5px; - color: inherit; - border-left: 1px solid #878787; -} - -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 5px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; - border-left: 2px solid #878787; -} - -/* Nav: second level (shown on .active) */ - -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} - -nav[data-toggle='toc'] .nav .nav > li > a { - padding-left: 16px; - font-size: 1.35rem; -} - -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 15px; -} - -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 15px; - font-weight: 500; - font-size: 1.35rem; -} - -/* orcid ------------------------------------------------------------------- */ - -.orcid { - font-size: 16px; - color: #A6CE39; - /* margins are required by official ORCID trademark and display guidelines */ - margin-left:4px; - margin-right:4px; - vertical-align: middle; -} - -/* Reference index & topics ----------------------------------------------- */ - -.ref-index th {font-weight: normal;} - -.ref-index td {vertical-align: top; min-width: 100px} -.ref-index .icon {width: 40px;} -.ref-index .alias {width: 40%;} -.ref-index-icons .alias {width: calc(40% - 40px);} -.ref-index .title {width: 60%;} - -.ref-arguments th {text-align: right; padding-right: 10px;} -.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} -.ref-arguments .name {width: 20%;} -.ref-arguments .desc {width: 80%;} - -/* Nice scrolling for wide elements --------------------------------------- */ - -table { - display: block; - overflow: auto; -} - -/* Syntax highlighting ---------------------------------------------------- */ - -pre, code, pre code { - background-color: #f8f8f8; - color: #333; -} -pre, pre code { - white-space: pre-wrap; - word-break: break-all; - overflow-wrap: break-word; -} - -pre { - border: 1px solid #eee; -} - -pre .img, pre .r-plt { - margin: 5px 0; -} - -pre .img img, pre .r-plt img { - background-color: #fff; -} - -code a, pre a { - color: #375f84; -} - -a.sourceLine:hover { - text-decoration: none; -} - -.fl {color: #1514b5;} -.fu {color: #000000;} /* function */ -.ch,.st {color: #036a07;} /* string */ -.kw {color: #264D66;} /* keyword */ -.co {color: #888888;} /* comment */ - -.error {font-weight: bolder;} -.warning {font-weight: bolder;} - -/* Clipboard --------------------------*/ - -.hasCopyButton { - position: relative; -} - -.btn-copy-ex { - position: absolute; - right: 0; - top: 0; - visibility: hidden; -} - -.hasCopyButton:hover button.btn-copy-ex { - visibility: visible; -} - -/* headroom.js ------------------------ */ - -.headroom { - will-change: transform; - transition: transform 200ms linear; -} -.headroom--pinned { - transform: translateY(0%); -} -.headroom--unpinned { - transform: translateY(-100%); -} - -/* mark.js ----------------------------*/ - -mark { - background-color: rgba(255, 255, 51, 0.5); - border-bottom: 2px solid rgba(255, 153, 51, 0.3); - padding: 1px; -} - -/* vertical spacing after htmlwidgets */ -.html-widget { - margin-bottom: 10px; -} - -/* fontawesome ------------------------ */ - -.fab { - font-family: "Font Awesome 5 Brands" !important; -} - -/* don't display links in code chunks when printing */ -/* source: https://stackoverflow.com/a/10781533 */ -@media print { - code a:link:after, code a:visited:after { - content: ""; - } -} - -/* Section anchors --------------------------------- - Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 -*/ - -div.csl-bib-body { } -div.csl-entry { - clear: both; -} -.hanging-indent div.csl-entry { - margin-left:2em; - text-indent:-2em; -} -div.csl-left-margin { - min-width:2em; - float:left; -} -div.csl-right-inline { - margin-left:2em; - padding-left:1em; -} -div.csl-indent { - margin-left: 2em; -} diff --git a/docs/pkgdown.js b/docs/pkgdown.js deleted file mode 100644 index 6f0eee40..00000000 --- a/docs/pkgdown.js +++ /dev/null @@ -1,108 +0,0 @@ -/* http://gregfranko.com/blog/jquery-best-practices/ */ -(function($) { - $(function() { - - $('.navbar-fixed-top').headroom(); - - $('body').css('padding-top', $('.navbar').height() + 10); - $(window).resize(function(){ - $('body').css('padding-top', $('.navbar').height() + 10); - }); - - $('[data-toggle="tooltip"]').tooltip(); - - var cur_path = paths(location.pathname); - var links = $("#navbar ul li a"); - var max_length = -1; - var pos = -1; - for (var i = 0; i < links.length; i++) { - if (links[i].getAttribute("href") === "#") - continue; - // Ignore external links - if (links[i].host !== location.host) - continue; - - var nav_path = paths(links[i].pathname); - - var length = prefix_length(nav_path, cur_path); - if (length > max_length) { - max_length = length; - pos = i; - } - } - - // Add class to parent
  • , and enclosing
  • if in dropdown - if (pos >= 0) { - var menu_anchor = $(links[pos]); - menu_anchor.parent().addClass("active"); - menu_anchor.closest("li.dropdown").addClass("active"); - } - }); - - function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / - - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); - } - - // Returns -1 if not found - function prefix_length(needle, haystack) { - if (needle.length > haystack.length) - return(-1); - - // Special case for length-0 haystack, since for loop won't run - if (haystack.length === 0) { - return(needle.length === 0 ? 0 : -1); - } - - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(i); - } - - return(haystack.length); - } - - /* Clipboard --------------------------*/ - - function changeTooltipMessage(element, msg) { - var tooltipOriginalTitle=element.getAttribute('data-original-title'); - element.setAttribute('data-original-title', msg); - $(element).tooltip('show'); - element.setAttribute('data-original-title', tooltipOriginalTitle); - } - - if(ClipboardJS.isSupported()) { - $(document).ready(function() { - var copyButton = ""; - - $("div.sourceCode").addClass("hasCopyButton"); - - // Insert copy buttons: - $(copyButton).prependTo(".hasCopyButton"); - - // Initialize tooltips: - $('.btn-copy-ex').tooltip({container: 'body'}); - - // Initialize clipboard: - var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { - text: function(trigger) { - return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); - } - }); - - clipboardBtnCopies.on('success', function(e) { - changeTooltipMessage(e.trigger, 'Copied!'); - e.clearSelection(); - }); - - clipboardBtnCopies.on('error', function() { - changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); - }); - }); - } -})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml deleted file mode 100644 index 2fa9d6e0..00000000 --- a/docs/pkgdown.yml +++ /dev/null @@ -1,13 +0,0 @@ -pandoc: '2.13' -pkgdown: 2.0.1 -pkgdown_sha: ~ -articles: - TQ00-introduction-to-tidyquant: TQ00-introduction-to-tidyquant.html - TQ01-core-functions-in-tidyquant: TQ01-core-functions-in-tidyquant.html - TQ02-quant-integrations-in-tidyquant: TQ02-quant-integrations-in-tidyquant.html - TQ03-scaling-and-modeling-with-tidyquant: TQ03-scaling-and-modeling-with-tidyquant.html - TQ04-charting-with-tidyquant: TQ04-charting-with-tidyquant.html - TQ05-performance-analysis-with-tidyquant: TQ05-performance-analysis-with-tidyquant.html - TQ06-excel-in-r: TQ06-excel-in-r.html -last_built: 2021-12-30T13:31Z - diff --git a/docs/reference/FANG.html b/docs/reference/FANG.html deleted file mode 100644 index aabafcac..00000000 --- a/docs/reference/FANG.html +++ /dev/null @@ -1,158 +0,0 @@ - -Stock prices for the "FANG" stocks. — FANG • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    A dataset containing the daily historical stock prices for the "FANG" tech stocks, -"FB", "AMZN", "NFLX", and "GOOG", spanning from the beginning of -2013 through the end of 2016.

    -
    - -
    -
    FANG
    -
    - -
    -

    Format

    -

    A "tibble" ("tidy" data frame) with 4,032 rows and 8 variables:

    symbol
    -

    stock ticker symbol

    - -
    date
    -

    trade date

    - -
    open
    -

    stock price at the open of trading, in USD

    - -
    high
    -

    stock price at the highest point during trading, in USD

    - -
    low
    -

    stock price at the lowest point during trading, in USD

    - -
    close
    -

    stock price at the close of trading, in USD

    - -
    volume
    -

    number of shares traded

    - -
    adjusted
    -

    stock price at the close of trading adjusted for stock splits, in USD

    - - -
    - - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/as_tibble.html b/docs/reference/as_tibble.html deleted file mode 100644 index 292a2c6e..00000000 --- a/docs/reference/as_tibble.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - -DEPRECATED: Coerce to tibble. Enable preserving row names when coercing matrix -and time-series-like objects with row names. — as_tibble • tidyquant - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - - -

    Coerce to tibble. Enable preserving row names when coercing matrix -and time-series-like objects with row names.

    -

    DEPRECATED: Use timetk::tk_tbl() instead.

    - - -
    as_tibble(x, preserve_row_names = FALSE, ...)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    x

    A list, matrix, xts, zoo, timeSeries, etc object.

    preserve_row_names

    Used during coercion from matrix, xts, zoo, -timeSeries, etc objects that have row names. When TRUE, creates -a row.names column with names of rows as character class.

    ...

    Additional parameters passed to the appropriate -timetk::tk_tbl() function.

    - -

    Value

    - -

    Returns a tibble object.

    - -

    Details

    - -

    as_tibble is a wrapper for tibble::as_tibble -that includes a preserve_row_names argument. The function is designed -to coerce xts, zoo, timeSeries, ts, and irts -objects that are used frequently in quantitative financial analysis. -When preserve_row_names = TRUE is specified, a new column, -row.names, is created during object coercion as a character class.

    - -

    See also

    - - - - -

    Examples

    -
    # Load libraries -library(tidyquant) - -# Matrix coercion to tibble -m <- matrix(rnorm(50), ncol = 5) -colnames(m) <- c("a", "b", "c", "d", "e") -rownames(m) <- letters[1:nrow(m)] -m_tbl <- as_tibble(m, preserve_row_names = TRUE)
    #> Warning: The `tidyquant::as_tibble()` function is deprecated. Please use `timetk::tk_tbl()` instead.
    -# xts coercion to tibble -quantmod::getSymbols("AAPL", auto.assign = FALSE) %>% - as_tibble(preserve_row_names = TRUE)
    #> Warning: The `tidyquant::as_tibble()` function is deprecated. Please use `timetk::tk_tbl()` instead.
    #> # A tibble: 2,675 x 7 -#> index AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted -#> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 2007-01-03 13.702 13.748 13.005 11.97143 309579900 10.77017 -#> 2 2007-01-04 13.346 13.648 13.310 12.23714 211815100 11.00922 -#> 3 2007-01-05 13.619 13.688 13.402 12.15000 208685400 10.93082 -#> 4 2007-01-08 13.650 13.740 13.542 12.21000 199276700 10.98480 -#> 5 2007-01-09 13.727 14.764 13.521 13.22429 837324600 11.89731 -#> 6 2007-01-10 15.045 15.530 14.839 13.85714 738220000 12.46666 -#> 7 2007-01-11 15.234 15.368 15.101 13.68572 360063200 12.31244 -#> 8 2007-01-12 15.020 15.095 14.804 13.51714 328172600 12.16078 -#> 9 2007-01-16 15.193 15.442 15.157 13.87143 311019100 12.47951 -#> 10 2007-01-17 15.492 15.498 15.057 13.56428 411565000 12.20319 -#> # ... with 2,665 more rows
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown.

    -
    - -
    -
    - - - diff --git a/docs/reference/as_xts.html b/docs/reference/as_xts.html deleted file mode 100644 index ad91b5cc..00000000 --- a/docs/reference/as_xts.html +++ /dev/null @@ -1,384 +0,0 @@ - - - - - - - - -DEPRECATED: Coerce objects to xts, designed to work with tibble and data.frame objects — as_xts • tidyquant - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - - -

    Coerce objects to xts, designed to work with tibble and data.frame objects

    -

    DEPRECATED: Use timetk::tk_xts() instead.

    - - -
    as_xts(x, date_col = NULL, ...)
    -
    -as_xts_(x, date_col = NULL, ...)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    x

    A data.frame (with date column), matrix, xts, zoo, timeSeries, etc object.

    date_col

    Required for objects that inherit the data.frame class. -Must specify a date column that is of the date class. Unused for -non-data.frame objects.

    ...

    Additional parameters passed to timetk::tk_xts().

    - -

    Value

    - -

    Returns a xts object.

    - -

    Details

    - -

    as_xts is a wrapper for xts::as.xts -that includes a date_col argument. When date_col is specified, -the date column is used as row names during coercion to xts class. The -date column must be in a date format (i.e. date class). - as_xts_ evaluates the date_col using Non-Standard Evaluation -(NSE). See vignette("nse") for details.

    -

    It is possible to coerce non-data.frame-like objects including -zoo, timeSeries, ts, and irts objects. -There is no need to specify the date_col argument.

    - -

    See also

    - - - - -

    Examples

    -
    # Load libraries -library(tidyquant) - -tq_get("AAPL", get = "stock.prices") %>% - as_xts(date_col = date) # Deprecated: Use tk_xts()
    #> Warning: The `as_xts()` function is deprecated. Please use `timetk::tk_xts()` instead.
    #> open high low close volume adjusted -#> 2007-01-03 13.702 13.748 13.005 11.97143 309579900 10.77017 -#> 2007-01-04 13.346 13.648 13.310 12.23714 211815100 11.00922 -#> 2007-01-05 13.619 13.688 13.402 12.15000 208685400 10.93082 -#> 2007-01-08 13.650 13.740 13.542 12.21000 199276700 10.98480 -#> 2007-01-09 13.727 14.764 13.521 13.22429 837324600 11.89731 -#> 2007-01-10 15.045 15.530 14.839 13.85714 738220000 12.46666 -#> 2007-01-11 15.234 15.368 15.101 13.68572 360063200 12.31244 -#> 2007-01-12 15.020 15.095 14.804 13.51714 328172600 12.16078 -#> 2007-01-16 15.193 15.442 15.157 13.87143 311019100 12.47951 -#> 2007-01-17 15.492 15.498 15.057 13.56428 411565000 12.20319 -#> 2007-01-18 14.625 14.626 14.140 12.72429 591151400 11.44748 -#> 2007-01-19 14.074 14.236 13.993 12.64286 341118400 11.37422 -#> 2007-01-22 14.155 14.158 13.600 12.39857 363506500 11.15445 -#> 2007-01-23 13.613 13.896 13.578 12.24286 301856100 11.01436 -#> 2007-01-24 13.764 13.839 13.669 12.38571 231953400 11.14288 -#> 2007-01-25 13.832 14.053 13.661 12.32143 226493400 11.08505 -#> 2007-01-26 13.832 13.874 13.496 12.19714 246718500 10.97323 -#> 2007-01-29 13.704 13.759 13.581 12.27714 225416100 11.04520 -#> 2007-01-30 13.724 13.734 13.537 12.22143 144492600 10.99508 -#> 2007-01-31 13.475 13.656 13.394 12.24714 214017300 11.01821 -#> 2007-02-01 13.693 13.699 13.456 12.10571 166085500 10.89098 -#> 2007-02-02 13.357 13.537 13.291 12.10714 155382500 10.89227 -#> 2007-02-05 13.386 13.534 13.329 11.99143 144713100 10.78816 -#> 2007-02-06 13.410 13.413 13.157 12.02143 216098400 10.81515 -#> 2007-02-07 13.415 13.716 13.267 12.30714 266706300 11.07219 -#> 2007-02-08 13.566 13.737 13.562 12.31143 169757700 11.07605 -#> 2007-02-09 13.637 13.688 13.213 11.89571 215135200 10.70205 -#> 2007-02-12 13.407 13.526 13.280 12.12571 181017900 10.90897 -#> 2007-02-13 13.523 13.543 13.386 12.10000 145246500 10.88584 -#> 2007-02-14 13.438 13.599 13.429 12.18572 126995400 10.96295 -#> 2007-02-15 13.567 13.596 13.462 12.17286 90915300 10.95138 -#> 2007-02-16 13.537 13.562 13.443 12.11857 99967000 10.90255 -#> 2007-02-20 13.442 13.681 13.364 12.27143 154425600 11.04007 -#> 2007-02-21 13.653 14.210 13.650 12.74286 288828400 11.46419 -#> 2007-02-22 14.418 14.420 14.058 12.78714 209556200 11.50403 -#> 2007-02-23 14.158 14.345 14.109 12.72429 129473400 11.44748 -#> 2007-02-26 14.266 14.291 13.912 12.64429 153962200 11.37551 -#> 2007-02-27 13.704 13.828 13.245 11.99000 286453300 10.78688 -#> 2007-02-28 13.180 13.592 13.180 12.08714 229868800 10.87427 -#> 2007-03-01 13.343 14.023 13.299 12.43714 353882200 11.18915 -#> 2007-03-02 13.778 13.901 13.531 12.20143 215000100 10.97709 -#> 2007-03-05 13.639 14.077 13.618 12.33143 209724900 11.09405 -#> 2007-03-06 13.942 14.023 13.878 12.59857 180796700 11.33438 -#> 2007-03-07 13.982 14.128 13.886 12.53143 156571100 11.27397 -#> 2007-03-08 14.067 14.088 13.888 12.57143 127752800 11.30996 -#> 2007-03-09 14.101 14.109 13.878 12.56714 112959000 11.30611 -#> 2007-03-12 13.985 14.290 13.972 12.83857 182352100 11.55030 -#> 2007-03-13 14.197 14.386 14.037 12.62857 216972700 11.36137 -#> 2007-03-14 14.069 14.291 13.961 12.85714 199146500 11.56700 -#> 2007-03-15 14.285 14.348 14.182 12.79571 139874700 11.51174 -#> 2007-03-16 14.218 14.290 14.183 12.79857 142926000 11.51431 -#> 2007-03-19 14.329 14.537 14.226 13.01857 178240300 11.71223 -#> 2007-03-20 14.506 14.583 14.459 13.06857 122229100 11.75722 -#> 2007-03-21 14.607 14.926 14.553 13.41000 171724000 12.06439 -#> 2007-03-22 14.883 14.984 14.768 13.42286 140373100 12.07595 -#> 2007-03-23 14.823 14.937 14.815 13.36000 112721000 12.01940 -#> 2007-03-26 14.925 15.228 14.815 13.69286 216246800 12.31886 -#> 2007-03-27 15.198 15.376 15.085 13.63714 233013200 12.26874 -#> 2007-03-28 15.066 15.149 14.791 13.32000 235584300 11.98342 -#> 2007-03-29 14.957 14.957 14.645 13.39286 181430900 12.04897 -#> 2007-03-30 14.971 15.034 14.728 13.27286 150139500 11.94100 -#> 2007-04-02 14.949 14.966 14.771 13.37857 125498100 12.03611 -#> 2007-04-03 14.949 15.122 14.888 13.50000 145983600 12.14536 -#> 2007-04-04 15.076 15.107 14.947 13.46714 119196000 12.11580 -#> 2007-04-05 14.945 15.034 14.850 13.52571 88879000 12.16849 -#> 2007-04-09 15.118 15.133 14.774 13.37857 103335400 12.03611 -#> 2007-04-10 14.874 14.968 14.833 13.46429 88116700 12.11323 -#> 2007-04-11 14.910 14.918 14.661 13.22714 137254600 11.89988 -#> 2007-04-12 14.615 14.658 14.406 13.17000 164168900 11.84847 -#> 2007-04-13 14.434 14.513 14.301 12.89143 179985400 11.59785 -#> 2007-04-16 14.382 14.529 14.331 13.06143 152258400 11.75079 -#> 2007-04-17 14.609 14.656 14.244 12.90714 187980100 11.61199 -#> 2007-04-18 14.317 14.426 14.228 12.91429 116011000 11.61841 -#> 2007-04-19 14.321 14.490 14.264 12.89571 106478400 11.60171 -#> 2007-04-20 14.432 14.479 14.379 12.99571 130694900 11.69167 -#> 2007-04-23 14.544 14.895 14.517 13.35857 195072500 12.01812 -#> 2007-04-24 14.920 15.306 14.498 13.32000 263813200 11.98342 -#> 2007-04-25 14.963 15.149 14.895 13.62143 296786000 12.25460 -#> 2007-04-26 16.130 16.276 15.609 14.12000 434444500 12.70314 -#> 2007-04-27 15.590 15.871 15.512 14.27429 174850900 12.84195 -#> 2007-04-30 15.893 16.038 15.827 14.25714 154127400 12.82653 -#> 2007-05-01 15.814 15.935 15.649 14.21000 133130900 12.78411 -#> 2007-05-02 15.824 15.965 15.795 14.34143 126286300 12.90235 -#> 2007-05-03 15.995 16.109 15.881 14.34286 144019400 12.90364 -#> 2007-05-04 16.006 16.133 15.958 14.40143 95496800 12.95633 -#> 2007-05-07 16.051 16.570 16.039 14.84572 215389300 13.35604 -#> 2007-05-08 16.430 16.697 16.422 15.00857 195999300 13.50255 -#> 2007-05-09 16.659 16.984 16.656 15.26857 179439400 13.73646 -#> 2007-05-10 16.932 17.283 16.819 15.33429 299314400 13.79558 -#> 2007-05-11 17.108 17.329 16.956 15.53429 163424100 13.97551 -#> 2007-05-14 17.407 17.467 17.189 15.62286 162986600 14.05520 -#> 2007-05-15 17.399 17.499 16.908 15.36000 238628600 13.81871 -#> 2007-05-16 17.234 17.281 16.422 15.33429 281691900 13.79558 -#> 2007-05-17 17.014 17.446 17.014 15.63429 183822800 14.06548 -#> 2007-05-18 17.504 17.569 17.430 15.71714 155336300 14.14002 -#> 2007-05-21 17.516 17.856 17.475 15.99714 159973100 14.39193 -#> 2007-05-22 17.862 18.062 17.786 16.22000 143102400 14.59242 -#> 2007-05-23 18.105 18.261 17.878 16.12714 227843700 14.50888 -#> 2007-05-24 17.913 18.175 17.526 15.81286 221840500 14.22613 -#> 2007-05-25 17.785 18.067 17.705 16.23143 158239900 14.60270 -#> 2007-05-29 18.174 18.239 17.894 16.33571 161423500 14.69652 -#> 2007-05-30 18.150 18.877 18.028 16.96714 369611200 15.26459 -#> 2007-05-31 19.066 19.399 18.982 17.31286 324266600 15.57562 -#> 2007-06-01 19.230 19.244 18.783 16.91429 221315500 15.21704 -#> 2007-06-04 18.837 19.330 18.721 17.33286 221668300 15.59361 -#> 2007-06-05 19.279 19.482 19.134 17.52429 230196400 15.76583 -#> 2007-06-06 19.420 19.698 19.365 17.66286 278060300 15.89050 -#> 2007-06-07 19.847 20.263 19.561 17.72428 478769900 15.94576 -#> 2007-06-08 19.979 19.981 19.419 17.78429 310420600 15.99974 -#> 2007-06-11 20.008 20.031 18.982 17.17000 468564600 15.44709 -#> 2007-06-12 18.952 19.326 18.787 17.19714 356641600 15.47151 -#> 2007-06-13 19.238 19.244 18.324 16.78571 430338300 15.10137 -#> 2007-06-14 18.610 18.968 18.486 16.96429 243316500 15.26202 -#> 2007-06-15 19.153 19.161 19.033 17.21429 202804700 15.48694 -#> 2007-06-18 19.576 19.877 19.458 17.87000 227651200 16.07685 -#> 2007-06-19 19.800 19.850 19.517 17.66571 235756500 15.89307 -#> 2007-06-20 19.669 19.795 19.293 17.36429 224378000 15.62188 -#> 2007-06-21 19.325 19.736 19.169 17.70000 216761300 15.92391 -#> 2007-06-22 19.666 19.762 19.433 17.57143 157969000 15.80824 -#> 2007-06-25 19.720 19.863 19.223 17.47714 241350900 15.72342 -#> 2007-06-26 19.687 19.690 18.852 17.09286 336251300 15.37769 -#> 2007-06-27 19.152 19.379 18.937 17.41286 243674200 15.66558 -#> 2007-06-28 19.430 19.450 19.055 17.22286 209535900 15.49465 -#> 2007-06-29 19.368 19.690 19.228 17.43429 284460400 15.68486 -#> 2007-07-02 19.222 19.387 18.944 17.32286 248715600 15.58461 -#> 2007-07-03 19.372 20.230 19.293 18.16714 290620400 16.34418 -#> 2007-07-05 20.452 21.114 20.435 18.96429 363262900 17.06133 -#> 2007-07-06 21.140 21.173 20.706 18.90000 218673700 17.00350 -#> 2007-07-09 21.021 21.103 20.513 18.61857 248955000 16.75031 -#> 2007-07-10 20.465 21.357 20.454 18.90714 313751900 17.00993 -#> 2007-07-11 20.972 21.230 20.851 18.91286 205443000 17.01507 -#> 2007-07-12 21.254 21.316 21.022 19.15286 176152200 17.23098 -#> 2007-07-13 21.442 21.889 21.361 19.67571 226901500 17.70138 -#> 2007-07-16 21.975 22.228 21.834 19.72857 234028200 17.74893 -#> 2007-07-17 21.961 22.167 21.834 19.84429 177489900 17.85303 -#> 2007-07-18 21.943 21.983 21.602 19.73143 189214200 17.75150 -#> 2007-07-19 22.278 22.359 22.175 20.00000 183222900 17.99312 -#> 2007-07-20 22.493 22.894 22.231 20.53571 291943400 18.47508 -#> 2007-07-23 22.756 23.060 22.378 20.52857 259122500 18.46865 -#> 2007-07-24 22.053 22.390 21.302 19.27000 448823200 17.33637 -#> 2007-07-25 21.810 21.970 21.437 19.60857 374045700 17.64097 -#> 2007-07-26 23.169 23.580 21.748 20.85714 546657300 18.76425 -#> 2007-07-27 23.214 23.647 22.831 20.55000 290274600 18.48793 -#> 2007-07-30 22.918 23.096 22.162 20.20429 276747100 18.17691 -#> 2007-07-31 22.702 22.783 20.884 18.82286 440598200 16.93409 -#> 2007-08-01 21.221 21.497 20.289 19.28571 437539200 17.35051 -#> 2007-08-02 21.699 21.748 21.302 19.49857 213161200 17.54201 -#> 2007-08-03 21.478 21.588 20.881 18.83571 169796900 16.94567 -#> 2007-08-06 21.103 21.480 20.373 19.32143 231292600 17.38263 -#> 2007-08-07 21.427 21.792 21.060 19.29000 237484100 17.35437 -#> 2007-08-08 21.716 21.732 20.960 19.14428 202024200 17.22328 -#> 2007-08-09 20.819 21.119 19.863 18.05571 281348900 16.24393 -#> 2007-08-10 19.550 20.286 19.103 17.85714 352687300 16.06528 -#> 2007-08-13 20.376 20.540 20.087 18.25571 188227900 16.42387 -#> 2007-08-14 20.371 20.373 19.644 17.71857 184751700 15.94062 -#> 2007-08-15 19.490 19.827 18.999 17.12857 248213000 15.40982 -#> 2007-08-16 18.580 18.817 17.724 16.72143 466672500 15.04353 -#> 2007-08-17 19.374 19.611 19.026 17.43714 298765600 15.68743 -#> 2007-08-20 19.684 19.769 19.134 17.46000 200829300 15.70799 -#> 2007-08-21 19.406 20.478 19.214 18.22428 325761800 16.39559 -#> 2007-08-22 20.837 21.079 20.695 18.93000 265441400 17.03049 -#> 2007-08-23 21.133 21.173 20.605 18.72428 216709500 16.84541 -#> 2007-08-24 20.727 21.496 20.613 19.32857 227958500 17.38906 -#> 2007-08-27 21.181 21.383 20.976 18.89286 176859900 16.99707 -#> 2007-08-28 20.800 21.025 20.108 18.11714 294841400 16.29920 -#> 2007-08-29 20.624 21.307 20.570 19.15429 291715200 17.23226 -#> [ reached getOption("max.print") -- omitted 2509 rows ]
    - -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown.

    -
    - -
    -
    - - - diff --git a/docs/reference/av_api_key.html b/docs/reference/av_api_key.html deleted file mode 100644 index acc87312..00000000 --- a/docs/reference/av_api_key.html +++ /dev/null @@ -1,148 +0,0 @@ - -Set Alpha Vantage API Key — av_api_key • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    Set Alpha Vantage API Key

    -
    - -
    -
    av_api_key(api_key)
    -
    - -
    -

    Arguments

    -
    api_key
    -

    Optionally passed parameter to set Alpha Vantage api_key.

    -
    -
    -

    Value

    -

    Returns invisibly the currently set api_key

    -
    -
    -

    Details

    -

    A wrapper for alphavantager::av_api_key()

    -
    -
    -

    See also

    -

    tq_get() get = "alphavantager"

    -
    - -
    -

    Examples

    -
    
    -if (FALSE) {
    -av_api_key(api_key = "foobar")
    -}
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/coord_x_date-1.png b/docs/reference/coord_x_date-1.png deleted file mode 100644 index 74cdbc21..00000000 Binary files a/docs/reference/coord_x_date-1.png and /dev/null differ diff --git a/docs/reference/coord_x_date-2.png b/docs/reference/coord_x_date-2.png deleted file mode 100644 index 26120747..00000000 Binary files a/docs/reference/coord_x_date-2.png and /dev/null differ diff --git a/docs/reference/coord_x_date-3.png b/docs/reference/coord_x_date-3.png deleted file mode 100644 index 6471a2f6..00000000 Binary files a/docs/reference/coord_x_date-3.png and /dev/null differ diff --git a/docs/reference/coord_x_date-4.png b/docs/reference/coord_x_date-4.png deleted file mode 100644 index db8e1f3a..00000000 Binary files a/docs/reference/coord_x_date-4.png and /dev/null differ diff --git a/docs/reference/coord_x_date-5.png b/docs/reference/coord_x_date-5.png deleted file mode 100644 index 6471a2f6..00000000 Binary files a/docs/reference/coord_x_date-5.png and /dev/null differ diff --git a/docs/reference/coord_x_date-6.png b/docs/reference/coord_x_date-6.png deleted file mode 100644 index db8e1f3a..00000000 Binary files a/docs/reference/coord_x_date-6.png and /dev/null differ diff --git a/docs/reference/coord_x_date.html b/docs/reference/coord_x_date.html deleted file mode 100644 index 4ed254b8..00000000 --- a/docs/reference/coord_x_date.html +++ /dev/null @@ -1,201 +0,0 @@ - -Zoom in on plot regions using date ranges or date-time ranges — coord_x_date • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    Zoom in on plot regions using date ranges or date-time ranges

    -
    - -
    -
    coord_x_date(xlim = NULL, ylim = NULL, expand = TRUE)
    -
    -coord_x_datetime(xlim = NULL, ylim = NULL, expand = TRUE)
    -
    - -
    -

    Arguments

    -
    xlim
    -

    Limits for the x axis, entered as character dates in "YYYY-MM-DD" -format for date or "YYYY-MM-DD HH:MM:SS" for date-time.

    -
    ylim
    -

    Limits for the y axis, entered as values

    -
    expand
    -

    If TRUE, the default, adds a small expansion factor to -the limits to ensure that data and axes don't overlap. If FALSE, -limits are taken exactly from the data or xlim/ylim.

    -
    -
    -

    Details

    -

    The coord_ functions prevent loss of data during zooming, which is -necessary when zooming in on plots that calculate stats using data -outside of the zoom range (e.g. when plotting moving averages -with geom_ma()). Setting limits using scale_x_date -changes the underlying data which causes moving averages to fail.

    -

    coord_x_date is a wrapper for coord_cartesian -that enables quickly zooming in on plot regions using a date range.

    -

    coord_x_datetime is a wrapper for coord_cartesian -that enables quickly zooming in on plot regions using a date-time range.

    -
    - - -
    -

    Examples

    -
    # Load libraries
    -library(tidyquant)
    -library(dplyr)
    -#> 
    -#> Attaching package: ‘dplyr’
    -#> The following objects are masked from ‘package:xts’:
    -#> 
    -#>     first, last
    -#> The following objects are masked from ‘package:stats’:
    -#> 
    -#>     filter, lag
    -#> The following objects are masked from ‘package:base’:
    -#> 
    -#>     intersect, setdiff, setequal, union
    -library(ggplot2)
    -
    -# coord_x_date
    -AAPL <- tq_get("AAPL", from = "2013-01-01", to = "2016-12-31")
    -#> Registered S3 method overwritten by 'tune':
    -#>   method                   from   
    -#>   required_pkgs.model_spec parsnip
    -AAPL %>%
    -    ggplot(aes(x = date, y = adjusted)) +
    -    geom_line() +                         # Plot stock price
    -    geom_ma(n = 50) +                     # Plot 50-day Moving Average
    -    geom_ma(n = 200, color = "red") +     # Plot 200-day Moving Average
    -    # Zoom in
    -    coord_x_date(xlim = c("2016-01-01", "2016-12-31"),
    -                 ylim = c(75, 125))
    -
    -
    -
    -# coord_x_datetime
    -time_index <- seq(from = as.POSIXct("2012-05-15 07:00"),
    -                  to   = as.POSIXct("2012-05-17 18:00"),
    -                  by   = "hour")
    -set.seed(1)
    -value <- rnorm(n = length(time_index))
    -hourly_data <- tibble(time.index = time_index,
    -                      value      = value)
    -hourly_data %>%
    -    ggplot(aes(x = time.index, y = value)) +
    -    geom_point() +
    -    coord_x_datetime(xlim = c("2012-05-15 07:00:00", "2012-05-15 16:00:00"))
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/deprecated.html b/docs/reference/deprecated.html deleted file mode 100644 index ddec3ea0..00000000 --- a/docs/reference/deprecated.html +++ /dev/null @@ -1,156 +0,0 @@ - -Deprecated functions — deprecated • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    A record of functions that have been deprecated.

    -
    - -
    -
    tq_transform(data, ohlc_fun = OHLCV, mutate_fun, col_rename = NULL, ...)
    -
    -tq_transform_xy(data, x, y = NULL, mutate_fun, col_rename = NULL, ...)
    -
    - -
    -

    Arguments

    -
    data
    -

    A tibble (tidy data frame) of data typically from tq_get().

    -
    ohlc_fun
    -

    Deprecated. Use select.

    -
    mutate_fun
    -

    The mutation function from either the xts, -quantmod, or TTR package. Execute tq_mutate_fun_options() -to see the full list of options by package.

    -
    col_rename
    -

    A string or character vector containing names that can be used -to quickly rename columns.

    -
    ...
    -

    Additional parameters passed to the appropriate mutatation -function.

    -
    x
    -

    Parameters used with _xy that consist of column names of variables -to be passed to the mutatation function (instead of OHLC functions).

    -
    y
    -

    Parameters used with _xy that consist of column names of variables -to be passed to the mutatation function (instead of OHLC functions).

    -
    -
    -

    Details

    - -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/excel_date_functions.html b/docs/reference/excel_date_functions.html deleted file mode 100644 index da4fe81a..00000000 --- a/docs/reference/excel_date_functions.html +++ /dev/null @@ -1,547 +0,0 @@ - -Excel Date and Time Functions — excel_date_functions • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    50+ date and time functions familiar to users coming from an Excel Background. -The main benefits are:

    1. Integration of the amazing lubridate package for handling dates and times

    2. -
    3. Integration of Holidays from timeDate and Business Calendars

    4. -
    5. New Date Math and Date Sequence Functions that factor in Business Calendars (e.g. EOMONTH(), NET_WORKDAYS())

    6. -

    These functions are designed to help users coming from an Excel background. -Most functions replicate the behavior of Excel:

    • Names in most cases match Excel function names

    • -
    • Functionality replicates Excel

    • -
    • By default, missing values are ignored (same as in Excel)

    • -
    - -
    -
    AS_DATE(x, ...)
    -
    -AS_DATETIME(x, ...)
    -
    -DATE(year, month, day)
    -
    -DATEVALUE(x, ...)
    -
    -YMD(x, ...)
    -
    -MDY(x, ...)
    -
    -DMY(x, ...)
    -
    -YMD_HMS(x, ...)
    -
    -MDY_HMS(x, ...)
    -
    -DMY_HMS(x, ...)
    -
    -YMD_HM(x, ...)
    -
    -MDY_HM(x, ...)
    -
    -DMY_HM(x, ...)
    -
    -YMD_H(x, ...)
    -
    -MDY_H(x, ...)
    -
    -DMY_H(x, ...)
    -
    -WEEKDAY(x, ..., label = FALSE, abbr = TRUE)
    -
    -WDAY(x, ..., label = FALSE, abbr = TRUE)
    -
    -DOW(x, ..., label = FALSE, abbr = TRUE)
    -
    -MONTHDAY(x, ...)
    -
    -MDAY(x, ...)
    -
    -DOM(x, ...)
    -
    -QUARTERDAY(x, ...)
    -
    -QDAY(x, ...)
    -
    -DAY(x, ...)
    -
    -WEEKNUM(x, ...)
    -
    -WEEK(x, ...)
    -
    -WEEKNUM_ISO(x, ...)
    -
    -MONTH(x, ..., label = FALSE, abbr = TRUE)
    -
    -QUARTER(x, ..., include_year = FALSE, fiscal_start = 1)
    -
    -YEAR(x, ...)
    -
    -YEAR_ISO(x, ...)
    -
    -DATE_TO_NUMERIC(x, ...)
    -
    -DATE_TO_DECIMAL(x, ...)
    -
    -SECOND(x, ...)
    -
    -MINUTE(x, ...)
    -
    -HOUR(x, ...)
    -
    -NOW(...)
    -
    -TODAY(...)
    -
    -EOMONTH(start_date, months = 0)
    -
    -EDATE(start_date, months = 0)
    -
    -NET_WORKDAYS(start_date, end_date, remove_weekends = TRUE, holidays = NULL)
    -
    -COUNT_DAYS(start_date, end_date)
    -
    -YEARFRAC(start_date, end_date)
    -
    -DATE_SEQUENCE(start_date, end_date, by = "day")
    -
    -WORKDAY_SEQUENCE(start_date, end_date, remove_weekends = TRUE, holidays = NULL)
    -
    -HOLIDAY_SEQUENCE(
    -  start_date,
    -  end_date,
    -  calendar = c("NYSE", "LONDON", "NERC", "TSX", "ZURICH")
    -)
    -
    -HOLIDAY_TABLE(years, pattern = ".")
    -
    -FLOOR_DATE(x, ..., by = "day")
    -
    -FLOOR_DAY(x, ...)
    -
    -FLOOR_WEEK(x, ...)
    -
    -FLOOR_MONTH(x, ...)
    -
    -FLOOR_QUARTER(x, ...)
    -
    -FLOOR_YEAR(x, ...)
    -
    -CEILING_DATE(x, ..., by = "day")
    -
    -CEILING_DAY(x, ...)
    -
    -CEILING_WEEK(x, ...)
    -
    -CEILING_MONTH(x, ...)
    -
    -CEILING_QUARTER(x, ...)
    -
    -CEILING_YEAR(x, ...)
    -
    -ROUND_DATE(x, ..., by = "day")
    -
    -ROUND_DAY(x, ...)
    -
    -ROUND_WEEK(x, ...)
    -
    -ROUND_MONTH(x, ...)
    -
    -ROUND_QUARTER(x, ...)
    -
    -ROUND_YEAR(x, ...)
    -
    - -
    -

    Arguments

    -
    x
    -

    A vector of date or date-time objects

    -
    ...
    -

    Parameters passed to underlying lubridate functions.

    -
    year
    -

    Used in DATE()

    -
    month
    -

    Used in DATE()

    -
    day
    -

    Used in DATE()

    -
    label
    -

    A logical used for MONTH() and WEEKDAY() Date Extractors to decide whether or not to return names -(as ordered factors) or numeric values.

    -
    abbr
    -

    A logical used for MONTH() and WEEKDAY(). If label = TRUE, used to determine if -full names (e.g. Wednesday) or abbreviated names (e.g. Wed) should be returned.

    -
    include_year
    -

    A logicial value used in QUARTER(). Determines whether or not to return 2020 Q3 as 3 or 2020.3.

    -
    fiscal_start
    -

    A numeric value used in QUARTER(). Determines the fiscal-year starting quarter.

    -
    start_date
    -

    Used in Date Math and Date Sequence operations. The starting date in the calculation.

    -
    months
    -

    Used to offset months in EOMONTH() AND EDATE() Date Math calculations

    -
    end_date
    -

    Used in Date Math and Date Sequence operations. The ending date in the calculation.

    -
    remove_weekends
    -

    A logical value used in Date Sequence and Date Math calculations. -Indicates whether or not weekends should be removed from the calculation.

    -
    holidays
    -

    A vector of dates corresponding to holidays that should be removed from the calculation.

    -
    by
    -

    Used to determine the gap in Date Sequence calculations and value to round to in Date Collapsing operations. -Acceptable values are: A character string, containing one of "day", "week", "month", "quarter" or "year".

    -
    calendar
    -

    The calendar to be used in Date Sequence calculations for Holidays from the timeDate package. -Acceptable values are: "NYSE", "LONDON", "NERC", "TSX", "ZURICH"

    -
    years
    -

    A numeric vector of years to return Holidays for in HOLIDAY_TABLE()

    -
    pattern
    -

    Used to filter Holidays (e.g. pattern = "Easter"). A "regular expression" filtering pattern.

    -
    -
    -

    Value

    -
    • Converters - Date or date-time object the length of x

    • -
    • Extractors - Returns information from a time-stamp.

    • -
    • Current Time - Returns the current date/date-time based on your locale.

    • -
    • Date Math - Numeric values or Date Values depending on the calculation.

    • -
    • Date Sequences - Return a vector of dates or a Holiday Table (tibble).

    • -
    • Date Collapsers - Date or date-time object the length of x

    • -
    -
    -

    Details

    -

    Converters - Make date and date-time from text (character data)

    • General String-to-Date Conversion: AS_DATE(), AS_DATETIME()

    • -
    • Format-Specific String-to-Date Conversion: YMD() (YYYY-MM-DD), MDY() (MM-DD-YYYY), DMY() (DD-MM-YYYY)

    • -
    • Hour-Minute-Second Conversion: YMD_HMS(), YMD_HM(), and friends.

    • -

    Extractors - Returns information from a time-stamp.

    • Extractors: SECOND(), MINUTE(), HOUR(), DAY(), WEEK(), MONTH(), QUARTER(), YEAR()

    • -

    Current Time - Returns the current date/date-time based on your locale.

    • NOW(), TODAY()

    • -

    Date Math - Perform popular Excel date calculations

    • EOMONTH() - End of Month

    • -
    • NET_WORKDAYS(), COUNT_DAYS() - Return number of days between 2 dates factoring in working days and holidays

    • -
    • YEARFRAC() - Return the fractional period of the year that has been completed between 2 dates.

    • -

    Date Sequences - Return a vector of dates or a Holiday Table (tibble).

    • DATE_SEQUENCE(), WORKDAY_SEQUENCE(), HOLIDAY_SEQUENCE - Return a sequence of dates between 2 dates that -factor in workdays and timeDate holiday calendars for popular business calendars including NYSE and London stock exchange.

    • -

    Date Collapsers - Collapse a date sequence (useful in dplyr::group_by() and pivot_table())

    • FLOOR_DATE(), FLOOR_DAY(), FLOOR_WEEK(), FLOOR_MONTH(), FLOOR_QUARTER(), FLOOR_YEAR()

    • -
    • Similar functions exist for CEILING and ROUND. These are wrappers for lubridate functions.

    • -
    - -
    -

    Examples

    -
    # Libraries
    -library(tidyquant)
    -library(tidyverse)
    -#> ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
    -#>  tibble  3.1.6      purrr   0.3.4
    -#>  tidyr   1.1.4      stringr 1.4.0
    -#>  readr   2.1.1      forcats 0.5.1
    -#> ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
    -#>  lubridate::as.difftime() masks base::as.difftime()
    -#>  lubridate::date()        masks base::date()
    -#>  dplyr::filter()          masks stats::filter()
    -#>  dplyr::first()           masks xts::first()
    -#>  lubridate::intersect()   masks base::intersect()
    -#>  dplyr::lag()             masks stats::lag()
    -#>  dplyr::last()            masks xts::last()
    -#>  lubridate::setdiff()     masks base::setdiff()
    -#>  lubridate::union()       masks base::union()
    -library(lubridate)
    -
    -# --- Basic Usage ----
    -
    -# Converters ---
    -AS_DATE("2011 Jan-01") # General
    -#> [1] "2011-01-01"
    -YMD("2011 Jan-01")     # Year, Month-Day Format
    -#> [1] "2011-01-01"
    -MDY("01-02-20")        # Month-Day, Year Format (January 2nd, 2020)
    -#> [1] "2020-01-02"
    -DMY("01-02-20")        # Day-Month, Year Format (February 1st, 2020)
    -#> [1] "2020-02-01"
    -
    -# Extractors ---
    -WEEKDAY("2020-01-01")                                  # Labelled Day
    -#> [1] 4
    -WEEKDAY("2020-01-01", label = FALSE)                   # Numeric Day
    -#> [1] 4
    -WEEKDAY("2020-01-01", label = FALSE, week_start = 1)   # Start at 1 (Monday) vs 7 (Sunday)
    -#> [1] 3
    -MONTH("2020-01-01")
    -#> [1] 1
    -QUARTER("2020-01-01")
    -#> [1] 1
    -YEAR("2020-01-01")
    -#> [1] 2020
    -
    -# Current Date-Time ---
    -NOW()
    -#> [1] "2021-12-30 08:31:22 EST"
    -TODAY()
    -#> [1] "2021-12-30"
    -
    -# Date Math ---
    -EOMONTH("2020-01-01")
    -#> [1] "2020-01-31"
    -EOMONTH("2020-01-01", months = 1)
    -#> [1] "2020-02-29"
    -NET_WORKDAYS("2020-01-01", "2020-07-01") # 131 Skipping Weekends
    -#> [1] 131
    -NET_WORKDAYS("2020-01-01", "2020-07-01",
    -             holidays = HOLIDAY_SEQUENCE("2020-01-01", "2020-07-01",
    -                                         calendar = "NYSE")) # 126 Skipping 5 NYSE Holidays
    -#> [1] 126
    -
    -# Date Sequences ---
    -DATE_SEQUENCE("2020-01-01", "2020-07-01")
    -#>   [1] "2020-01-01" "2020-01-02" "2020-01-03" "2020-01-04" "2020-01-05"
    -#>   [6] "2020-01-06" "2020-01-07" "2020-01-08" "2020-01-09" "2020-01-10"
    -#>  [11] "2020-01-11" "2020-01-12" "2020-01-13" "2020-01-14" "2020-01-15"
    -#>  [16] "2020-01-16" "2020-01-17" "2020-01-18" "2020-01-19" "2020-01-20"
    -#>  [21] "2020-01-21" "2020-01-22" "2020-01-23" "2020-01-24" "2020-01-25"
    -#>  [26] "2020-01-26" "2020-01-27" "2020-01-28" "2020-01-29" "2020-01-30"
    -#>  [31] "2020-01-31" "2020-02-01" "2020-02-02" "2020-02-03" "2020-02-04"
    -#>  [36] "2020-02-05" "2020-02-06" "2020-02-07" "2020-02-08" "2020-02-09"
    -#>  [41] "2020-02-10" "2020-02-11" "2020-02-12" "2020-02-13" "2020-02-14"
    -#>  [46] "2020-02-15" "2020-02-16" "2020-02-17" "2020-02-18" "2020-02-19"
    -#>  [51] "2020-02-20" "2020-02-21" "2020-02-22" "2020-02-23" "2020-02-24"
    -#>  [56] "2020-02-25" "2020-02-26" "2020-02-27" "2020-02-28" "2020-02-29"
    -#>  [61] "2020-03-01" "2020-03-02" "2020-03-03" "2020-03-04" "2020-03-05"
    -#>  [66] "2020-03-06" "2020-03-07" "2020-03-08" "2020-03-09" "2020-03-10"
    -#>  [71] "2020-03-11" "2020-03-12" "2020-03-13" "2020-03-14" "2020-03-15"
    -#>  [76] "2020-03-16" "2020-03-17" "2020-03-18" "2020-03-19" "2020-03-20"
    -#>  [81] "2020-03-21" "2020-03-22" "2020-03-23" "2020-03-24" "2020-03-25"
    -#>  [86] "2020-03-26" "2020-03-27" "2020-03-28" "2020-03-29" "2020-03-30"
    -#>  [91] "2020-03-31" "2020-04-01" "2020-04-02" "2020-04-03" "2020-04-04"
    -#>  [96] "2020-04-05" "2020-04-06" "2020-04-07" "2020-04-08" "2020-04-09"
    -#> [101] "2020-04-10" "2020-04-11" "2020-04-12" "2020-04-13" "2020-04-14"
    -#> [106] "2020-04-15" "2020-04-16" "2020-04-17" "2020-04-18" "2020-04-19"
    -#> [111] "2020-04-20" "2020-04-21" "2020-04-22" "2020-04-23" "2020-04-24"
    -#> [116] "2020-04-25" "2020-04-26" "2020-04-27" "2020-04-28" "2020-04-29"
    -#> [121] "2020-04-30" "2020-05-01" "2020-05-02" "2020-05-03" "2020-05-04"
    -#> [126] "2020-05-05" "2020-05-06" "2020-05-07" "2020-05-08" "2020-05-09"
    -#> [131] "2020-05-10" "2020-05-11" "2020-05-12" "2020-05-13" "2020-05-14"
    -#> [136] "2020-05-15" "2020-05-16" "2020-05-17" "2020-05-18" "2020-05-19"
    -#> [141] "2020-05-20" "2020-05-21" "2020-05-22" "2020-05-23" "2020-05-24"
    -#> [146] "2020-05-25" "2020-05-26" "2020-05-27" "2020-05-28" "2020-05-29"
    -#> [151] "2020-05-30" "2020-05-31" "2020-06-01" "2020-06-02" "2020-06-03"
    -#> [156] "2020-06-04" "2020-06-05" "2020-06-06" "2020-06-07" "2020-06-08"
    -#> [161] "2020-06-09" "2020-06-10" "2020-06-11" "2020-06-12" "2020-06-13"
    -#> [166] "2020-06-14" "2020-06-15" "2020-06-16" "2020-06-17" "2020-06-18"
    -#> [171] "2020-06-19" "2020-06-20" "2020-06-21" "2020-06-22" "2020-06-23"
    -#> [176] "2020-06-24" "2020-06-25" "2020-06-26" "2020-06-27" "2020-06-28"
    -#> [181] "2020-06-29" "2020-06-30" "2020-07-01"
    -WORKDAY_SEQUENCE("2020-01-01", "2020-07-01")
    -#>   [1] "2020-01-01" "2020-01-02" "2020-01-03" "2020-01-06" "2020-01-07"
    -#>   [6] "2020-01-08" "2020-01-09" "2020-01-10" "2020-01-13" "2020-01-14"
    -#>  [11] "2020-01-15" "2020-01-16" "2020-01-17" "2020-01-20" "2020-01-21"
    -#>  [16] "2020-01-22" "2020-01-23" "2020-01-24" "2020-01-27" "2020-01-28"
    -#>  [21] "2020-01-29" "2020-01-30" "2020-01-31" "2020-02-03" "2020-02-04"
    -#>  [26] "2020-02-05" "2020-02-06" "2020-02-07" "2020-02-10" "2020-02-11"
    -#>  [31] "2020-02-12" "2020-02-13" "2020-02-14" "2020-02-17" "2020-02-18"
    -#>  [36] "2020-02-19" "2020-02-20" "2020-02-21" "2020-02-24" "2020-02-25"
    -#>  [41] "2020-02-26" "2020-02-27" "2020-02-28" "2020-03-02" "2020-03-03"
    -#>  [46] "2020-03-04" "2020-03-05" "2020-03-06" "2020-03-09" "2020-03-10"
    -#>  [51] "2020-03-11" "2020-03-12" "2020-03-13" "2020-03-16" "2020-03-17"
    -#>  [56] "2020-03-18" "2020-03-19" "2020-03-20" "2020-03-23" "2020-03-24"
    -#>  [61] "2020-03-25" "2020-03-26" "2020-03-27" "2020-03-30" "2020-03-31"
    -#>  [66] "2020-04-01" "2020-04-02" "2020-04-03" "2020-04-06" "2020-04-07"
    -#>  [71] "2020-04-08" "2020-04-09" "2020-04-10" "2020-04-13" "2020-04-14"
    -#>  [76] "2020-04-15" "2020-04-16" "2020-04-17" "2020-04-20" "2020-04-21"
    -#>  [81] "2020-04-22" "2020-04-23" "2020-04-24" "2020-04-27" "2020-04-28"
    -#>  [86] "2020-04-29" "2020-04-30" "2020-05-01" "2020-05-04" "2020-05-05"
    -#>  [91] "2020-05-06" "2020-05-07" "2020-05-08" "2020-05-11" "2020-05-12"
    -#>  [96] "2020-05-13" "2020-05-14" "2020-05-15" "2020-05-18" "2020-05-19"
    -#> [101] "2020-05-20" "2020-05-21" "2020-05-22" "2020-05-25" "2020-05-26"
    -#> [106] "2020-05-27" "2020-05-28" "2020-05-29" "2020-06-01" "2020-06-02"
    -#> [111] "2020-06-03" "2020-06-04" "2020-06-05" "2020-06-08" "2020-06-09"
    -#> [116] "2020-06-10" "2020-06-11" "2020-06-12" "2020-06-15" "2020-06-16"
    -#> [121] "2020-06-17" "2020-06-18" "2020-06-19" "2020-06-22" "2020-06-23"
    -#> [126] "2020-06-24" "2020-06-25" "2020-06-26" "2020-06-29" "2020-06-30"
    -#> [131] "2020-07-01"
    -HOLIDAY_SEQUENCE("2020-01-01", "2020-07-01", calendar = "NYSE")
    -#> [1] "2020-01-01" "2020-01-20" "2020-02-17" "2020-04-10" "2020-05-25"
    -WORKDAY_SEQUENCE("2020-01-01", "2020-07-01",
    -                 holidays = HOLIDAY_SEQUENCE("2020-01-01", "2020-07-01",
    -                                             calendar = "NYSE"))
    -#>   [1] "2020-01-02" "2020-01-03" "2020-01-06" "2020-01-07" "2020-01-08"
    -#>   [6] "2020-01-09" "2020-01-10" "2020-01-13" "2020-01-14" "2020-01-15"
    -#>  [11] "2020-01-16" "2020-01-17" "2020-01-21" "2020-01-22" "2020-01-23"
    -#>  [16] "2020-01-24" "2020-01-27" "2020-01-28" "2020-01-29" "2020-01-30"
    -#>  [21] "2020-01-31" "2020-02-03" "2020-02-04" "2020-02-05" "2020-02-06"
    -#>  [26] "2020-02-07" "2020-02-10" "2020-02-11" "2020-02-12" "2020-02-13"
    -#>  [31] "2020-02-14" "2020-02-18" "2020-02-19" "2020-02-20" "2020-02-21"
    -#>  [36] "2020-02-24" "2020-02-25" "2020-02-26" "2020-02-27" "2020-02-28"
    -#>  [41] "2020-03-02" "2020-03-03" "2020-03-04" "2020-03-05" "2020-03-06"
    -#>  [46] "2020-03-09" "2020-03-10" "2020-03-11" "2020-03-12" "2020-03-13"
    -#>  [51] "2020-03-16" "2020-03-17" "2020-03-18" "2020-03-19" "2020-03-20"
    -#>  [56] "2020-03-23" "2020-03-24" "2020-03-25" "2020-03-26" "2020-03-27"
    -#>  [61] "2020-03-30" "2020-03-31" "2020-04-01" "2020-04-02" "2020-04-03"
    -#>  [66] "2020-04-06" "2020-04-07" "2020-04-08" "2020-04-09" "2020-04-13"
    -#>  [71] "2020-04-14" "2020-04-15" "2020-04-16" "2020-04-17" "2020-04-20"
    -#>  [76] "2020-04-21" "2020-04-22" "2020-04-23" "2020-04-24" "2020-04-27"
    -#>  [81] "2020-04-28" "2020-04-29" "2020-04-30" "2020-05-01" "2020-05-04"
    -#>  [86] "2020-05-05" "2020-05-06" "2020-05-07" "2020-05-08" "2020-05-11"
    -#>  [91] "2020-05-12" "2020-05-13" "2020-05-14" "2020-05-15" "2020-05-18"
    -#>  [96] "2020-05-19" "2020-05-20" "2020-05-21" "2020-05-22" "2020-05-26"
    -#> [101] "2020-05-27" "2020-05-28" "2020-05-29" "2020-06-01" "2020-06-02"
    -#> [106] "2020-06-03" "2020-06-04" "2020-06-05" "2020-06-08" "2020-06-09"
    -#> [111] "2020-06-10" "2020-06-11" "2020-06-12" "2020-06-15" "2020-06-16"
    -#> [116] "2020-06-17" "2020-06-18" "2020-06-19" "2020-06-22" "2020-06-23"
    -#> [121] "2020-06-24" "2020-06-25" "2020-06-26" "2020-06-29" "2020-06-30"
    -#> [126] "2020-07-01"
    -
    -# Date Collapsers ---
    -FLOOR_DATE(AS_DATE("2020-01-15"), by = "month")
    -#> [1] "2020-01-01"
    -CEILING_DATE(AS_DATE("2020-01-15"), by = "month")
    -#> [1] "2020-02-01"
    -CEILING_DATE(AS_DATE("2020-01-15"), by = "month") - ddays(1) # EOMONTH using lubridate
    -#> [1] "2020-01-31"
    -
    -# --- Usage with tidyverse ---
    -
    -# Calculate returns by symbol/year/quarter
    -FANG %>%
    -    pivot_table(
    -        .rows       = c(symbol, ~ QUARTER(date)),
    -        .columns    = ~ YEAR(date),
    -        .values     = ~ PCT_CHANGE_FIRSTLAST(adjusted)
    -    )
    -#> # A tibble: 16 × 6
    -#>    symbol `QUARTER(date)`  `2013`   `2014`  `2015`    `2016`
    -#>    <chr>            <int>   <dbl>    <dbl>   <dbl>     <dbl>
    -#>  1 AMZN                 1  0.0357 -0.155    0.206  -0.0681  
    -#>  2 AMZN                 2  0.0615 -0.0531   0.172   0.196   
    -#>  3 AMZN                 3  0.108  -0.0299   0.170   0.154   
    -#>  4 AMZN                 4  0.243  -0.0224   0.298  -0.104   
    -#>  5 FB                   1 -0.0864  0.101    0.0481  0.116   
    -#>  6 FB                   2 -0.0255  0.0746   0.0502 -0.0153  
    -#>  7 FB                   3  1.02    0.161    0.0344  0.123   
    -#>  8 FB                   4  0.0839  0.0192   0.151  -0.107   
    -#>  9 GOOG                 1  0.0981  0.00174  0.0442  0.00419 
    -#> 10 GOOG                 2  0.0988  0.0143  -0.0406 -0.0771  
    -#> 11 GOOG                 3 -0.0135 -0.00911  0.166   0.112   
    -#> 12 GOOG                 4  0.263  -0.0737   0.241  -0.000958
    -#> 13 NFLX                 1  1.06   -0.0297   0.194  -0.0703  
    -#> 14 NFLX                 2  0.157   0.208    0.590  -0.135   
    -#> 15 NFLX                 3  0.379  -0.0463   0.103   0.0194  
    -#> 16 NFLX                 4  0.134  -0.221    0.0793  0.206   
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/excel_financial_math_functions.html b/docs/reference/excel_financial_math_functions.html deleted file mode 100644 index dcbb62a9..00000000 --- a/docs/reference/excel_financial_math_functions.html +++ /dev/null @@ -1,221 +0,0 @@ - -Excel Financial Math Functions — excel_financial_math_functions • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    Excel financial math functions are designed to easily calculate Net Present Value (NPV()), -Future Value of cashflow (FV()), Present Value of future cashflow (PV()), and more.

    -

    These functions are designed to help users coming from an Excel background. -Most functions replicate the behavior of Excel:

    • Names are similar to Excel function names

    • -
    • By default, missing values are ignored (same as in Excel)

    • -
    - -
    -
    NPV(cashflow, rate, nper = NULL)
    -
    -IRR(cashflow)
    -
    -FV(rate, nper, pv = 0, pmt = 0, type = 0)
    -
    -PV(rate, nper, fv = 0, pmt = 0, type = 0)
    -
    -PMT(rate, nper, pv, fv = 0, type = 0)
    -
    -RATE(nper, pmt, pv, fv = 0, type = 0)
    -
    - -
    -

    Arguments

    -
    cashflow
    -

    Cash flow values. When one value is provided, it's assumed constant cash flow.

    -
    rate
    -

    One or more rate. When one rate is provided it's assumed constant rate.

    -
    nper
    -

    Number of periods. When `nper`` is provided, the cashflow values and rate are assumed constant.

    -
    pv
    -

    Present value. Initial investments (cash inflows) are typcially a negative value.

    -
    pmt
    -

    Number of payments per period.

    -
    type
    -

    Should payments (pmt) occur at the beginning (type = 0) or -the end (type = 1) of each period.

    -
    fv
    -

    Future value. Cash outflows are typically a positive value.

    -
    -
    -

    Value

    -
    • Summary functions return a single value

    • -
    -
    -

    Details

    -

    Net Present Value (NPV) -Net present value (NPV) is the difference between the present value of cash inflows and -the present value of cash outflows over a period of time. NPV is used in capital budgeting -and investment planning to analyze the profitability of a projected investment or project. -For more information, see Investopedia NPV.

    -

    Internal Rate of Return (IRR) -The internal rate of return (IRR) is a metric used in capital budgeting to estimate the -profitability of potential investments. The internal rate of return is a discount rate -that makes the net present value (NPV) of all cash flows from a particular project equal -to zero. IRR calculations rely on the same formula as NPV does. -For more information, see Investopedia IRR.

    -

    Future Value (FV) -Future value (FV) is the value of a current asset at a future date based on an assumed -rate of growth. The future value (FV) is important to investors and financial planners -as they use it to estimate how much an investment made today will be worth in the future. -Knowing the future value enables investors to make sound investment decisions based on -their anticipated needs. However, external economic factors, such as inflation, can adversely -affect the future value of the asset by eroding its value. -For more information, see Investopedia FV.

    -

    Present Value (PV) -Present value (PV) is the current value of a future sum of money or stream of cash flows given a -specified rate of return. Future cash flows are discounted at the discount rate, and the higher -the discount rate, the lower the present value of the future cash flows. Determining the -appropriate discount rate is the key to properly valuing future cash flows, whether they be earnings -or obligations. For more information, see Investopedia PV.

    -

    Payment (PMT) -The Payment PMT() function calculates the payment for a loan based on constant payments and a constant interest rate.

    -

    Rate (RATE) -Returns the interest rate per period of a loan or an investment. -For example, use 6%/4 for quarterly payments at 6% APR.

    -
    - -
    -

    Examples

    -
    
    -NPV(c(-1000, 250, 350, 450, 450), rate = 0.05)
    -#> [1] 314.4986
    -
    -IRR(c(-1000, 250, 350, 450, 450))
    -#> [1] 0.1656206
    -
    -FV(rate = 0.05, nper = 5, pv = -100, pmt = 0, type = 0)
    -#> [1] 127.6282
    -
    -PV(rate = 0.05, nper = 5, fv = -100, pmt = 0, type = 0)
    -#> [1] 78.35262
    -
    -PMT(nper = 20, rate = 0.05, pv = -100, fv = 0, type = 0)
    -#> [1] 8.024259
    -
    -RATE(nper = 20, pmt = 8, pv = -100, fv = 0, type = 0)
    -#> [1] 0.04964019
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/excel_if_functions.html b/docs/reference/excel_if_functions.html deleted file mode 100644 index cd157e37..00000000 --- a/docs/reference/excel_if_functions.html +++ /dev/null @@ -1,266 +0,0 @@ - -Excel Summarising "If" Functions — excel_if_functions • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    "IFS" functions are filtering versions of their summarization counterparts. -Simply add "cases" that filter if a condition is true. -Multiple cases are evaluated as "AND" filtering operations. -A single case with | ("OR") bars can be created to accomplish an "OR". -See details below.

    -

    These functions are designed to help users coming from an Excel background. -Most functions replicate the behavior of Excel:

    • Names are similar to Excel function names

    • -
    • By default, missing values are ignored (same as in Excel)

    • -
    - -
    -
    SUM_IFS(x, ...)
    -
    -COUNT_IFS(x, ...)
    -
    -AVERAGE_IFS(x, ...)
    -
    -MEDIAN_IFS(x, ...)
    -
    -MIN_IFS(x, ...)
    -
    -MAX_IFS(x, ...)
    -
    -CREATE_IFS(.f, ...)
    -
    - -
    -

    Arguments

    -
    x
    -

    A vector. Most functions are designed for numeric data. -Some functions like COUNT_IFS() handle multiple data types.

    -
    ...
    -

    Add cases to evaluate. See Details.

    -
    .f
    -

    A function to convert to an "IFS" function. -Use ... in this case to provide parameters to the .f like na.rm = TRUE.

    -
    -
    -

    Value

    -
    • Summary functions return a single value

    • -
    -
    -

    Details

    -

    "AND" Filtering: -Multiple cases are evaluated as "AND" filtering operations.

    -

    "OR" Filtering: -Compound single cases with | ("OR") bars can be created to accomplish an "OR". -Simply use a statement like x > 10 | x < -10 to perform an "OR" if-statement.

    -

    Creating New "Summarizing IFS" Functions: -Users can create new "IFS" functions using the CREATE_IFS() function factory. -The only requirement is that the output of your function (.f) must be a single -value (scalar). See examples below.

    -
    -
    -

    Useful functions

    - - - -

    Summary Functions - Return a single value from a vector

    • Sum: SUM_IFS()

    • -
    • Center: AVERAGE_IFS(), MEDIAN_IFS()

    • -
    • Count: COUNT_IFS()

    • -
    • Range: MIN_IFS(), MAX_IFS()

    • -

    _Create your own summary "IF" function -This is a function factory that generates summary "_IFS" functions.

    -
    - -
    -

    Examples

    -
    library(tidyverse)
    -library(tidyquant)
    -library(timetk)
    -library(stringr)
    -library(lubridate)
    -
    -# --- Basic Usage ---
    -
    -SUM_IFS(x = 1:10, x > 5)
    -#> [1] 40
    -
    -COUNT_IFS(x = letters, str_detect(x, "a|b|c"))
    -#> [1] 3
    -
    -SUM_IFS(-10:10, x > 8 | x < -5)
    -#> [1] -21
    -
    -# Create your own IFS function (Mind blowingly simple)!
    -Q75_IFS <- CREATE_IFS(.f = quantile, probs = 0.75, na.rm = TRUE)
    -Q75_IFS(1:10, x > 5)
    -#> 75% 
    -#>   9 
    -
    -# --- Usage with tidyverse ---
    -
    -# Using multiple cases IFS cases to count the frequency of days with
    -# high trade volume in a given year
    -FANG %>%
    -    group_by(symbol) %>%
    -    summarise(
    -        high_volume_in_2015 = COUNT_IFS(volume,
    -                                        year(date) == 2015,
    -                                        volume > quantile(volume, 0.75))
    -    )
    -#> # A tibble: 4 × 2
    -#>   symbol high_volume_in_2015
    -#>   <chr>                <int>
    -#> 1 AMZN                    62
    -#> 2 FB                      15
    -#> 3 GOOG                    19
    -#> 4 NFLX                    54
    -
    -# Count negative returns by month
    -FANG %>%
    -    mutate(symbol = as_factor(symbol)) %>%
    -    group_by(symbol) %>%
    -
    -    # Collapse from daily to FIRST value by month
    -    summarise_by_time(
    -        .date_var  = date,
    -        .by        = "month",
    -        adjusted   = FIRST(adjusted)
    -    ) %>%
    -
    -    # Calculate monthly returns
    -    group_by(symbol) %>%
    -    mutate(
    -        returns = PCT_CHANGE(adjusted, fill_na = 0)
    -    ) %>%
    -
    -    # Find returns less than zero and count the frequency
    -    summarise(
    -        negative_monthly_returns = COUNT_IFS(returns, returns < 0)
    -    )
    -#> # A tibble: 4 × 2
    -#>   symbol negative_monthly_returns
    -#>   <fct>                     <int>
    -#> 1 FB                           16
    -#> 2 AMZN                         16
    -#> 3 NFLX                         16
    -#> 4 GOOG                         20
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/excel_pivot_table.html b/docs/reference/excel_pivot_table.html deleted file mode 100644 index 4daf1fd7..00000000 --- a/docs/reference/excel_pivot_table.html +++ /dev/null @@ -1,214 +0,0 @@ - -Excel Pivot Table — excel_pivot_table • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    The Pivot Table is one of Excel's most powerful features, and now it's available in R! -A pivot table is a table of statistics that summarizes the data of a more extensive table -(such as from a database, spreadsheet, or business intelligence program).

    -

    These functions are designed to help users coming from an Excel background. -Most functions replicate the behavior of Excel:

    • Names are similar to Excel function names

    • -
    • Functionality replicates Excel

    • -
    - -
    -
    pivot_table(
    -  .data,
    -  .rows,
    -  .columns,
    -  .values,
    -  .filters = NULL,
    -  .sort = NULL,
    -  fill_na = NA
    -)
    -
    - -
    -

    Arguments

    -
    .data
    -

    A data.frame or tibble that contains data to summarize with a pivot table

    -
    .rows
    -

    Enter one or more groups to assess as expressions (e.g. ~ MONTH(date_column))

    -
    .columns
    -

    Enter one or more groups to assess expressions (e.g. ~ YEAR(date_column))

    -
    .values
    -

    Numeric only. Enter one or more summarization expression(s) (e.g. ~ SUM(value_column))

    -
    .filters
    -

    This argument is not yet in use

    -
    .sort
    -

    This argument is not yet in use

    -
    fill_na
    -

    A value to replace missing values with. Default is NA

    -
    -
    -

    Value

    -

    Returns a tibble that has been pivoted to summarize information by column and row groupings

    -
    -
    -

    Details

    -

    This summary might include sums, averages, or other statistics, which the pivot table groups together in a meaningful way.

    -

    The key parameters are:

    • .rows - These are groups that will appear as row-wise headings for the summarization, You can modify these groups by applying collapsing functions (e.g. (YEAR()).

    • -
    • .columns - These are groups that will appear as column headings for the summarization. You can modify these groups by applying collapsing functions (e.g. (YEAR()).

    • -
    • .values - These are numeric data that are summarized using a summary function -(e.g. SUM(), AVERAGE(), COUNT(), FIRST(), LAST(), SUM_IFS(), AVERAGE_IFS(), COUNT_IFS())

    • -

    R implementation details.

    • The pivot_table() function is powered by the tidyverse, an ecosystem of packages designed to manipulate data.

    • -
    • All of the key parameters can be expressed using a functional form:

      • Rows and Column Groupings can be collapsed. Example: .columns = ~ YEAR(order_date)

      • -
      • Values can be summarized provided a single value is returned. Example: .values = ~ SUM_IFS(order_volume >= quantile(order_volume, probs = 0.75))

      • -
      • Summarizations and Row/Column Groupings can be stacked (combined) with c(). Example: .rows = c(~ YEAR(order_date), company)

      • -
      • Bare columns (e.g. company) don not need to be prefixed with the ~.

      • -
      • All grouping and summarizing functions MUST BE prefixed with ~. Example: .rows = ~ YEAR(order_date)

      • -
    • -
    - -
    -

    Examples

    -
    library(tidyquant)
    -library(tidyverse)
    -
    -# PIVOT TABLE ----
    -# Calculate returns by year/quarter
    -FANG %>%
    -    pivot_table(
    -        .rows       = c(symbol, ~ QUARTER(date)),
    -        .columns    = ~ YEAR(date),
    -        .values     = ~ PCT_CHANGE_FIRSTLAST(adjusted)
    -    )
    -#> # A tibble: 16 × 6
    -#>    symbol `QUARTER(date)`  `2013`   `2014`  `2015`    `2016`
    -#>    <chr>            <int>   <dbl>    <dbl>   <dbl>     <dbl>
    -#>  1 AMZN                 1  0.0357 -0.155    0.206  -0.0681  
    -#>  2 AMZN                 2  0.0615 -0.0531   0.172   0.196   
    -#>  3 AMZN                 3  0.108  -0.0299   0.170   0.154   
    -#>  4 AMZN                 4  0.243  -0.0224   0.298  -0.104   
    -#>  5 FB                   1 -0.0864  0.101    0.0481  0.116   
    -#>  6 FB                   2 -0.0255  0.0746   0.0502 -0.0153  
    -#>  7 FB                   3  1.02    0.161    0.0344  0.123   
    -#>  8 FB                   4  0.0839  0.0192   0.151  -0.107   
    -#>  9 GOOG                 1  0.0981  0.00174  0.0442  0.00419 
    -#> 10 GOOG                 2  0.0988  0.0143  -0.0406 -0.0771  
    -#> 11 GOOG                 3 -0.0135 -0.00911  0.166   0.112   
    -#> 12 GOOG                 4  0.263  -0.0737   0.241  -0.000958
    -#> 13 NFLX                 1  1.06   -0.0297   0.194  -0.0703  
    -#> 14 NFLX                 2  0.157   0.208    0.590  -0.135   
    -#> 15 NFLX                 3  0.379  -0.0463   0.103   0.0194  
    -#> 16 NFLX                 4  0.134  -0.221    0.0793  0.206   
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/excel_ref_functions.html b/docs/reference/excel_ref_functions.html deleted file mode 100644 index 45e34631..00000000 --- a/docs/reference/excel_ref_functions.html +++ /dev/null @@ -1,193 +0,0 @@ - -Excel Reference Functions — excel_ref_functions • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    Excel reference functions are used to efficiently lookup values from a data source. -The most popular lookup function is "VLOOKUP", which has been implemented in R.

    -

    These functions are designed to help users coming from an Excel background. -Most functions replicate the behavior of Excel:

    • Names are similar to Excel function names

    • -
    • Functionality replicates Excel

    • -
    - -
    -
    VLOOKUP(.lookup_values, .data, .lookup_column, .return_column)
    -
    - -
    -

    Arguments

    -
    .lookup_values
    -

    One or more lookup values.

    -
    .data
    -

    A data.frame or tibble that contains values to evaluate and return

    -
    .lookup_column
    -

    The column in .data containing exact matching values of the .lookup_values

    -
    .return_column
    -

    The column in .data containing the values to return if a match is found

    -
    -
    -

    Value

    -

    Returns a vector the length of the input lookup values

    -
    -
    -

    Details

    -

    VLOOKUP() Details

    • Performs exact matching only. Fuzzy matching is not implemented.

    • -
    • Can only return values from one column only. Use dplyr::left_join() to perform table joining.

    • -
    - -
    -

    Examples

    -
    library(tidyquant)
    -library(tidyverse)
    -
    -lookup_table <- tibble(
    -    stock   = c("FB", "AMZN", "NFLX", "GOOG"),
    -    company = c("Facebook", "Amazon", "Netflix", "Google")
    -)
    -
    -# --- Basic Usage ---
    -
    -VLOOKUP("NFLX",
    -        .data = lookup_table,
    -        .lookup_column = stock,
    -        .return_column = company)
    -#> [1] "Netflix"
    -
    -# --- Usage with tidyverse ---
    -
    -# Add company names to the stock data
    -FANG %>%
    -    mutate(company = VLOOKUP(symbol, lookup_table, stock, company))
    -#> # A tibble: 4,032 × 9
    -#>    symbol date        open  high   low close    volume adjusted company 
    -#>    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl> <chr>   
    -#>  1 FB     2013-01-02  27.4  28.2  27.4  28    69846400     28   Facebook
    -#>  2 FB     2013-01-03  27.9  28.5  27.6  27.8  63140600     27.8 Facebook
    -#>  3 FB     2013-01-04  28.0  28.9  27.8  28.8  72715400     28.8 Facebook
    -#>  4 FB     2013-01-07  28.7  29.8  28.6  29.4  83781800     29.4 Facebook
    -#>  5 FB     2013-01-08  29.5  29.6  28.9  29.1  45871300     29.1 Facebook
    -#>  6 FB     2013-01-09  29.7  30.6  29.5  30.6 104787700     30.6 Facebook
    -#>  7 FB     2013-01-10  30.6  31.5  30.3  31.3  95316400     31.3 Facebook
    -#>  8 FB     2013-01-11  31.3  32.0  31.1  31.7  89598000     31.7 Facebook
    -#>  9 FB     2013-01-14  32.1  32.2  30.6  31.0  98892800     31.0 Facebook
    -#> 10 FB     2013-01-15  30.6  31.7  29.9  30.1 173242600     30.1 Facebook
    -#> # … with 4,022 more rows
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/excel_stat_functions.html b/docs/reference/excel_stat_functions.html deleted file mode 100644 index e1a547a5..00000000 --- a/docs/reference/excel_stat_functions.html +++ /dev/null @@ -1,376 +0,0 @@ - - - - - - - - -Excel Statistical Functions — excel_stat_functions • tidyquant - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    30+ common statistical functions familiar to users of Excel (e.g. SUM(), AVERAGE()).

    -

    These functions are designed to help users coming from an Excel background. -Most functions replicate the behavior of Excel:

      -
    • Names in most cases match Excel function names

    • -
    • Functionality replicates Excel

    • -
    • By default, missing values are ignored (same as in Excel)

    • -
    - -
    - -
    SUM(x)
    -
    -AVERAGE(x)
    -
    -MEDIAN(x)
    -
    -MIN(x)
    -
    -MAX(x)
    -
    -COUNT(x)
    -
    -COUNT_UNIQUE(x)
    -
    -STDEV(x)
    -
    -VAR(x)
    -
    -COR(x, y)
    -
    -COV(x, y)
    -
    -FIRST(x)
    -
    -LAST(x)
    -
    -NTH(x, n = 1)
    -
    -CHANGE_FIRSTLAST(x)
    -
    -PCT_CHANGE_FIRSTLAST(x)
    -
    -ABS(x)
    -
    -SQRT(x)
    -
    -LOG(x)
    -
    -EXP(x)
    -
    -RETURN(x, n = 1, fill_na = NA)
    -
    -PCT_CHANGE(x, n = 1, fill_na = NA)
    -
    -CHANGE(x, n = 1, fill_na = NA)
    -
    -LAG(x, n = 1, fill_na = NA)
    -
    -LEAD(x, n = 1, fill_na = NA)
    -
    -CUMULATIVE_SUM(x)
    -
    -CUMULATIVE_PRODUCT(x)
    -
    -CUMULATIVE_MAX(x)
    -
    -CUMULATIVE_MIN(x)
    -
    -CUMULATIVE_MEAN(x)
    -
    -CUMULATIVE_MEDIAN(x)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    x

    A vector. Most functions are designed for numeric data. -Some functions like COUNT() handle multiple data types.

    y

    A vector. Used in functions requiring 2 inputs.

    n

    Values to offset. Used in functions like LAG(), LEAD(), and PCT_CHANGE()

    fill_na

    Fill missing (NA) values with a different value. Used in offsetting functions.

    - -

    Value

    - - -
      -
    • Summary functions return a single value

    • -
    • Mutation functions return a mutated version of the vector

    • -
    • Logical evaluations functions returns a boolean version of the vector

    • -
    - -

    Details

    - -

    Summary Functions

      -
    • All functions remove missing values (NA). This is the same behavior as in Excel and most commonly what is desired.

    • -
    - -

    Useful functions

    - - - - -

    Summary Functions - Return a single value from a vector

      -
    • Sum: SUM()

    • -
    • Center: AVERAGE(), MEDIAN()

    • -
    • Spread: STDEV(), VAR()

    • -
    • Range: MIN(), MAX()

    • -
    • Count: COUNT(), COUNT_UNIQUE()

    • -
    • Position: FIRST(), LAST(), NTH()

    • -
    • Change (Summary): CHANGE_FIRSTLAST(), PCT_CHANGE_FIRSTLAST()

    • -
    • Correlation: COR(), COV()

    • -
    - -

    Mutation Functions - Transforms a vector

      -
    • Transformation: ABS(), SQRT(), LOG(), EXP()

    • -
    • Lags & Change (Offsetting Functions): CHANGE(), PCT_CHANGE(), LAG(), LEAD()

    • -
    • Cumulative Totals: CUMULATIVE_SUM(), CUMULATIVE_PRODUCT()

    • -
    - - -

    Examples

    -
    # Libraries -library(tidyquant) -library(tidyverse) -library(forcats) - -# --- Basic Usage ---- - -SUM(1:10)
    #> [1] 55
    -CUMULATIVE_SUM(1:10)
    #> [1] 1 3 6 10 15 21 28 36 45 55
    -PCT_CHANGE(c(21, 24, 22, 25), fill_na = 0)
    #> [1] 0.00000000 0.14285714 -0.08333333 0.13636364
    -PCT_CHANGE_FIRSTLAST(c(21, 24, 22, 25))
    #> [1] 0.1904762
    -# --- Usage with tidyverse --- - -# Go from daily to monthly periodicity, -# then calculate returns and growth of $1 USD -FANG %>% - mutate(symbol = as_factor(symbol)) %>% - group_by(symbol) %>% - - # Collapse from daily to FIRST value by month - summarise_by_time( - .date_var = date, - .time_unit = "month", - adjusted = FIRST(adjusted) - ) %>% - - # Calculate monthly returns and cumulative growth of $1 USD - group_by(symbol) %>% - mutate( - returns = PCT_CHANGE(adjusted, fill_na = 0), - growth = CUMULATIVE_SUM(returns) + 1 - )
    #> # A tibble: 836 x 6 -#> # Groups: symbol [4] -#> symbol date .time_unit adjusted returns growth -#> <fct> <date> <chr> <dbl> <dbl> <dbl> -#> 1 FB 2012-12-30 month 28 0 1 -#> 2 FB 2013-01-06 month 29.4 0.0507 1.05 -#> 3 FB 2013-01-13 month 31.0 0.0520 1.10 -#> 4 FB 2013-01-20 month 30.7 -0.00711 1.10 -#> 5 FB 2013-01-27 month 32.5 0.0566 1.15 -#> 6 FB 2013-02-03 month 28.1 -0.134 1.02 -#> 7 FB 2013-02-10 month 28.3 0.00534 1.02 -#> 8 FB 2013-02-17 month 28.9 0.0237 1.05 -#> 9 FB 2013-02-24 month 27.3 -0.0574 0.990 -#> 10 FB 2013-03-03 month 27.7 0.0165 1.01 -#> # … with 826 more rows
    -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/excel_stat_mutation_functions.html b/docs/reference/excel_stat_mutation_functions.html deleted file mode 100644 index 5cdffc3b..00000000 --- a/docs/reference/excel_stat_mutation_functions.html +++ /dev/null @@ -1,242 +0,0 @@ - -Excel Statistical Mutation Functions — excel_stat_mutation_functions • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    15+ common statistical functions familiar to users of Excel (e.g. ABS(), SQRT()) -that modify / transform a series of values -(i.e. a vector of the same length of the input is returned).

    -

    These functions are designed to help users coming from an Excel background. -Most functions replicate the behavior of Excel:

    • Names in most cases match Excel function names

    • -
    • Functionality replicates Excel

    • -
    • By default, missing values are ignored (same as in Excel)

    • -
    - -
    -
    ABS(x)
    -
    -SQRT(x)
    -
    -LOG(x)
    -
    -EXP(x)
    -
    -RETURN(x, n = 1, fill_na = NA)
    -
    -PCT_CHANGE(x, n = 1, fill_na = NA)
    -
    -CHANGE(x, n = 1, fill_na = NA)
    -
    -LAG(x, n = 1, fill_na = NA)
    -
    -LEAD(x, n = 1, fill_na = NA)
    -
    -CUMULATIVE_SUM(x)
    -
    -CUMULATIVE_PRODUCT(x)
    -
    -CUMULATIVE_MAX(x)
    -
    -CUMULATIVE_MIN(x)
    -
    -CUMULATIVE_MEAN(x)
    -
    -CUMULATIVE_MEDIAN(x)
    -
    - -
    -

    Arguments

    -
    x
    -

    A vector. Most functions are designed for numeric data.

    -
    n
    -

    Values to offset. Used in functions like LAG(), LEAD(), and PCT_CHANGE()

    -
    fill_na
    -

    Fill missing (NA) values with a different value. Used in offsetting functions.

    -
    -
    -

    Value

    -
    • Mutation functions return a mutated / transformed version of the vector

    • -
    -
    -

    Useful functions

    - - - -

    Mutation Functions - Transforms a vector

    • Transformation: ABS(), SQRT(), LOG(), EXP()

    • -
    • Lags & Change (Offsetting Functions): CHANGE(), PCT_CHANGE(), LAG(), LEAD()

    • -
    • Cumulative Totals: CUMULATIVE_SUM(), CUMULATIVE_PRODUCT()

    • -
    - -
    -

    Examples

    -
    # Libraries
    -library(tidyquant)
    -library(timetk)
    -library(tidyverse)
    -library(forcats)
    -
    -# --- Basic Usage ----
    -
    -CUMULATIVE_SUM(1:10)
    -#>  [1]  1  3  6 10 15 21 28 36 45 55
    -
    -PCT_CHANGE(c(21, 24, 22, 25), fill_na = 0)
    -#> [1]  0.00000000  0.14285714 -0.08333333  0.13636364
    -
    -# --- Usage with tidyverse ---
    -
    -# Go from daily to monthly periodicity,
    -# then calculate returns and growth of $1 USD
    -FANG %>%
    -    mutate(symbol = as_factor(symbol)) %>%
    -    group_by(symbol) %>%
    -
    -    # Summarization - Collapse from daily to FIRST value by month
    -    summarise_by_time(
    -        .date_var  = date,
    -        .by        = "month",
    -        adjusted   = FIRST(adjusted)
    -    ) %>%
    -
    -    # Mutation - Calculate monthly returns and cumulative growth of $1 USD
    -    group_by(symbol) %>%
    -    mutate(
    -        returns = PCT_CHANGE(adjusted, fill_na = 0),
    -        growth  = CUMULATIVE_SUM(returns) + 1
    -    )
    -#> # A tibble: 192 × 5
    -#> # Groups:   symbol [4]
    -#>    symbol date       adjusted returns growth
    -#>    <fct>  <date>        <dbl>   <dbl>  <dbl>
    -#>  1 FB     2013-01-01     28    0       1    
    -#>  2 FB     2013-02-01     29.7  0.0618  1.06 
    -#>  3 FB     2013-03-01     27.8 -0.0656  0.996
    -#>  4 FB     2013-04-01     25.5 -0.0810  0.915
    -#>  5 FB     2013-05-01     27.4  0.0744  0.990
    -#>  6 FB     2013-06-01     23.8 -0.131   0.859
    -#>  7 FB     2013-07-01     24.8  0.0403  0.899
    -#>  8 FB     2013-08-01     37.5  0.511   1.41 
    -#>  9 FB     2013-09-01     41.9  0.117   1.53 
    -#> 10 FB     2013-10-01     50.4  0.204   1.73 
    -#> # … with 182 more rows
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/excel_stat_summary_functions.html b/docs/reference/excel_stat_summary_functions.html deleted file mode 100644 index c8b8e9da..00000000 --- a/docs/reference/excel_stat_summary_functions.html +++ /dev/null @@ -1,245 +0,0 @@ - -Excel Statistical Summary Functions — excel_stat_summary_functions • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    15+ common statistical functions familiar to users of Excel (e.g. SUM(), AVERAGE()). -These functions return a single value (i.e. a vector of length 1).

    -

    These functions are designed to help users coming from an Excel background. -Most functions replicate the behavior of Excel:

    • Names in most cases match Excel function names

    • -
    • Functionality replicates Excel

    • -
    • By default, missing values are ignored (same as in Excel)

    • -
    - -
    -
    SUM(x)
    -
    -AVERAGE(x)
    -
    -MEDIAN(x)
    -
    -MIN(x)
    -
    -MAX(x)
    -
    -COUNT(x)
    -
    -COUNT_UNIQUE(x)
    -
    -STDEV(x)
    -
    -VAR(x)
    -
    -COR(x, y)
    -
    -COV(x, y)
    -
    -FIRST(x)
    -
    -LAST(x)
    -
    -NTH(x, n = 1)
    -
    -CHANGE_FIRSTLAST(x)
    -
    -PCT_CHANGE_FIRSTLAST(x)
    -
    - -
    -

    Arguments

    -
    x
    -

    A vector. Most functions are designed for numeric data. -Some functions like COUNT() handle multiple data types.

    -
    y
    -

    A vector. Used in functions requiring 2 inputs.

    -
    n
    -

    A single value used in NTH() to select a specific element location to return.

    -
    -
    -

    Value

    -
    • Summary functions return a single value

    • -
    -
    -

    Details

    -

    Summary Functions

    • All functions remove missing values (NA). This is the same behavior as in Excel and most commonly what is desired.

    • -
    -
    -

    Useful functions

    - - - -

    Summary Functions - Return a single value from a vector

    • Sum: SUM()

    • -
    • Center: AVERAGE(), MEDIAN()

    • -
    • Spread: STDEV(), VAR()

    • -
    • Range: MIN(), MAX()

    • -
    • Count: COUNT(), COUNT_UNIQUE()

    • -
    • Position: FIRST(), LAST(), NTH()

    • -
    • Change (Summary): CHANGE_FIRSTLAST(), PCT_CHANGE_FIRSTLAST()

    • -
    • Correlation: COR(), COV()

    • -
    - -
    -

    Examples

    -
    # Libraries
    -library(tidyquant)
    -library(timetk)
    -library(tidyverse)
    -library(forcats)
    -
    -# --- Basic Usage ----
    -
    -SUM(1:10)
    -#> [1] 55
    -
    -PCT_CHANGE_FIRSTLAST(c(21, 24, 22, 25))
    -#> [1] 0.1904762
    -
    -# --- Usage with tidyverse ---
    -
    -# Go from daily to monthly periodicity,
    -# then calculate returns and growth of $1 USD
    -FANG %>%
    -    mutate(symbol = as_factor(symbol)) %>%
    -    group_by(symbol) %>%
    -
    -    # Summarization - Collapse from daily to FIRST value by month
    -    summarise_by_time(
    -        .date_var  = date,
    -        .by        = "month",
    -        adjusted   = FIRST(adjusted)
    -    )
    -#> # A tibble: 192 × 3
    -#> # Groups:   symbol [4]
    -#>    symbol date       adjusted
    -#>    <fct>  <date>        <dbl>
    -#>  1 FB     2013-01-01     28  
    -#>  2 FB     2013-02-01     29.7
    -#>  3 FB     2013-03-01     27.8
    -#>  4 FB     2013-04-01     25.5
    -#>  5 FB     2013-05-01     27.4
    -#>  6 FB     2013-06-01     23.8
    -#>  7 FB     2013-07-01     24.8
    -#>  8 FB     2013-08-01     37.5
    -#>  9 FB     2013-09-01     41.9
    -#> 10 FB     2013-10-01     50.4
    -#> # … with 182 more rows
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/figures/sample_img_1_volatility.R b/docs/reference/figures/sample_img_1_volatility.R deleted file mode 100644 index 7572782d..00000000 --- a/docs/reference/figures/sample_img_1_volatility.R +++ /dev/null @@ -1,42 +0,0 @@ -library(tidyquant) - -# Get some data -FANG <- c("FB", "AMZN", "NFLX", "GOOG") %>% - tq_get(get = "stock.prices", from = "2007-01-01", to = "2017-01-01") - -# Setup dates for zoom window -end <- ymd("2017-01-01") -start <- end - weeks(20) - -# Visualize!!! -n_mavg <- 20 # Number of periods (days) for moving average -FANG %>% - filter(date >= start - days(2 * n_mavg)) %>% - ggplot(aes(x = date, y = close, group = symbol)) + - geom_candlestick(aes(open = open, close = close, high = high, low = low)) + - geom_bbands(aes(high = high, low = low, close = close), - ma_fun = SMA, n = n_mavg, sd = 2, size = 0.5) + - labs(title = "Multiple Stocks at Once!", - subtitle = "Quickly visualize the volatility of four stocks at once", - x = "", y = "Closing Price") + - coord_x_date(xlim = c(start, end)) + - facet_wrap(~ symbol, scales = "free_y") + - theme_tq() + - scale_y_continuous(labels = scales::dollar) - -ggsave("img/sample_img_1_volatility.png") - -# Website - -# FANG %>% -# filter(date >= start - days(2 * n_mavg)) %>% -# ggplot(aes(x = date, y = close, group = symbol)) + -# geom_candlestick(aes(open = open, close = close, high = high, low = low)) + -# geom_bbands(aes(high = high, low = low, close = close), -# ma_fun = SMA, n = n_mavg, sd = 2, size = 0.5) + -# coord_x_date(xlim = c(start, end)) + -# facet_wrap(~ symbol, scales = "free_y") + -# theme_tq() + -# scale_y_continuous(labels = scales::dollar) -# -# ggsave("docs/README_1_volatility.png", width = 8, height = 4.5) diff --git a/docs/reference/figures/sample_img_1_volatility.png b/docs/reference/figures/sample_img_1_volatility.png deleted file mode 100644 index 8386e285..00000000 Binary files a/docs/reference/figures/sample_img_1_volatility.png and /dev/null differ diff --git a/docs/reference/figures/sample_img_2_stock_returns.R b/docs/reference/figures/sample_img_2_stock_returns.R deleted file mode 100644 index 2d274c3a..00000000 --- a/docs/reference/figures/sample_img_2_stock_returns.R +++ /dev/null @@ -1,46 +0,0 @@ -library(tidyquant) - -# Get some data -FANG <- c("FB", "AMZN", "NFLX", "GOOG") %>% - tq_get(get = "stock.prices", from = "2013-01-01", to = "2017-01-01") - -# Transform to monthly returns using split, apply, combine framework -# tq_transform can be passed the quantmod::periodReturn function to get returns -FANG_returns <- FANG %>% - group_by(symbol) %>% - tq_transmute(select = adjusted, - mutate_fun = periodReturn, - period = "monthly", - col_rename = "returns") - -# Get wealth index with a quick mutation cumprod(1 + return) -init_investment <- 10000 -FANG_wealth <- FANG_returns %>% - mutate(wealth.index = init_investment * cumprod(1 + returns)) - -# Visualize!!! -FANG_wealth %>% - ggplot(aes(x = date, y = wealth.index, color = symbol)) + - geom_line(size = 2) + - geom_smooth(method = "loess") + - labs(title = "Individual Stocks: Comparing the Growth of $10K", - subtitle = "Quickly visualize stock performance", - x = "", y = "Investment Value") + - theme_tq() + - scale_color_tq() + - scale_y_continuous(labels = scales::dollar) - -ggsave("img/sample_img_2_stock_returns.png") - -# Website - -# FANG_wealth %>% -# ggplot(aes(x = date, y = wealth.index, color = symbol)) + -# geom_line(size = 2) + -# geom_smooth(method = "loess") + -# labs(x = "", y = "Investment Value") + -# theme_tq() + -# scale_color_tq() + -# scale_y_continuous(labels = scales::dollar) -# -# ggsave("docs/README_2_returns.png", height = 4.5, width = 8) diff --git a/docs/reference/figures/sample_img_2_stock_returns.png b/docs/reference/figures/sample_img_2_stock_returns.png deleted file mode 100644 index 297b263e..00000000 Binary files a/docs/reference/figures/sample_img_2_stock_returns.png and /dev/null differ diff --git a/docs/reference/figures/sample_img_3_portfolio_returns.R b/docs/reference/figures/sample_img_3_portfolio_returns.R deleted file mode 100644 index 2d56b01b..00000000 --- a/docs/reference/figures/sample_img_3_portfolio_returns.R +++ /dev/null @@ -1,80 +0,0 @@ -library(tidyquant) - -# Get some data -FANG <- c("FB", "AMZN", "NFLX", "GOOG") %>% - tq_get(get = "stock.prices", from = "2013-01-01", to = "2017-01-01") - -# Transform to monthly returns using split, apply, combine framework -# tq_transform can be passed the quantmod::periodReturn function to get returns -FANG_returns <- FANG %>% - group_by(symbol) %>% - tq_transmute(select = adjusted, - mutate_fun = periodReturn, - period = "monthly", - col_rename = "returns") - -# Create and aggregate portfolios in three steps -# A: Make portfolio by mapping weights -FANG_returns_mult <- FANG_returns %>% - tq_repeat_df(n = 4) - -# B: Make weights table -weights_table <- tribble( - ~portfolio, ~stocks, ~weights, - 1, "FB", 0.50, - 1, "AMZN", 0.25, - 1, "NFLX", 0.25, - 1, "GOOG", 0.00, - - 2, "FB", 0.00, - 2, "AMZN", 0.50, - 2, "NFLX", 0.25, - 2, "GOOG", 0.25, - - 3, "FB", 0.25, - 3, "AMZN", 0.00, - 3, "NFLX", 0.50, - 3, "GOOG", 0.25, - - 4, "FB", 0.25, - 4, "AMZN", 0.25, - 4, "NFLX", 0.00, - 4, "GOOG", 0.50) %>% - group_by(portfolio) - -# C: Aggregate portfolio with tq_portfolio. Pass wealth.index = TRUE -FANG_portfolio_wealth <- FANG_returns_mult %>% - tq_portfolio(assets_col = symbol, returns_col = returns, - weights = weights_table, wealth.index = TRUE, - col_rename = "wealth.index") %>% - mutate(wealth.index = wealth.index * 10000) - -# Visualize!!! -FANG_portfolio_wealth %>% - ggplot(aes(x = date, y = wealth.index, color = factor(portfolio))) + - geom_line(size = 2) + - geom_smooth(method = "loess") + - labs(title = "Portfolios: Comparing the Growth of $10K", - subtitle = "Quickly visualize blended portfolio performance", - x = "", y = "Investment Value", - color = "Portfolio Number: ") + - theme_tq() + - scale_color_tq() + - scale_y_continuous(labels = scales::dollar) - -ggsave("img/sample_img_3_portfolio_returns.png", width = 7.64, height = 4.5) - - -# Website - -# FANG_portfolio_wealth %>% -# ggplot(aes(x = date, y = wealth.index, color = factor(portfolio))) + -# geom_line(size = 2) + -# geom_smooth(method = "loess") + -# labs(x = "", y = "Investment Value", -# color = "Portfolio Number: ") + -# theme_tq() + -# scale_color_tq() + -# scale_y_continuous(labels = scales::dollar) -# -# ggsave("docs/README_3_port_returns.png", height = 4.5, width = 8) diff --git a/docs/reference/figures/sample_img_3_portfolio_returns.png b/docs/reference/figures/sample_img_3_portfolio_returns.png deleted file mode 100644 index b859b794..00000000 Binary files a/docs/reference/figures/sample_img_3_portfolio_returns.png and /dev/null differ diff --git a/docs/reference/figures/tidyquant-logo.png b/docs/reference/figures/tidyquant-logo.png deleted file mode 100644 index 99777200..00000000 Binary files a/docs/reference/figures/tidyquant-logo.png and /dev/null differ diff --git a/docs/reference/geom_bbands-1.png b/docs/reference/geom_bbands-1.png deleted file mode 100644 index 9d313ea2..00000000 Binary files a/docs/reference/geom_bbands-1.png and /dev/null differ diff --git a/docs/reference/geom_bbands-2.png b/docs/reference/geom_bbands-2.png deleted file mode 100644 index 9d313ea2..00000000 Binary files a/docs/reference/geom_bbands-2.png and /dev/null differ diff --git a/docs/reference/geom_bbands-3.png b/docs/reference/geom_bbands-3.png deleted file mode 100644 index 9d313ea2..00000000 Binary files a/docs/reference/geom_bbands-3.png and /dev/null differ diff --git a/docs/reference/geom_bbands-4.png b/docs/reference/geom_bbands-4.png deleted file mode 100644 index 02e845c9..00000000 Binary files a/docs/reference/geom_bbands-4.png and /dev/null differ diff --git a/docs/reference/geom_bbands-5.png b/docs/reference/geom_bbands-5.png deleted file mode 100644 index 02e845c9..00000000 Binary files a/docs/reference/geom_bbands-5.png and /dev/null differ diff --git a/docs/reference/geom_bbands-6.png b/docs/reference/geom_bbands-6.png deleted file mode 100644 index 02e845c9..00000000 Binary files a/docs/reference/geom_bbands-6.png and /dev/null differ diff --git a/docs/reference/geom_bbands-7.png b/docs/reference/geom_bbands-7.png deleted file mode 100644 index 02e845c9..00000000 Binary files a/docs/reference/geom_bbands-7.png and /dev/null differ diff --git a/docs/reference/geom_bbands-8.png b/docs/reference/geom_bbands-8.png deleted file mode 100644 index 02e845c9..00000000 Binary files a/docs/reference/geom_bbands-8.png and /dev/null differ diff --git a/docs/reference/geom_bbands-9.png b/docs/reference/geom_bbands-9.png deleted file mode 100644 index 02e845c9..00000000 Binary files a/docs/reference/geom_bbands-9.png and /dev/null differ diff --git a/docs/reference/geom_bbands.html b/docs/reference/geom_bbands.html deleted file mode 100644 index 5ecfc367..00000000 --- a/docs/reference/geom_bbands.html +++ /dev/null @@ -1,338 +0,0 @@ - -Plot Bollinger Bands using Moving Averages — geom_bbands • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    Bollinger Bands plot a range around a moving average typically two standard deviations up and down. -The geom_bbands() function enables plotting Bollinger Bands quickly using various moving average functions. -The moving average functions used are specified in TTR::SMA() -from the TTR package. Use coord_x_date() to zoom into specific plot regions. -The following moving averages are available:

    - -
    -
    geom_bbands(
    -  mapping = NULL,
    -  data = NULL,
    -  position = "identity",
    -  na.rm = TRUE,
    -  show.legend = NA,
    -  inherit.aes = TRUE,
    -  ma_fun = SMA,
    -  n = 20,
    -  sd = 2,
    -  wilder = FALSE,
    -  ratio = NULL,
    -  v = 1,
    -  wts = 1:n,
    -  color_ma = "darkblue",
    -  color_bands = "red",
    -  alpha = 0.15,
    -  fill = "grey20",
    -  ...
    -)
    -
    -geom_bbands_(
    -  mapping = NULL,
    -  data = NULL,
    -  position = "identity",
    -  na.rm = TRUE,
    -  show.legend = NA,
    -  inherit.aes = TRUE,
    -  ma_fun = "SMA",
    -  n = 10,
    -  sd = 2,
    -  wilder = FALSE,
    -  ratio = NULL,
    -  v = 1,
    -  wts = 1:n,
    -  color_ma = "darkblue",
    -  color_bands = "red",
    -  alpha = 0.15,
    -  fill = "grey20",
    -  ...
    -)
    -
    - -
    -

    Arguments

    -
    mapping
    -

    Set of aesthetic mappings created by ggplot2::aes() or -ggplot2::aes_(). If specified and inherit.aes = TRUE (the -default), it is combined with the default mapping at the top level of the -plot. You must supply mapping if there is no plot mapping.

    -
    data
    -

    The data to be displayed in this layer. There are three options:

    -

    If NULL, the default, the data is inherited from the plot -data as specified in the call to ggplot2::ggplot().

    -

    A data.frame, or other object, will override the plot -data. All objects will be fortified to produce a data frame. See -ggplot2::fortify() for which variables will be created.

    -

    A function will be called with a single argument, -the plot data. The return value must be a data.frame., and -will be used as the layer data.

    -
    position
    -

    Position adjustment, either as a string, or the result of -a call to a position adjustment function.

    -
    na.rm
    -

    If TRUE, silently removes NA values, which -typically desired for moving averages.

    -
    show.legend
    -

    logical. Should this layer be included in the legends? -NA, the default, includes if any aesthetics are mapped. -FALSE never includes, and TRUE always includes. -It can also be a named logical vector to finely select the aesthetics to -display.

    -
    inherit.aes
    -

    If FALSE, overrides the default aesthetics, -rather than combining with them. This is most useful for helper functions -that define both data and aesthetics and shouldn't inherit behaviour from -the default plot specification, e.g. ggplot2::borders().

    -
    ma_fun
    -

    The function used to calculate the moving average. Seven options are -available including: SMA, EMA, WMA, DEMA, ZLEMA, VWMA, and EVWMA. The default is -SMA. See TTR::SMA() for underlying functions.

    -
    n
    -

    Number of periods to average over. Must be between 1 and -nrow(x), inclusive.

    -
    sd
    -

    The number of standard deviations to use.

    -
    wilder
    -

    logical; if TRUE, a Welles Wilder type EMA will be -calculated; see notes.

    -
    ratio
    -

    A smoothing/decay ratio. ratio overrides wilder -in EMA, and provides additional smoothing in VMA.

    -
    v
    -

    The 'volume factor' (a number in [0,1]). See Notes.

    -
    wts
    -

    Vector of weights. Length of wts vector must equal the -length of x, or n (the default).

    -
    color_ma, color_bands
    -

    Select the line color to be applied for the moving -average line and the Bollinger band line.

    -
    alpha
    -

    Used to adjust the alpha transparency for the BBand ribbon.

    -
    fill
    -

    Used to adjust the fill color for the BBand ribbon.

    -
    ...
    -

    Other arguments passed on to ggplot2::layer(). These are -often aesthetics, used to set an aesthetic to a fixed value, like -color = "red" or size = 3. They may also be parameters -to the paired geom/stat.

    -
    -
    -

    Aesthetics

    - - -

    The following aesthetics are understood (required are in bold):

    • x, Typically a date

    • -
    • high, Required to be the high price

    • -
    • low, Required to be the low price

    • -
    • close, Required to be the close price

    • -
    • volume, Required for VWMA and EVWMA

    • -
    • colour, Affects line colors

    • -
    • fill, Affects ribbon fill color

    • -
    • alpha, Affects ribbon alpha value

    • -
    • group

    • -
    • linetype

    • -
    • size

    • -
    -
    -

    See also

    -

    See individual modeling functions for underlying parameters:

    -
    - -
    -

    Examples

    -
    # Load libraries
    -library(tidyquant)
    -library(dplyr)
    -library(ggplot2)
    -
    -
    -AAPL <- tq_get("AAPL", from = "2013-01-01", to = "2016-12-31")
    -
    -# SMA
    -AAPL %>%
    -    ggplot(aes(x = date, y = close)) +
    -    geom_line() +           # Plot stock price
    -    geom_bbands(aes(high = high, low = low, close = close), ma_fun = SMA, n = 50) +
    -    coord_x_date(xlim = c(as_date("2016-12-31") - dyears(1), as_date("2016-12-31")),
    -                 ylim = c(75, 125))
    -
    -
    -
    -# EMA
    -AAPL %>%
    -   ggplot(aes(x = date, y = close)) +
    -   geom_line() +           # Plot stock price
    -   geom_bbands(aes(high = high, low = low, close = close),
    -                  ma_fun = EMA, wilder = TRUE, ratio = NULL, n = 50) +
    -   coord_x_date(xlim = c(as_date("2016-12-31") - dyears(1), as_date("2016-12-31")),
    -                ylim = c(75, 125))
    -
    -
    -
    -# VWMA
    -AAPL %>%
    -    ggplot(aes(x = date, y = close)) +
    -    geom_line() +           # Plot stock price
    -    geom_bbands(aes(high = high, low = low, close = close, volume = volume),
    -                   ma_fun = VWMA, n = 50) +
    -    coord_x_date(xlim = c(as_date("2016-12-31") - dyears(1), as_date("2016-12-31")),
    -                ylim = c(75, 125))
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/geom_chart-1.png b/docs/reference/geom_chart-1.png deleted file mode 100644 index 011e6fb2..00000000 Binary files a/docs/reference/geom_chart-1.png and /dev/null differ diff --git a/docs/reference/geom_chart-2.png b/docs/reference/geom_chart-2.png deleted file mode 100644 index 011e6fb2..00000000 Binary files a/docs/reference/geom_chart-2.png and /dev/null differ diff --git a/docs/reference/geom_chart-3.png b/docs/reference/geom_chart-3.png deleted file mode 100644 index 4465cc78..00000000 Binary files a/docs/reference/geom_chart-3.png and /dev/null differ diff --git a/docs/reference/geom_chart-4.png b/docs/reference/geom_chart-4.png deleted file mode 100644 index 4465cc78..00000000 Binary files a/docs/reference/geom_chart-4.png and /dev/null differ diff --git a/docs/reference/geom_chart-5.png b/docs/reference/geom_chart-5.png deleted file mode 100644 index 4465cc78..00000000 Binary files a/docs/reference/geom_chart-5.png and /dev/null differ diff --git a/docs/reference/geom_chart-6.png b/docs/reference/geom_chart-6.png deleted file mode 100644 index 4465cc78..00000000 Binary files a/docs/reference/geom_chart-6.png and /dev/null differ diff --git a/docs/reference/geom_chart.html b/docs/reference/geom_chart.html deleted file mode 100644 index 91a5c2f1..00000000 --- a/docs/reference/geom_chart.html +++ /dev/null @@ -1,260 +0,0 @@ - -Plot Financial Charts in ggplot2 — geom_chart • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    Financial charts provide visual cues to open, high, low, and close prices. -Use coord_x_date() to zoom into specific plot regions. -The following financial chart geoms are available:

    - -
    -
    geom_barchart(
    -  mapping = NULL,
    -  data = NULL,
    -  stat = "identity",
    -  position = "identity",
    -  na.rm = TRUE,
    -  show.legend = NA,
    -  inherit.aes = TRUE,
    -  colour_up = "darkblue",
    -  colour_down = "red",
    -  fill_up = "darkblue",
    -  fill_down = "red",
    -  ...
    -)
    -
    -geom_candlestick(
    -  mapping = NULL,
    -  data = NULL,
    -  stat = "identity",
    -  position = "identity",
    -  na.rm = TRUE,
    -  show.legend = NA,
    -  inherit.aes = TRUE,
    -  colour_up = "darkblue",
    -  colour_down = "red",
    -  fill_up = "darkblue",
    -  fill_down = "red",
    -  ...
    -)
    -
    - -
    -

    Arguments

    -
    mapping
    -

    Set of aesthetic mappings created by ggplot2::aes() or -ggplot2::aes_(). If specified and inherit.aes = TRUE (the -default), it is combined with the default mapping at the top level of the -plot. You must supply mapping if there is no plot mapping.

    -
    data
    -

    The data to be displayed in this layer. There are three options:

    -

    If NULL, the default, the data is inherited from the plot -data as specified in the call to ggplot2::ggplot().

    -

    A data.frame, or other object, will override the plot -data. All objects will be fortified to produce a data frame. See -ggplot2::fortify() for which variables will be created.

    -

    A function will be called with a single argument, -the plot data. The return value must be a data.frame., and -will be used as the layer data.

    -
    stat
    -

    The statistical transformation to use on the data for this -layer, as a string.

    -
    position
    -

    Position adjustment, either as a string, or the result of -a call to a position adjustment function.

    -
    na.rm
    -

    If TRUE, silently removes NA values, which -typically desired for moving averages.

    -
    show.legend
    -

    logical. Should this layer be included in the legends? -NA, the default, includes if any aesthetics are mapped. -FALSE never includes, and TRUE always includes. -It can also be a named logical vector to finely select the aesthetics to -display.

    -
    inherit.aes
    -

    If FALSE, overrides the default aesthetics, -rather than combining with them. This is most useful for helper functions -that define both data and aesthetics and shouldn't inherit behaviour from -the default plot specification, e.g. ggplot2::borders().

    -
    colour_up, colour_down
    -

    Select colors to be applied based on price movement -from open to close. If close >= open, colour_up is used. Otherwise, -colour_down is used. The default is "darkblue" and "red", respectively.

    -
    fill_up, fill_down
    -

    Select fills to be applied based on price movement -from open to close. If close >= open, fill_up is used. Otherwise, -fill_down is used. The default is "darkblue" and "red", respectively. -Only affects geom_candlestick.

    -
    ...
    -

    Other arguments passed on to ggplot2::layer(). These are -often aesthetics, used to set an aesthetic to a fixed value, like -color = "red" or size = 3. They may also be parameters -to the paired geom/stat.

    -
    -
    -

    Aesthetics

    - - -

    The following aesthetics are understood (required are in bold):

    • x, Typically a date

    • -
    • open, Required to be the open price

    • -
    • high, Required to be the high price

    • -
    • low, Required to be the low price

    • -
    • close, Required to be the close price

    • -
    • alpha

    • -
    • group

    • -
    • linetype

    • -
    • size

    • -
    -
    -

    See also

    -

    See individual modeling functions for underlying parameters:

    -
    - -
    -

    Examples

    -
    # Load libraries
    -library(tidyquant)
    -library(dplyr)
    -library(ggplot2)
    -
    -AAPL <- tq_get("AAPL", from = "2013-01-01", to = "2016-12-31")
    -
    -# Bar Chart
    -AAPL %>%
    -    ggplot(aes(x = date, y = close)) +
    -    geom_barchart(aes(open = open, high = high, low = low, close = close)) +
    -    geom_ma(color = "darkgreen") +
    -    coord_x_date(xlim = c("2016-01-01", "2016-12-31"),
    -                 ylim = c(75, 125))
    -
    -
    -# Candlestick Chart
    -AAPL %>%
    -    ggplot(aes(x = date, y = close)) +
    -    geom_candlestick(aes(open = open, high = high, low = low, close = close)) +
    -    geom_ma(color = "darkgreen") +
    -    coord_x_date(xlim = c("2016-01-01", "2016-12-31"),
    -                 ylim = c(75, 125))
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/geom_ma-1.png b/docs/reference/geom_ma-1.png deleted file mode 100644 index 74cdbc21..00000000 Binary files a/docs/reference/geom_ma-1.png and /dev/null differ diff --git a/docs/reference/geom_ma-2.png b/docs/reference/geom_ma-2.png deleted file mode 100644 index 74cdbc21..00000000 Binary files a/docs/reference/geom_ma-2.png and /dev/null differ diff --git a/docs/reference/geom_ma-3.png b/docs/reference/geom_ma-3.png deleted file mode 100644 index 6471a2f6..00000000 Binary files a/docs/reference/geom_ma-3.png and /dev/null differ diff --git a/docs/reference/geom_ma-4.png b/docs/reference/geom_ma-4.png deleted file mode 100644 index 367c40dc..00000000 Binary files a/docs/reference/geom_ma-4.png and /dev/null differ diff --git a/docs/reference/geom_ma-5.png b/docs/reference/geom_ma-5.png deleted file mode 100644 index 6471a2f6..00000000 Binary files a/docs/reference/geom_ma-5.png and /dev/null differ diff --git a/docs/reference/geom_ma-6.png b/docs/reference/geom_ma-6.png deleted file mode 100644 index 367c40dc..00000000 Binary files a/docs/reference/geom_ma-6.png and /dev/null differ diff --git a/docs/reference/geom_ma.html b/docs/reference/geom_ma.html deleted file mode 100644 index 6a2d89b6..00000000 --- a/docs/reference/geom_ma.html +++ /dev/null @@ -1,299 +0,0 @@ - -Plot moving averages — geom_ma • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    The underlying moving average functions used are specified in TTR::SMA() -from the TTR package. Use coord_x_date() to zoom into specific plot regions. -The following moving averages are available:

    - -
    -
    geom_ma(
    -  mapping = NULL,
    -  data = NULL,
    -  position = "identity",
    -  na.rm = TRUE,
    -  show.legend = NA,
    -  inherit.aes = TRUE,
    -  ma_fun = SMA,
    -  n = 20,
    -  wilder = FALSE,
    -  ratio = NULL,
    -  v = 1,
    -  wts = 1:n,
    -  ...
    -)
    -
    -geom_ma_(
    -  mapping = NULL,
    -  data = NULL,
    -  position = "identity",
    -  na.rm = TRUE,
    -  show.legend = NA,
    -  inherit.aes = TRUE,
    -  ma_fun = "SMA",
    -  n = 20,
    -  wilder = FALSE,
    -  ratio = NULL,
    -  v = 1,
    -  wts = 1:n,
    -  ...
    -)
    -
    - -
    -

    Arguments

    -
    mapping
    -

    Set of aesthetic mappings created by ggplot2::aes() or -ggplot2::aes_(). If specified and inherit.aes = TRUE (the -default), it is combined with the default mapping at the top level of the -plot. You must supply mapping if there is no plot mapping.

    -
    data
    -

    The data to be displayed in this layer. There are three options:

    -

    If NULL, the default, the data is inherited from the plot -data as specified in the call to ggplot2::ggplot().

    -

    A data.frame, or other object, will override the plot -data. All objects will be fortified to produce a data frame. See -ggplot2::fortify() for which variables will be created.

    -

    A function will be called with a single argument, -the plot data. The return value must be a data.frame., and -will be used as the layer data.

    -
    position
    -

    Position adjustment, either as a string, or the result of -a call to a position adjustment function.

    -
    na.rm
    -

    If TRUE, silently removes NA values, which -typically desired for moving averages.

    -
    show.legend
    -

    logical. Should this layer be included in the legends? -NA, the default, includes if any aesthetics are mapped. -FALSE never includes, and TRUE always includes. -It can also be a named logical vector to finely select the aesthetics to -display.

    -
    inherit.aes
    -

    If FALSE, overrides the default aesthetics, -rather than combining with them. This is most useful for helper functions -that define both data and aesthetics and shouldn't inherit behaviour from -the default plot specification, e.g. ggplot2::borders().

    -
    ma_fun
    -

    The function used to calculate the moving average. Seven options are -available including: SMA, EMA, WMA, DEMA, ZLEMA, VWMA, and EVWMA. The default is -SMA. See TTR::SMA() for underlying functions.

    -
    n
    -

    Number of periods to average over. Must be between 1 and -nrow(x), inclusive.

    -
    wilder
    -

    logical; if TRUE, a Welles Wilder type EMA will be -calculated; see notes.

    -
    ratio
    -

    A smoothing/decay ratio. ratio overrides wilder -in EMA, and provides additional smoothing in VMA.

    -
    v
    -

    The 'volume factor' (a number in [0,1]). See Notes.

    -
    wts
    -

    Vector of weights. Length of wts vector must equal the -length of x, or n (the default).

    -
    ...
    -

    Other arguments passed on to ggplot2::layer(). These are -often aesthetics, used to set an aesthetic to a fixed value, like -color = "red" or size = 3. They may also be parameters -to the paired geom/stat.

    -
    -
    -

    Aesthetics

    - - -

    The following aesthetics are understood (required are in bold):

    • x

    • -
    • y

    • -
    • volume, Required for VWMA and EVWMA

    • -
    • alpha

    • -
    • colour

    • -
    • group

    • -
    • linetype

    • -
    • size

    • -
    -
    -

    See also

    -

    See individual modeling functions for underlying parameters:

    -
    - -
    -

    Examples

    -
    # Load libraries
    -library(tidyquant)
    -library(dplyr)
    -library(ggplot2)
    -
    -AAPL <- tq_get("AAPL", from = "2013-01-01", to = "2016-12-31")
    -
    -# SMA
    -AAPL %>%
    -    ggplot(aes(x = date, y = adjusted)) +
    -    geom_line() +                         # Plot stock price
    -    geom_ma(ma_fun = SMA, n = 50) +                 # Plot 50-day SMA
    -    geom_ma(ma_fun = SMA, n = 200, color = "red") + # Plot 200-day SMA
    -    coord_x_date(xlim = c("2016-01-01", "2016-12-31"),
    -                 ylim = c(75, 125))                     # Zoom in
    -
    -
    -# EVWMA
    -AAPL %>%
    -    ggplot(aes(x = date, y = adjusted)) +
    -    geom_line() +                                                   # Plot stock price
    -    geom_ma(aes(volume = volume), ma_fun = EVWMA, n = 50) +   # Plot 50-day EVWMA
    -    coord_x_date(xlim = c("2016-01-01", "2016-12-31"),
    -                 ylim = c(75, 125))                                  # Zoom in
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/index.html b/docs/reference/index.html deleted file mode 100644 index 3eb8ea5a..00000000 --- a/docs/reference/index.html +++ /dev/null @@ -1,284 +0,0 @@ - -Function reference • tidyquant - - -
    -
    - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Financial APIs

    -

    Functions for getting financial data from various API sources.

    -
    -

    Get Data from APIs

    -

    -
    -

    tq_get() tq_get_options()

    -

    Get quantitative data in tibble format

    -

    tq_index() tq_exchange() tq_index_options() tq_exchange_options()

    -

    Get all stocks in a stock index or stock exchange in tibble format

    -

    API Keys

    -

    -
    -

    quandl_api_key()

    -

    Query or set Quandl API Key

    -

    quandl_search()

    -

    Search the Quandl database

    -

    av_api_key()

    -

    Set Alpha Vantage API Key

    -

    tiingo_api_key()

    -

    Set Tiingo API Key

    -

    Financial Analysis

    -

    -
    -

    Quantitative Transformations

    -

    Functions for mutating quantitative data.

    -
    -

    tq_mutate() tq_mutate_() tq_mutate_xy() tq_mutate_xy_() tq_mutate_fun_options() tq_transmute() tq_transmute_() tq_transmute_xy() tq_transmute_xy_() tq_transmute_fun_options()

    -

    Mutates quantitative data

    -

    Portfolio Aggregation

    -

    Functions for aggregating 1 or more portfolios.

    -
    -

    tq_portfolio() tq_portfolio_() tq_repeat_df()

    -

    Aggregates a group of returns by asset into portfolio returns

    -

    Performance Analytics

    -

    Functions for performing various financial performance analyses.

    -
    -

    tq_performance() tq_performance_() tq_performance_fun_options()

    -

    Computes a wide variety of summary performance metrics from stock or portfolio returns

    -

    Charting with ggplot2

    -

    Functions for creating ggplots for financial charting.

    -
    -

    geom_bbands() geom_bbands_()

    -

    Plot Bollinger Bands using Moving Averages

    -

    geom_barchart() geom_candlestick()

    -

    Plot Financial Charts in ggplot2

    -

    geom_ma() geom_ma_()

    -

    Plot moving averages

    -

    theme_tq() theme_tq_dark() theme_tq_green()

    -

    tidyquant themes for ggplot2.

    -

    palette_light() palette_dark() palette_green()

    -

    tidyquant palettes for use with scales

    -

    scale_color_tq() scale_colour_tq() scale_fill_tq()

    -

    tidyquant colors and fills for ggplot2.

    -

    coord_x_date() coord_x_datetime()

    -

    Zoom in on plot regions using date ranges or date-time ranges

    -

    Excel

    -

    -
    -

    Pivot Table, VLOOKUP, & Sum-Ifs

    -

    These Power-Excel Functions provide common functionality that power-users coming from Excel use frequently.

    -
    -

    pivot_table()

    -

    Excel Pivot Table

    -

    VLOOKUP()

    -

    Excel Reference Functions

    -

    SUM_IFS() COUNT_IFS() AVERAGE_IFS() MEDIAN_IFS() MIN_IFS() MAX_IFS() CREATE_IFS()

    -

    Excel Summarising "If" Functions

    -

    Summary Functions

    -

    These functions return a single value from a vector of values

    -
    -

    SUM() AVERAGE() MEDIAN() MIN() MAX() COUNT() COUNT_UNIQUE() STDEV() VAR() COR() COV() FIRST() LAST() NTH() CHANGE_FIRSTLAST() PCT_CHANGE_FIRSTLAST()

    -

    Excel Statistical Summary Functions

    -

    Mutation Functions

    -

    These functions return a vector of multiple values the length of the input vector

    -
    -

    ABS() SQRT() LOG() EXP() RETURN() PCT_CHANGE() CHANGE() LAG() LEAD() CUMULATIVE_SUM() CUMULATIVE_PRODUCT() CUMULATIVE_MAX() CUMULATIVE_MIN() CUMULATIVE_MEAN() CUMULATIVE_MEDIAN()

    -

    Excel Statistical Mutation Functions

    -

    Date & Time Functions

    -

    These functions provide lubridate (date & date-time) and timeDate (Business Calendar Holiday) functionality

    -
    -

    AS_DATE() AS_DATETIME() DATE() DATEVALUE() YMD() MDY() DMY() YMD_HMS() MDY_HMS() DMY_HMS() YMD_HM() MDY_HM() DMY_HM() YMD_H() MDY_H() DMY_H() WEEKDAY() WDAY() DOW() MONTHDAY() MDAY() DOM() QUARTERDAY() QDAY() DAY() WEEKNUM() WEEK() WEEKNUM_ISO() MONTH() QUARTER() YEAR() YEAR_ISO() DATE_TO_NUMERIC() DATE_TO_DECIMAL() SECOND() MINUTE() HOUR() NOW() TODAY() EOMONTH() EDATE() NET_WORKDAYS() COUNT_DAYS() YEARFRAC() DATE_SEQUENCE() WORKDAY_SEQUENCE() HOLIDAY_SEQUENCE() HOLIDAY_TABLE() FLOOR_DATE() FLOOR_DAY() FLOOR_WEEK() FLOOR_MONTH() FLOOR_QUARTER() FLOOR_YEAR() CEILING_DATE() CEILING_DAY() CEILING_WEEK() CEILING_MONTH() CEILING_QUARTER() CEILING_YEAR() ROUND_DATE() ROUND_DAY() ROUND_WEEK() ROUND_MONTH() ROUND_QUARTER() ROUND_YEAR()

    -

    Excel Date and Time Functions

    -

    Financial Functions

    -

    These functions provide common financial calcuations from Excel

    -
    -

    NPV() IRR() FV() PV() PMT() RATE()

    -

    Excel Financial Math Functions

    -

    Data Sets

    -

    -
    -

    FANG

    -

    Stock prices for the "FANG" stocks.

    -

    Tidyquant

    -

    Package level information.

    -
    -

    tidyquant

    -

    tidyquant: Integrating quantitative financial analysis tools with the tidyverse

    -

    Deprecated

    -

    -
    -

    tq_transform() tq_transform_xy()

    -

    Deprecated functions

    - - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/palette_tq-1.png b/docs/reference/palette_tq-1.png deleted file mode 100644 index 1bddcf44..00000000 Binary files a/docs/reference/palette_tq-1.png and /dev/null differ diff --git a/docs/reference/palette_tq-2.png b/docs/reference/palette_tq-2.png deleted file mode 100644 index 7950c365..00000000 Binary files a/docs/reference/palette_tq-2.png and /dev/null differ diff --git a/docs/reference/palette_tq-3.png b/docs/reference/palette_tq-3.png deleted file mode 100644 index 7950c365..00000000 Binary files a/docs/reference/palette_tq-3.png and /dev/null differ diff --git a/docs/reference/palette_tq-6.png b/docs/reference/palette_tq-6.png deleted file mode 100644 index cf9cb905..00000000 Binary files a/docs/reference/palette_tq-6.png and /dev/null differ diff --git a/docs/reference/palette_tq.html b/docs/reference/palette_tq.html deleted file mode 100644 index 88c95f47..00000000 --- a/docs/reference/palette_tq.html +++ /dev/null @@ -1,142 +0,0 @@ - -tidyquant palettes for use with scales — palette_tq • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    These palettes are mainly called internally by tidyquant scale_*_tq() functions.

    -
    - -
    -
    palette_light()
    -
    -palette_dark()
    -
    -palette_green()
    -
    - - -
    -

    Examples

    -
    library(scales)
    -#> 
    -#> Attaching package: ‘scales’
    -#> The following object is masked from ‘package:purrr’:
    -#> 
    -#>     discard
    -#> The following object is masked from ‘package:readr’:
    -#> 
    -#>     col_factor
    -scales::show_col(palette_light())
    -
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/pipe.html b/docs/reference/pipe.html deleted file mode 100644 index a7d36d99..00000000 --- a/docs/reference/pipe.html +++ /dev/null @@ -1,122 +0,0 @@ - -Pipe operator — %>% • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    See magrittr::%>% for details.

    -
    - -
    -
    lhs %>% rhs
    -
    - - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/quandl_api_key.html b/docs/reference/quandl_api_key.html deleted file mode 100644 index f668e589..00000000 --- a/docs/reference/quandl_api_key.html +++ /dev/null @@ -1,147 +0,0 @@ - -Query or set Quandl API Key — quandl_api_key • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    Query or set Quandl API Key

    -
    - -
    -
    quandl_api_key(api_key)
    -
    - -
    -

    Arguments

    -
    api_key
    -

    Optionally passed parameter to set Quandl api_key.

    -
    -
    -

    Value

    -

    Returns invisibly the currently set api_key

    -
    -
    -

    Details

    -

    A wrapper for Quandl::Quandl.api_key()

    -
    -
    -

    See also

    -

    tq_get() get = "quandl"

    -
    - -
    -

    Examples

    -
    
    -if (FALSE) {
    -quandl_api_key(api_key = "foobar")
    -}
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/quandl_search.html b/docs/reference/quandl_search.html deleted file mode 100644 index 3c0293bd..00000000 --- a/docs/reference/quandl_search.html +++ /dev/null @@ -1,153 +0,0 @@ - -Search the Quandl database — quandl_search • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    Search the Quandl database

    -
    - -
    -
    quandl_search(query, silent = FALSE, per_page = 10, ...)
    -
    - -
    -

    Arguments

    -
    query
    -

    Search terms

    -
    silent
    -

    Prints the results when FALSE.

    -
    per_page
    -

    Number of results returned per page.

    -
    ...
    -

    Additional named values that are interpretted as Quandl API parameters.

    -
    -
    -

    Value

    -

    Returns a tibble with search results.

    -
    -
    -

    Details

    -

    A wrapper for Quandl::Quandl.search()

    -
    -
    -

    See also

    -

    tq_get() get = "quandl"

    -
    - -
    -

    Examples

    -
    
    -if (FALSE) {
    -quandl_search(query = "oil")
    -}
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/scale_manual-1.png b/docs/reference/scale_manual-1.png deleted file mode 100644 index 5f103f8b..00000000 Binary files a/docs/reference/scale_manual-1.png and /dev/null differ diff --git a/docs/reference/scale_manual-2.png b/docs/reference/scale_manual-2.png deleted file mode 100644 index 4b09b495..00000000 Binary files a/docs/reference/scale_manual-2.png and /dev/null differ diff --git a/docs/reference/scale_manual-3.png b/docs/reference/scale_manual-3.png deleted file mode 100644 index 4b09b495..00000000 Binary files a/docs/reference/scale_manual-3.png and /dev/null differ diff --git a/docs/reference/scale_manual.html b/docs/reference/scale_manual.html deleted file mode 100644 index fdf63a2e..00000000 --- a/docs/reference/scale_manual.html +++ /dev/null @@ -1,178 +0,0 @@ - -tidyquant colors and fills for ggplot2. — scale_manual • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    The tidyquant scales add colors that work nicely with theme_tq().

    -
    - -
    -
    scale_color_tq(..., theme = "light")
    -
    -scale_colour_tq(..., theme = "light")
    -
    -scale_fill_tq(..., theme = "light")
    -
    - -
    -

    Arguments

    -
    ...
    -

    common discrete scale parameters: name, breaks, labels, na.value, limits and guide. See discrete_scale() for more details

    -
    theme
    -

    one of "light", "dark", or "green". This should match the theme_tq() that is used with it.

    -
    -
    -

    Details

    - -
    scale_color_tq
    -

    For use when color is specified as an aes() in a ggplot.

    - - -
    scale_fill_tq
    -

    For use when fill is specified as an aes() in a ggplot.

    - - -
    -
    -

    See also

    - -
    - -
    -

    Examples

    -
    # Load libraries
    -library(tidyquant)
    -library(dplyr)
    -library(ggplot2)
    -
    -# Get stock prices
    -stocks <- c("AAPL", "FB", "NFLX") %>%
    -    tq_get(from = "2013-01-01",
    -           to   = "2017-01-01")
    -
    -# Plot for stocks
    -g <- stocks %>%
    -    ggplot(aes(date, adjusted, color = symbol)) +
    -    geom_line() +
    -    labs(title = "Multi stock example",
    -         xlab = "Date",
    -         ylab = "Adjusted Close")
    -
    -# Plot with tidyquant theme and colors
    -g +
    -    theme_tq() +
    -    scale_color_tq()
    -
    -
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/summarise_by_time.html b/docs/reference/summarise_by_time.html deleted file mode 100644 index 9969a54f..00000000 --- a/docs/reference/summarise_by_time.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - - - -DEPRECATED - Summarise each group by time — summarise_by_time • tidyquant - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Deprecation Instructions: Please use timetk::summarise_by_time() instead.

    -

    summarise_by_time() Is a time-series variant of the popular dplyr::summarise() function.

    -

    summarise_by_time() and summarize_by_time() are synonyms.

    -
    - -
    summarise_by_time(
    -  .data,
    -  .date_var,
    -  .by = "day",
    -  ...,
    -  .type = c("floor", "ceiling", "round")
    -)
    -
    -summarize_by_time(
    -  .data,
    -  .date_var,
    -  .by = "day",
    -  ...,
    -  .type = c("floor", "ceiling", "round")
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    .data

    A tbl object or data.frame

    .date_var

    A column of date or date-time (e.g. POSIXct) data class. -If missing, attempts to auto-detect date column.

    .by

    A time unit to summarise by. -Time units are collapsed using lubridate::floor_date() or lubridate::ceiling_date().

    -

    The value can be:

      -
    • second

    • -
    • minute

    • -
    • hour

    • -
    • day

    • -
    • week

    • -
    • month

    • -
    • bimonth

    • -
    • quarter

    • -
    • season

    • -
    • halfyear

    • -
    • year

    • -
    - -

    Arbitrary unique English abbreviations as in the lubridate::period() constructor are allowed.

    ...

    Name-value pairs of summary functions. -The name will be the name of the variable in the result.

    -

    The value can be:

      -
    • A vector of length 1, e.g. min(x), n(), or sum(is.na(y)).

    • -
    • A vector of length n, e.g. quantile().

    • -
    • A data frame, to add multiple columns from a single expression.

    • -
    .type

    One of "floor", "ceiling", or "round. Defaults to "floor". See lubridate::round_date.

    - -

    Value

    - -

    An object usually of the same type as .data.

      -
    • The rows come from the underlying group_keys().

    • -
    • The columns are a combination of the grouping keys and the summary -expressions that you provide.

    • -
    • If x is grouped by more than one variable, the output will be another -grouped_df with the right-most group removed.

    • -
    • If x is grouped by one variable, or is not grouped, the output will -be a tibble.

    • -
    • Data frame attributes are not preserved, because summarise() -fundamentally creates a new data frame.

    • -
    - -

    Useful summary functions

    - - - - - -

    Methods

    - - - -

    This function is a generic, which means that packages can provide -implementations (methods) for other classes. See the documentation of -individual methods for extra arguments and differences in behaviour.

    - -

    Examples

    -
    # Libraries -library(tidyquant) -library(dplyr) - -# First adjusted price in each month -FANG %>% - group_by(symbol) %>% - summarise_by_time( - .date_var = date, - .by = "month", - adjusted = FIRST(adjusted) - )
    #> tidyquant::summarise_by_time() is deprecated. Don't fret! The timetk::summarise_by_time() replaces it.
    #> # A tibble: 192 x 3 -#> # Groups: symbol [4] -#> symbol date adjusted -#> <chr> <date> <dbl> -#> 1 AMZN 2013-01-01 257. -#> 2 AMZN 2013-02-01 265 -#> 3 AMZN 2013-03-01 266. -#> 4 AMZN 2013-04-01 262. -#> 5 AMZN 2013-05-01 248. -#> 6 AMZN 2013-06-01 267. -#> 7 AMZN 2013-07-01 282. -#> 8 AMZN 2013-08-01 306. -#> 9 AMZN 2013-09-01 289. -#> 10 AMZN 2013-10-01 321. -#> # … with 182 more rows
    -# Last adjused price in each month (day is last day of month with ceiling option) -FANG %>% - group_by(symbol) %>% - summarise_by_time( - .date_var = date, - .by = "month", - adjusted = LAST(adjusted), - .type = "ceiling")
    #> tidyquant::summarise_by_time() is deprecated. Don't fret! The timetk::summarise_by_time() replaces it.
    #> # A tibble: 192 x 3 -#> # Groups: symbol [4] -#> symbol date adjusted -#> <chr> <date> <dbl> -#> 1 AMZN 2013-02-01 266. -#> 2 AMZN 2013-03-01 264. -#> 3 AMZN 2013-04-01 266. -#> 4 AMZN 2013-05-01 254. -#> 5 AMZN 2013-06-01 269. -#> 6 AMZN 2013-07-01 278. -#> 7 AMZN 2013-08-01 301. -#> 8 AMZN 2013-09-01 281. -#> 9 AMZN 2013-10-01 313. -#> 10 AMZN 2013-11-01 364. -#> # … with 182 more rows
    -# Total Volume each year (.by is set to "year" now) -FANG %>% - group_by(symbol) %>% - summarise_by_time( - .date_var = date, - .by = "year", - adjusted = SUM(volume))
    #> tidyquant::summarise_by_time() is deprecated. Don't fret! The timetk::summarise_by_time() replaces it.
    #> # A tibble: 16 x 3 -#> # Groups: symbol [4] -#> symbol date adjusted -#> <chr> <date> <dbl> -#> 1 AMZN 2013-01-01 747905700 -#> 2 AMZN 2014-01-01 1029066700 -#> 3 AMZN 2015-01-01 956936800 -#> 4 AMZN 2016-01-01 1037105600 -#> 5 FB 2013-01-01 15143182600 -#> 6 FB 2014-01-01 11977699100 -#> 7 FB 2015-01-01 6792708200 -#> 8 FB 2016-01-01 6414357000 -#> 9 GOOG 2013-01-01 1055967100 -#> 10 GOOG 2014-01-01 626733500 -#> 11 GOOG 2015-01-01 521446300 -#> 12 GOOG 2016-01-01 461120900 -#> 13 NFLX 2013-01-01 6915790700 -#> 14 NFLX 2014-01-01 4898415200 -#> 15 NFLX 2015-01-01 4679881700 -#> 16 NFLX 2016-01-01 3228349500
    - -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.5.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/theme_tq-1.png b/docs/reference/theme_tq-1.png deleted file mode 100644 index 110ff99b..00000000 Binary files a/docs/reference/theme_tq-1.png and /dev/null differ diff --git a/docs/reference/theme_tq-2.png b/docs/reference/theme_tq-2.png deleted file mode 100644 index 5723f2e5..00000000 Binary files a/docs/reference/theme_tq-2.png and /dev/null differ diff --git a/docs/reference/theme_tq-3.png b/docs/reference/theme_tq-3.png deleted file mode 100644 index 5723f2e5..00000000 Binary files a/docs/reference/theme_tq-3.png and /dev/null differ diff --git a/docs/reference/theme_tq.html b/docs/reference/theme_tq.html deleted file mode 100644 index 260e8862..00000000 --- a/docs/reference/theme_tq.html +++ /dev/null @@ -1,165 +0,0 @@ - -tidyquant themes for ggplot2. — theme_tq • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    The theme_tq() function creates a custom theme using tidyquant colors.

    -
    - -
    -
    theme_tq(base_size = 11, base_family = "")
    -
    -theme_tq_dark(base_size = 11, base_family = "")
    -
    -theme_tq_green(base_size = 11, base_family = "")
    -
    - -
    -

    Arguments

    -
    base_size
    -

    base font size, given in pts.

    -
    base_family
    -

    base font family

    -
    -
    -

    See also

    - -
    - -
    -

    Examples

    -
    # Load libraries
    -library(tidyquant)
    -library(dplyr)
    -library(ggplot2)
    -
    -# Get stock prices
    -AAPL <- tq_get("AAPL", from = "2013-01-01", to = "2016-12-31")
    -
    -# Plot using ggplot with theme_tq
    -AAPL %>% ggplot(aes(x = date, y = close)) +
    -       geom_line() +
    -       geom_bbands(aes(high = high, low = low, close = close),
    -                   ma_fun = EMA,
    -                   wilder = TRUE,
    -                   ratio = NULL,
    -                   n = 50) +
    -       coord_x_date(xlim = c("2016-01-01", "2016-12-31"),
    -                 ylim = c(75, 125)) +
    -       labs(title = "Apple BBands",
    -            x = "Date",
    -            y = "Price") +
    -       theme_tq()
    -
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/tidyquant.html b/docs/reference/tidyquant.html deleted file mode 100644 index 419cc11f..00000000 --- a/docs/reference/tidyquant.html +++ /dev/null @@ -1,140 +0,0 @@ - -tidyquant: Integrating quantitative financial analysis tools with the tidyverse — tidyquant • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    The main advantage of tidyquant is to -bridge the gap between the best quantitative resources for collecting and -manipulating quantitative data, xts, quantmod and TTR, -and the data modeling workflow and infrastructure of the tidyverse.

    -
    - - -
    -

    Details

    -

    In this package, tidyquant functions and supporting data sets are -provided to seamlessly combine tidy tools with existing quantitative -analytics packages. The main advantage is being able to use tidy -functions with purrr for mapping and tidyr for nesting to extend modeling to -many stocks. See the tidyquant website for more information, documentation -and examples.

    -

    Users will probably be interested in the following:

    To learn more about tidyquant, start with the vignettes: -browseVignettes(package = "tidyquant")

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/tiingo_api_key.html b/docs/reference/tiingo_api_key.html deleted file mode 100644 index 290d62d5..00000000 --- a/docs/reference/tiingo_api_key.html +++ /dev/null @@ -1,148 +0,0 @@ - -Set Tiingo API Key — tiingo_api_key • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    Set Tiingo API Key

    -
    - -
    -
    tiingo_api_key(api_key)
    -
    - -
    -

    Arguments

    -
    api_key
    -

    Optionally passed parameter to set Tiingo api_key.

    -
    -
    -

    Value

    -

    Returns invisibly the currently set api_key

    -
    -
    -

    Details

    -

    A wrapper for riingo::ringo_set_token()

    -
    -
    -

    See also

    -

    tq_get() get = "tiingo"

    -
    - -
    -

    Examples

    -
    
    -if (FALSE) {
    -tiingo_api_key(api_key = "foobar")
    -}
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/tq_get.html b/docs/reference/tq_get.html deleted file mode 100644 index 6452b70b..00000000 --- a/docs/reference/tq_get.html +++ /dev/null @@ -1,297 +0,0 @@ - -Get quantitative data in tibble format — tq_get • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    Get quantitative data in tibble format

    -
    - -
    -
    tq_get(x, get = "stock.prices", complete_cases = TRUE, ...)
    -
    -tq_get_options()
    -
    - -
    -

    Arguments

    -
    x
    -

    A single character string, a character vector or tibble representing a single (or multiple) -stock symbol, metal symbol, currency combination, FRED code, etc.

    -
    get
    -

    A character string representing the type of data to get -for x. Options include:

    -
    complete_cases
    -

    Removes symbols that return an NA value due to an error with the get -call such as sending an incorrect symbol "XYZ" to get = "stock.prices". This is useful in -scaling so user does not need to -add an extra step to remove these rows. TRUE by default, and a warning -message is generated for any rows removed.

    -
    ...
    -

    Additional parameters passed to the "wrapped" -function. Investigate underlying functions to see full list of arguments. -Common optional parameters include:

    • from: Standardized for time series functions in quantmod, quandl, tiingo, alphavantager packages. -A character string representing a start date in -YYYY-MM-DD format.

    • -
    • to: Standardized for time series functions in quantmod, quandl, tiingo, alphavantager packages. -A character string representing a end date in -YYYY-MM-DD format.

    • -
    -
    -
    -

    Value

    -

    Returns data in the form of a tibble object.

    -
    -
    -

    Details

    -

    tq_get() is a consolidated function that gets data from various -web sources. The function is a wrapper for several quantmod -functions, Quandl functions, and also gets data from websources unavailable -in other packages. -The results are always returned as a tibble. The advantages -are (1) only one function is needed for all data sources and (2) the function -can be seemlessly used with the tidyverse: purrr, tidyr, and -dplyr verbs.

    -

    tq_get_options() returns a list of valid get options you can -choose from.

    -

    tq_get_stock_index_options() Is deprecated and will be removed in the -next version. Please use tq_index_options() instead.

    -
    -
    -

    See also

    -
    -
    • tq_index() to get a ful list of stocks in an index.

    • -
    • tq_exchange() to get a ful list of stocks in an exchange.

    • -
    • quandl_api_key() to set the api key for collecting data via the "quandl" -get option.

    • -
    • tiingo_api_key() to set the api key for collecting data via the "tiingo" -get option.

    • -
    • av_api_key() to set the api key for collecting data via the "alphavantage" -get option.

    • -
    -
    - -
    -

    Examples

    -
    # Load libraries
    -library(tidyquant)
    -library(tidyverse)
    -
    -# Get the list of `get` options
    -tq_get_options()
    -#>  [1] "stock.prices"       "stock.prices.japan" "dividends"         
    -#>  [4] "splits"             "economic.data"      "quandl"            
    -#>  [7] "quandl.datatable"   "tiingo"             "tiingo.iex"        
    -#> [10] "tiingo.crypto"      "alphavantager"      "alphavantage"      
    -#> [13] "rblpapi"           
    -
    -# Get stock prices for a stock from Yahoo
    -aapl_stock_prices <- tq_get("AAPL")
    -
    -# Get stock prices for multiple stocks
    -mult_stocks <- tq_get(c("FB", "AMZN"),
    -                      get  = "stock.prices",
    -                      from = "2016-01-01",
    -                      to   = "2017-01-01")
    -
    -
    -if (FALSE) {
    -
    -# --- Quandl ---
    -
    -quandl_api_key('<your_api_key>')
    -
    -# Energy data from EIA
    -tq_get("EIA/PET_MTTIMUS1_M", get = "quandl", from = "2010-01-01")
    -
    -
    -# --- Tiingo ---
    -
    -tiingo_api_key('<your_api_key>')
    -
    -# Tiingo Prices (Free alternative to Yahoo Finance!)
    -tq_get(c("AAPL", "GOOG"), get = "tiingo", from = "2010-01-01")
    -
    -# Sub-daily prices from IEX ----
    -tq_get(c("AAPL", "GOOG"),
    -       get = "tiingo.iex",
    -       from   = "2020-01-01",
    -       to     = "2020-01-15",
    -       resample_frequency = "5min")
    -
    -# Tiingo Bitcoin Prices ----
    -tq_get(c("btcusd", "btceur"),
    -       get    = "tiingo.crypto",
    -       from   = "2020-01-01",
    -       to     = "2020-01-15",
    -       resample_frequency = "5min")
    -
    -
    -# --- Alpha Vantage ---
    -
    -av_api_key('<your_api_key>')
    -
    -# Daily Time Series
    -tq_get("AAPL",
    -       get        = "alphavantager",
    -       av_fun     = "TIME_SERIES_DAILY_ADJUSTED",
    -       outputsize = "full")
    -
    -# Intraday 15 Min Interval
    -tq_get("AAPL",
    -       get        = "alphavantage",
    -       av_fun     = "TIME_SERIES_INTRADAY",
    -       interval   = "15min",
    -       outputsize = "full")
    -
    -# FX DAILY
    -tq_get("USD/EUR", get = "alphavantage", av_fun = "FX_DAILY", outputsize = "full")
    -
    -# FX REAL-TIME QUOTE
    -tq_get("USD/EUR", get = "alphavantage", av_fun = "CURRENCY_EXCHANGE_RATE")
    -
    -}
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/tq_index.html b/docs/reference/tq_index.html deleted file mode 100644 index 9e656ff8..00000000 --- a/docs/reference/tq_index.html +++ /dev/null @@ -1,184 +0,0 @@ - -Get all stocks in a stock index or stock exchange in tibble format — tq_index • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    Get all stocks in a stock index or stock exchange in tibble format

    -
    - -
    -
    tq_index(x, use_fallback = FALSE)
    -
    -tq_exchange(x)
    -
    -tq_index_options()
    -
    -tq_exchange_options()
    -
    - -
    -

    Arguments

    -
    x
    -

    A single character string, a character vector or tibble representing a -single stock index or multiple stock indexes.

    -
    use_fallback
    -

    A boolean that can be used to return a fallback data set -last downloaded when the package was updated. Useful if the website is down. -Set to FALSE by default.

    -
    -
    -

    Value

    -

    Returns data in the form of a tibble object.

    -
    -
    -

    Details

    -

    tq_index() returns the stock symbol, company name, weight, and sector of every stock -in an index. The source is -www.ssga.com.

    -

    tq_index_options() returns a list of stock indexes you can -choose from.

    -

    tq_exchange() returns the stock symbol, company, last sale price, -market capitalization, sector and industry of every stock -in an exchange. Three stock exchanges are available (AMEX, NASDAQ, and NYSE).

    -

    tq_exchange_options() returns a list of stock exchanges you can -choose from. The options are AMEX, NASDAQ and NYSE.

    -
    -
    -

    See also

    -

    tq_get() to get stock prices, financials, key stats, etc using the stock symbols.

    -
    - -
    -

    Examples

    -
    # Load libraries
    -library(tidyquant)
    -
    -# Get the list of stock index options
    -tq_index_options()
    -#> [1] "DOW"       "DOWGLOBAL" "SP400"     "SP500"     "SP600"    
    -
    -# Get all stock symbols in a stock index
    -if (FALSE) {
    -tq_index("DOW")
    -}
    -
    -# Get the list of stock exchange options
    -tq_exchange_options()
    -#> [1] "AMEX"   "NASDAQ" "NYSE"  
    -
    -# Get all stocks in a stock exchange
    -if (FALSE) {
    -tq_exchange("NYSE")
    -}
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/tq_mutate.html b/docs/reference/tq_mutate.html deleted file mode 100644 index 692dcc8b..00000000 --- a/docs/reference/tq_mutate.html +++ /dev/null @@ -1,346 +0,0 @@ - -Mutates quantitative data — tq_mutate • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    tq_mutate() adds new variables to an existing tibble; -tq_transmute() returns only newly created columns and is typically -used when periodicity changes

    -
    - -
    -
    tq_mutate(
    -  data,
    -  select = NULL,
    -  mutate_fun,
    -  col_rename = NULL,
    -  ohlc_fun = NULL,
    -  ...
    -)
    -
    -tq_mutate_(data, select = NULL, mutate_fun, col_rename = NULL, ...)
    -
    -tq_mutate_xy(data, x, y = NULL, mutate_fun, col_rename = NULL, ...)
    -
    -tq_mutate_xy_(data, x, y = NULL, mutate_fun, col_rename = NULL, ...)
    -
    -tq_mutate_fun_options()
    -
    -tq_transmute(
    -  data,
    -  select = NULL,
    -  mutate_fun,
    -  col_rename = NULL,
    -  ohlc_fun = NULL,
    -  ...
    -)
    -
    -tq_transmute_(data, select = NULL, mutate_fun, col_rename = NULL, ...)
    -
    -tq_transmute_xy(data, x, y = NULL, mutate_fun, col_rename = NULL, ...)
    -
    -tq_transmute_xy_(data, x, y = NULL, mutate_fun, col_rename = NULL, ...)
    -
    -tq_transmute_fun_options()
    -
    - -
    -

    Arguments

    -
    data
    -

    A tibble (tidy data frame) of data typically from tq_get().

    -
    select
    -

    The columns to send to the mutation function.

    -
    mutate_fun
    -

    The mutation function from either the xts, -quantmod, or TTR package. Execute tq_mutate_fun_options() -to see the full list of options by package.

    -
    col_rename
    -

    A string or character vector containing names that can be used -to quickly rename columns.

    -
    ohlc_fun
    -

    Deprecated. Use select.

    -
    ...
    -

    Additional parameters passed to the appropriate mutatation -function.

    -
    x, y
    -

    Parameters used with _xy that consist of column names of variables -to be passed to the mutatation function (instead of OHLC functions).

    -
    -
    -

    Value

    -

    Returns mutated data in the form of a tibble object.

    -
    -
    -

    Details

    -

    tq_mutate and tq_transmute are very flexible wrappers for various xts, -quantmod and TTR functions. The main advantage is the -results are returned as a tibble and the -function can be used with the tidyverse. tq_mutate is used when additional -columns are added to the return data frame. tq_transmute works exactly like tq_mutate -except it only returns the newly created columns. This is helpful when -changing periodicity where the new columns would not have the same number of rows -as the original tibble.

    -

    select specifies the columns that get passed to the mutation function. Select works -as a more flexible version of the OHLC extractor functions from quantmod where -non-OHLC data works as well. When select is NULL, all columns are selected. -In Example 1 below, close returns the "close" price and sends this to the -mutate function, periodReturn.

    -

    mutate_fun is the function that performs the work. In Example 1, this -is periodReturn, which calculates the period returns. The ... -are additional arguments passed to the mutate_fun. Think of -the whole operation in Example 1 as the close price, obtained by select = close, -being sent to the periodReturn function along -with additional arguments defining how to perform the period return, which -includes period = "daily" and type = "log". -Example 4 shows how to apply a rolling regression.

    -

    tq_mutate_xy and tq_transmute_xy are designed to enable working with mutatation -functions that require two primary inputs (e.g. EVWMA, VWAP, etc). -Example 2 shows this benefit in action: using the EVWMA function that uses -volume to define the moving average period.

    -

    tq_mutate_, tq_mutate_xy_, tq_transmute_, and tq_transmute_xy_ -are setup for Non-Standard -Evaluation (NSE). This enables programatically changing column names by modifying -the text representations. Example 5 shows the difference in implementation. -Note that character strings are being passed to the variables instead of -unquoted variable names. See vignette("nse") for more information.

    -

    tq_mutate_fun_options and tq_transmute_fun_options return a list of various -financial functions that are compatible with tq_mutate and tq_transmute, -respectively.

    -
    -
    -

    See also

    - -
    - -
    -

    Examples

    -
    # Load libraries
    -library(tidyquant)
    -library(dplyr)
    -
    -##### Basic Functionality
    -
    -fb_stock_prices  <- tq_get("FB",
    -                           get  = "stock.prices",
    -                           from = "2016-01-01",
    -                           to   = "2016-12-31")
    -
    -# Example 1: Return logarithmic daily returns using periodReturn()
    -fb_stock_prices %>%
    -    tq_mutate(select = close, mutate_fun = periodReturn,
    -              period = "daily", type = "log")
    -#> # A tibble: 252 × 9
    -#>    symbol date        open  high   low close   volume adjusted daily.returns
    -#>    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>    <dbl>    <dbl>         <dbl>
    -#>  1 FB     2016-01-04 102.  102.   99.8 102.  37912400    102.        0      
    -#>  2 FB     2016-01-05 103.  104.  102.  103.  23258200    103.        0.00498
    -#>  3 FB     2016-01-06 101.  104.  101.  103.  25096200    103.        0.00233
    -#>  4 FB     2016-01-07 100.  101.   97.3  97.9 45172900     97.9      -0.0503 
    -#>  5 FB     2016-01-08  99.9 100.   97.0  97.3 35402300     97.3      -0.00604
    -#>  6 FB     2016-01-11  97.9  98.6  95.4  97.5 29932400     97.5       0.00185
    -#>  7 FB     2016-01-12  99   100.   97.6  99.4 28395400     99.4       0.0189 
    -#>  8 FB     2016-01-13 101.  101.   95.2  95.4 33410600     95.4      -0.0404 
    -#>  9 FB     2016-01-14  95.8  98.9  92.4  98.4 48658600     98.4       0.0302 
    -#> 10 FB     2016-01-15  94.0  96.4  93.5  95.0 46132800     95.0      -0.0352 
    -#> # … with 242 more rows
    -
    -# Example 2: Use tq_mutate_xy to use functions with two columns required
    -fb_stock_prices %>%
    -    tq_mutate_xy(x = close, y = volume, mutate_fun = EVWMA,
    -                 col_rename = "EVWMA")
    -#> # A tibble: 252 × 9
    -#>    symbol date        open  high   low close   volume adjusted EVWMA
    -#>    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>    <dbl>    <dbl> <dbl>
    -#>  1 FB     2016-01-04 102.  102.   99.8 102.  37912400    102.   NA  
    -#>  2 FB     2016-01-05 103.  104.  102.  103.  23258200    103.   NA  
    -#>  3 FB     2016-01-06 101.  104.  101.  103.  25096200    103.   NA  
    -#>  4 FB     2016-01-07 100.  101.   97.3  97.9 45172900     97.9  NA  
    -#>  5 FB     2016-01-08  99.9 100.   97.0  97.3 35402300     97.3  NA  
    -#>  6 FB     2016-01-11  97.9  98.6  95.4  97.5 29932400     97.5  NA  
    -#>  7 FB     2016-01-12  99   100.   97.6  99.4 28395400     99.4  NA  
    -#>  8 FB     2016-01-13 101.  101.   95.2  95.4 33410600     95.4  NA  
    -#>  9 FB     2016-01-14  95.8  98.9  92.4  98.4 48658600     98.4  NA  
    -#> 10 FB     2016-01-15  94.0  96.4  93.5  95.0 46132800     95.0  95.0
    -#> # … with 242 more rows
    -
    -# Example 3: Using tq_mutate to work with non-OHLC data
    -tq_get("DCOILWTICO", get = "economic.data") %>%
    -    tq_mutate(select = price, mutate_fun = lag.xts, k = 1, na.pad = TRUE)
    -#> # A tibble: 2,866 × 4
    -#>    symbol     date       price lag.xts
    -#>    <chr>      <date>     <dbl>   <dbl>
    -#>  1 DCOILWTICO 2011-01-03  91.6    NA  
    -#>  2 DCOILWTICO 2011-01-04  89.4    91.6
    -#>  3 DCOILWTICO 2011-01-05  90.3    89.4
    -#>  4 DCOILWTICO 2011-01-06  88.4    90.3
    -#>  5 DCOILWTICO 2011-01-07  88.1    88.4
    -#>  6 DCOILWTICO 2011-01-10  89.2    88.1
    -#>  7 DCOILWTICO 2011-01-11  91.1    89.2
    -#>  8 DCOILWTICO 2011-01-12  91.8    91.1
    -#>  9 DCOILWTICO 2011-01-13  91.4    91.8
    -#> 10 DCOILWTICO 2011-01-14  91.5    91.4
    -#> # … with 2,856 more rows
    -
    -# Example 4: Using tq_mutate to apply a rolling regression
    -fb_returns <- fb_stock_prices %>%
    -    tq_transmute(adjusted, periodReturn, period = "monthly", col_rename = "fb.returns")
    -xlk_returns <- tq_get("XLK", from = "2016-01-01", to = "2016-12-31") %>%
    -    tq_transmute(adjusted, periodReturn, period = "monthly", col_rename = "xlk.returns")
    -returns_combined <- left_join(fb_returns, xlk_returns, by = "date")
    -regr_fun <- function(data) {
    -    coef(lm(fb.returns ~ xlk.returns, data = as_tibble(data)))
    -}
    -returns_combined %>%
    -    tq_mutate(mutate_fun = rollapply,
    -              width      = 6,
    -              FUN        = regr_fun,
    -              by.column  = FALSE,
    -              col_rename = c("coef.0", "coef.1"))
    -#> # A tibble: 12 × 5
    -#>    date       fb.returns xlk.returns   coef.0 coef.1
    -#>    <date>          <dbl>       <dbl>    <dbl>  <dbl>
    -#>  1 2016-01-29     0.0977    -0.0244  NA       NA    
    -#>  2 2016-02-29    -0.0471    -0.00655 NA       NA    
    -#>  3 2016-03-31     0.0672     0.0882  NA       NA    
    -#>  4 2016-04-29     0.0305    -0.0503  NA       NA    
    -#>  5 2016-05-31     0.0105     0.0489  NA       NA    
    -#>  6 2016-06-30    -0.0381    -0.0138   0.0188   0.190
    -#>  7 2016-07-29     0.0845     0.0710   0.00355  0.626
    -#>  8 2016-08-31     0.0176     0.0116   0.0154   0.511
    -#>  9 2016-09-30     0.0170     0.0210   0.0136   0.453
    -#> 10 2016-10-31     0.0212    -0.00753 -0.00143  0.924
    -#> 11 2016-11-30    -0.0960     0.00169 -0.0189   1.42 
    -#> 12 2016-12-30    -0.0285     0.0226  -0.0254   1.40 
    -
    -# Example 5: Non-standard evaluation:
    -# Programming with tq_mutate_() and tq_mutate_xy_()
    -col_name <- "adjusted"
    -mutate <- c("MACD", "SMA")
    -tq_mutate_xy_(fb_stock_prices, x = col_name, mutate_fun = mutate[[1]])
    -#> # A tibble: 252 × 10
    -#>    symbol date        open  high   low close   volume adjusted  macd signal
    -#>    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>    <dbl>    <dbl> <dbl>  <dbl>
    -#>  1 FB     2016-01-04 102.  102.   99.8 102.  37912400    102.     NA     NA
    -#>  2 FB     2016-01-05 103.  104.  102.  103.  23258200    103.     NA     NA
    -#>  3 FB     2016-01-06 101.  104.  101.  103.  25096200    103.     NA     NA
    -#>  4 FB     2016-01-07 100.  101.   97.3  97.9 45172900     97.9    NA     NA
    -#>  5 FB     2016-01-08  99.9 100.   97.0  97.3 35402300     97.3    NA     NA
    -#>  6 FB     2016-01-11  97.9  98.6  95.4  97.5 29932400     97.5    NA     NA
    -#>  7 FB     2016-01-12  99   100.   97.6  99.4 28395400     99.4    NA     NA
    -#>  8 FB     2016-01-13 101.  101.   95.2  95.4 33410600     95.4    NA     NA
    -#>  9 FB     2016-01-14  95.8  98.9  92.4  98.4 48658600     98.4    NA     NA
    -#> 10 FB     2016-01-15  94.0  96.4  93.5  95.0 46132800     95.0    NA     NA
    -#> # … with 242 more rows
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/tq_performance.html b/docs/reference/tq_performance.html deleted file mode 100644 index f53c111e..00000000 --- a/docs/reference/tq_performance.html +++ /dev/null @@ -1,311 +0,0 @@ - -Computes a wide variety of summary performance metrics from stock or portfolio returns — tq_performance • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    Asset and portfolio performance analysis is a deep field with a wide range of theories and -methods for analyzing risk versus reward. The PerformanceAnalytics package -consolidates many of the most widely used performance metrics as functions that can -be applied to stock or portfolio returns. tq_performance -implements these performance analysis functions in a tidy way, enabling scaling -analysis using the split, apply, combine framework.

    -
    - -
    -
    tq_performance(data, Ra, Rb = NULL, performance_fun, ...)
    -
    -tq_performance_(data, Ra, Rb = NULL, performance_fun, ...)
    -
    -tq_performance_fun_options()
    -
    - -
    -

    Arguments

    -
    data
    -

    A tibble (tidy data frame) of returns in tidy format (i.e long format).

    -
    Ra
    -

    The column of asset returns

    -
    Rb
    -

    The column of baseline returns (for functions that require comparison to a baseline)

    -
    performance_fun
    -

    The performance function from PerformanceAnalytics. See -tq_performance_fun_options() for a complete list of integrated functions.

    -
    ...
    -

    Additional parameters passed to the PerformanceAnalytics function.

    -
    -
    -

    Value

    -

    Returns data in the form of a tibble object.

    -
    -
    -

    Details

    -

    Important concept: Performance is based on the statistical properties of returns, -and as a result this function uses stock or portfolio returns as opposed -to stock prices.

    -

    tq_performance is a wrapper for various PerformanceAnalytics functions -that return portfolio statistics. -The main advantage is the ability to scale with the tidyverse.

    -

    Ra and Rb are the columns containing asset and baseline returns, respectively. -These columns are mapped to the PerformanceAnalytics functions. Note that Rb -is not always required, and in these instances the argument defaults to Rb = NULL. -The user can tell if Rb is required by researching the underlying performance function.

    -

    ... are additional arguments that are passed to the PerformanceAnalytics -function. Search the underlying function to see what arguments can be passed through.

    -

    tq_performance_fun_options returns a list of compatible PerformanceAnalytics functions -that can be supplied to the performance_fun argument.

    -
    -
    -

    See also

    -
    -
    • tq_transmute() which can be used to calculate period returns from a -set of stock prices. Use mutate_fun = periodReturn with the appropriate periodicity -such as period = "monthly".

    • -
    • tq_portfolio() which can be used to aggregate period returns from -multiple stocks to period returns for a portfolio.

    • -
    • The PerformanceAnalytics package, which contains the underlying functions -for the performance_fun argument. Additional parameters can be passed via ....

    • -
    -
    - -
    -

    Examples

    -
    # Load libraries
    -library(tidyquant)
    -library(dplyr)
    -
    -# Use FANG data set
    -data(FANG)
    -
    -# Get returns for individual stock components grouped by symbol
    -Ra <- FANG %>%
    -    group_by(symbol) %>%
    -    tq_transmute(adjusted, periodReturn, period = "monthly", col_rename = "Ra")
    -
    -# Get returns for SP500 as baseline
    -Rb <- "^GSPC" %>%
    -    tq_get(get  = "stock.prices",
    -           from = "2010-01-01",
    -           to   = "2015-12-31") %>%
    -    tq_transmute(adjusted, periodReturn, period = "monthly", col_rename = "Rb")
    -
    -# Merge stock returns with baseline
    -RaRb <- left_join(Ra, Rb, by = c("date" = "date"))
    -
    -##### Performance Metrics #####
    -
    -# View options
    -tq_performance_fun_options()
    -#> $table.funs
    -#>  [1] "table.AnnualizedReturns" "table.Arbitrary"        
    -#>  [3] "table.Autocorrelation"   "table.CAPM"             
    -#>  [5] "table.CaptureRatios"     "table.Correlation"      
    -#>  [7] "table.Distributions"     "table.DownsideRisk"     
    -#>  [9] "table.DownsideRiskRatio" "table.DrawdownsRatio"   
    -#> [11] "table.HigherMoments"     "table.InformationRatio" 
    -#> [13] "table.RollingPeriods"    "table.SFM"              
    -#> [15] "table.SpecificRisk"      "table.Stats"            
    -#> [17] "table.TrailingPeriods"   "table.UpDownRatios"     
    -#> [19] "table.Variability"      
    -#> 
    -#> $CAPM.funs
    -#>  [1] "CAPM.CML"         "CAPM.CML.slope"   "CAPM.RiskPremium" "CAPM.SML.slope"  
    -#>  [5] "CAPM.alpha"       "CAPM.beta"        "CAPM.beta.bear"   "CAPM.beta.bull"  
    -#>  [9] "CAPM.dynamic"     "CAPM.epsilon"     "CAPM.jensenAlpha" "TimingRatio"     
    -#> [13] "MarketTiming"    
    -#> 
    -#> $SFM.funs
    -#> [1] "SFM.CML"         "SFM.CML.slope"   "SFM.alpha"       "SFM.beta"       
    -#> [5] "SFM.dynamic"     "SFM.epsilon"     "SFM.jensenAlpha"
    -#> 
    -#> $descriptive.funs
    -#> [1] "mean"           "sd"             "min"            "max"           
    -#> [5] "cor"            "mean.geometric" "mean.stderr"    "mean.LCL"      
    -#> [9] "mean.UCL"      
    -#> 
    -#> $annualized.funs
    -#> [1] "Return.annualized"        "Return.annualized.excess"
    -#> [3] "sd.annualized"            "SharpeRatio.annualized"  
    -#> 
    -#> $VaR.funs
    -#> [1] "VaR"  "ES"   "ETL"  "CDD"  "CVaR"
    -#> 
    -#> $moment.funs
    -#>  [1] "var"              "cov"              "skewness"         "kurtosis"        
    -#>  [5] "CoVariance"       "CoSkewness"       "CoSkewnessMatrix" "CoKurtosis"      
    -#>  [9] "CoKurtosisMatrix" "M3.MM"            "M4.MM"            "BetaCoVariance"  
    -#> [13] "BetaCoSkewness"   "BetaCoKurtosis"  
    -#> 
    -#> $drawdown.funs
    -#> [1] "AverageDrawdown"   "AverageLength"     "AverageRecovery"  
    -#> [4] "DrawdownDeviation" "DrawdownPeak"      "maxDrawdown"      
    -#> 
    -#> $Bacon.risk.funs
    -#> [1] "MeanAbsoluteDeviation" "Frequency"             "SharpeRatio"          
    -#> [4] "MSquared"              "MSquaredExcess"        "HurstIndex"           
    -#> 
    -#> $Bacon.regression.funs
    -#>  [1] "CAPM.alpha"       "CAPM.beta"        "CAPM.epsilon"     "CAPM.jensenAlpha"
    -#>  [5] "SystematicRisk"   "SpecificRisk"     "TotalRisk"        "TreynorRatio"    
    -#>  [9] "AppraisalRatio"   "FamaBeta"         "Selectivity"      "NetSelectivity"  
    -#> 
    -#> $Bacon.relative.risk.funs
    -#> [1] "ActivePremium"    "ActiveReturn"     "TrackingError"    "InformationRatio"
    -#> 
    -#> $Bacon.drawdown.funs
    -#> [1] "PainIndex"     "PainRatio"     "CalmarRatio"   "SterlingRatio"
    -#> [5] "BurkeRatio"    "MartinRatio"   "UlcerIndex"   
    -#> 
    -#> $Bacon.downside.risk.funs
    -#>  [1] "DownsideDeviation"     "DownsidePotential"     "DownsideFrequency"    
    -#>  [4] "SemiDeviation"         "SemiVariance"          "UpsideRisk"           
    -#>  [7] "UpsidePotentialRatio"  "UpsideFrequency"       "BernardoLedoitRatio"  
    -#> [10] "DRatio"                "Omega"                 "OmegaSharpeRatio"     
    -#> [13] "OmegaExcessReturn"     "SortinoRatio"          "M2Sortino"            
    -#> [16] "Kappa"                 "VolatilitySkewness"    "AdjustedSharpeRatio"  
    -#> [19] "SkewnessKurtosisRatio" "ProspectRatio"        
    -#> 
    -#> $misc.funs
    -#> [1] "KellyRatio"   "Modigliani"   "UpDownRatios"
    -#> 
    -
    -# Get performance metrics
    -RaRb %>%
    -    tq_performance(Ra = Ra, performance_fun = SharpeRatio, p = 0.95)
    -#> # A tibble: 4 × 4
    -#> # Groups:   symbol [4]
    -#>   symbol `ESSharpe(Rf=0%,p=95%)` `StdDevSharpe(Rf=0%,p=95%)` `VaRSharpe(Rf=0%,p…
    -#>   <chr>                    <dbl>                       <dbl>               <dbl>
    -#> 1 FB                       0.193                       0.345               0.605
    -#> 2 AMZN                     0.215                       0.314               0.265
    -#> 3 NFLX                     0.199                       0.355               0.606
    -#> 4 GOOG                     0.213                       0.296               0.310
    -
    -RaRb %>%
    -    tq_performance(Ra = Ra, Rb = Rb, performance_fun = table.CAPM)
    -#> # A tibble: 4 × 13
    -#> # Groups:   symbol [4]
    -#>   symbol ActivePremium  Alpha AnnualizedAlpha  Beta `Beta+` `Beta-` Correlation
    -#>   <chr>          <dbl>  <dbl>           <dbl> <dbl>   <dbl>   <dbl>       <dbl>
    -#> 1 FB             0.431 0.034            0.493 0.846    3.00  0.819        0.234
    -#> 2 AMZN           0.246 0.0144           0.187 1.46     2.04 -0.0442       0.524
    -#> 3 NFLX           1.02  0.0632           1.09  1.35     1.90 -2.78         0.234
    -#> 4 GOOG           0.142 0.0123           0.158 0.901    1.56 -0.247        0.451
    -#> # … with 5 more variables: Correlationp-value <dbl>, InformationRatio <dbl>,
    -#> #   R-squared <dbl>, TrackingError <dbl>, TreynorRatio <dbl>
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/tq_portfolio.html b/docs/reference/tq_portfolio.html deleted file mode 100644 index 4e3a2d8c..00000000 --- a/docs/reference/tq_portfolio.html +++ /dev/null @@ -1,305 +0,0 @@ - -Aggregates a group of returns by asset into portfolio returns — tq_portfolio • tidyquant - - -
    -
    - - - -
    -
    - - -
    -

    Aggregates a group of returns by asset into portfolio returns

    -
    - -
    -
    tq_portfolio(
    -  data,
    -  assets_col,
    -  returns_col,
    -  weights = NULL,
    -  col_rename = NULL,
    -  ...
    -)
    -
    -tq_portfolio_(
    -  data,
    -  assets_col,
    -  returns_col,
    -  weights = NULL,
    -  col_rename = NULL,
    -  ...
    -)
    -
    -tq_repeat_df(data, n, index_col_name = "portfolio")
    -
    - -
    -

    Arguments

    -
    data
    -

    A tibble (tidy data frame) of returns in tidy format (i.e long format).

    -
    assets_col
    -

    The column with assets (securities)

    -
    returns_col
    -

    The column with returns

    -
    weights
    -

    Optional parameter for the asset weights, which can be passed as a numeric vector the length of -the number of assets or a two column tibble with asset names in first column -and weights in second column.

    -
    col_rename
    -

    A string or character vector containing names that can be used -to quickly rename columns.

    -
    ...
    -

    Additional parameters passed to PerformanceAnalytics::Returns.portfolio

    -
    n
    -

    Number of times to repeat a data frame row-wise.

    -
    index_col_name
    -

    A renaming function for the "index" column, used when repeating data frames.

    -
    -
    -

    Value

    -

    Returns data in the form of a tibble object.

    -
    -
    -

    Details

    -

    tq_portfolio is a wrapper for PerformanceAnalytics::Returns.portfolio. -The main advantage is the results are returned as a tibble and the -function can be used with the tidyverse.

    -

    assets_col and returns_col are columns within data that are used -to compute returns for a portfolio. The columns should be in "long" format (or "tidy" format) -meaning there is only one column containing all of the assets and one column containing -all of the return values (i.e. not in "wide" format with returns spread by asset).

    -

    weights are the weights to be applied to the asset returns. -Weights can be input in one of three options:

    • Single Portfolio: A numeric vector of weights that is the same length as unique number of assets. -The weights are applied in the order of the assets.

    • -
    • Single Portfolio: A two column tibble with assets in the first column and weights in the second column. -The advantage to this method is the weights are mapped to the assets and any unlisted -assets default to a weight of zero.

    • -
    • Multiple Portfolios: A three column tibble with portfolio index in the first -column, assets in the second column, and weights in the third column. The tibble -must be grouped by portfolio index.

    • -

    tq_repeat_df is a simple function that repeats -a data frame n times row-wise (long-wise), and adds a new column for a portfolio index. -The function is used to assist in Multiple Portfolio analyses, and -is a useful precursor to tq_portfolio.

    -
    -
    -

    See also

    -
    -
    -
    - -
    -

    Examples

    -
    # Load libraries
    -library(tidyquant)
    -library(dplyr)
    -
    -# Use FANG data set
    -data(FANG)
    -
    -# Get returns for individual stock components
    -monthly_returns_stocks <- FANG %>%
    -    group_by(symbol) %>%
    -    tq_transmute(adjusted, periodReturn, period = "monthly")
    -
    -##### Portfolio Aggregation Methods #####
    -
    -# Method 1: Use tq_portfolio with numeric vector of weights
    -
    -weights <- c(0.50, 0.25, 0.25, 0)
    -tq_portfolio(data = monthly_returns_stocks,
    -             assets_col = symbol,
    -             returns_col = monthly.returns,
    -             weights = weights,
    -             col_rename = NULL,
    -             wealth.index = FALSE)
    -#> # A tibble: 48 × 2
    -#>    date       portfolio.returns
    -#>    <date>                 <dbl>
    -#>  1 2013-01-31           0.260  
    -#>  2 2013-02-28          -0.00456
    -#>  3 2013-03-28          -0.0195 
    -#>  4 2013-04-30           0.0810 
    -#>  5 2013-05-31          -0.0139 
    -#>  6 2013-06-28          -0.0179 
    -#>  7 2013-07-31           0.254  
    -#>  8 2013-08-30           0.104  
    -#>  9 2013-09-30           0.145  
    -#> 10 2013-10-31           0.0420 
    -#> # … with 38 more rows
    -
    -# Method 2: Use tq_portfolio with two column tibble and map weights
    -
    -# Note that GOOG's weighting is zero in Method 1. In Method 2,
    -# GOOG is not added and same result is achieved.
    -weights_df <- tibble(symbol = c("FB", "AMZN", "NFLX"),
    -                     weights = c(0.50, 0.25, 0.25))
    -tq_portfolio(data = monthly_returns_stocks,
    -             assets_col = symbol,
    -             returns_col = monthly.returns,
    -             weights = weights_df,
    -             col_rename = NULL,
    -             wealth.index = FALSE)
    -#> # A tibble: 48 × 2
    -#>    date       portfolio.returns
    -#>    <date>                 <dbl>
    -#>  1 2013-01-31           0.260  
    -#>  2 2013-02-28          -0.00456
    -#>  3 2013-03-28          -0.0195 
    -#>  4 2013-04-30           0.0810 
    -#>  5 2013-05-31          -0.0139 
    -#>  6 2013-06-28          -0.0179 
    -#>  7 2013-07-31           0.254  
    -#>  8 2013-08-30           0.104  
    -#>  9 2013-09-30           0.145  
    -#> 10 2013-10-31           0.0420 
    -#> # … with 38 more rows
    -
    -# Method 3: Working with multiple portfolios
    -
    -# 3A: Duplicate monthly_returns_stocks multiple times
    -mult_monthly_returns_stocks <- tq_repeat_df(monthly_returns_stocks, n = 4)
    -#> Ungrouping data frame groups: symbol
    -
    -# 3B: Create weights table grouped by portfolio id
    -weights <- c(0.50, 0.25, 0.25, 0.00,
    -             0.00, 0.50, 0.25, 0.25,
    -             0.25, 0.00, 0.50, 0.25,
    -             0.25, 0.25, 0.00, 0.50)
    -stocks <- c("FB", "AMZN", "NFLX", "GOOG")
    -weights_table <- tibble(stocks) %>%
    -    tq_repeat_df(n = 4) %>%
    -    bind_cols(tibble(weights)) %>%
    -    group_by(portfolio)
    -
    -# 3C: Scale to multiple portfolios
    -tq_portfolio(data = mult_monthly_returns_stocks,
    -             assets_col = symbol,
    -             returns_col = monthly.returns,
    -             weights = weights_table,
    -             col_rename = NULL,
    -             wealth.index = FALSE)
    -#> # A tibble: 192 × 3
    -#> # Groups:   portfolio [4]
    -#>    portfolio date       portfolio.returns
    -#>        <int> <date>                 <dbl>
    -#>  1         1 2013-01-31           0.260  
    -#>  2         1 2013-02-28          -0.00456
    -#>  3         1 2013-03-28          -0.0195 
    -#>  4         1 2013-04-30           0.0810 
    -#>  5         1 2013-05-31          -0.0139 
    -#>  6         1 2013-06-28          -0.0179 
    -#>  7         1 2013-07-31           0.254  
    -#>  8         1 2013-08-30           0.104  
    -#>  9         1 2013-09-30           0.145  
    -#> 10         1 2013-10-31           0.0420 
    -#> # … with 182 more rows
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.1.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/tq_stock_list.html b/docs/reference/tq_stock_list.html deleted file mode 100644 index a7f588d4..00000000 --- a/docs/reference/tq_stock_list.html +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - - - -Get all stocks in a stock index or stock exchange in <code>tibble</code> format — tq_stock_list • tidyquant - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Get all stocks in a stock index or stock exchange in tibble format

    -
    - -
    tq_index(x, use_fallback = FALSE)
    -
    -tq_exchange(x)
    -
    -tq_index_options()
    -
    -tq_exchange_options()
    - -

    Arguments

    - - - - - - - - - - -
    x

    A single character string, a character vector or tibble representing a -single stock index or multiple stock indexes.

    use_fallback

    A boolean that can be used to return a fallback data set -last downloaded when the package was updated. Useful if the website is down. -Set to FALSE by default.

    - -

    Value

    - -

    Returns data in the form of a tibble object.

    -

    Details

    - -

    tq_index() returns the stock symbol, company name, weight, and sector of every stock -in an index. The source is -www.us.spdrs.com.

    -

    tq_index_options() returns a list of stock indexes you can -choose from.

    -

    tq_exchange() returns the stock symbol, company, last sale price, -market capitalization, sector and industry of every stock -in an exchange. Three stock exchanges are available (AMEX, NASDAQ, and NYSE).

    -

    tq_exchange_options() returns a list of stock exchanges you can -choose from. The options are AMEX, NASDAQ and NYSE.

    -

    See also

    - -

    tq_get() to get stock prices, financials, key stats, etc using the stock symbols.

    - -

    Examples

    -
    # Load libraries -library(tidyquant) - -# Get the list of stock index options -tq_index_options()
    #> [1] "DOW" "DOWGLOBAL" "SP400" "SP500" "SP600"
    -# Get all stock symbols in a stock index -if (FALSE) { -tq_index("DOW") -} - -# Get the list of stock exchange options -tq_exchange_options()
    #> [1] "AMEX" "NASDAQ" "NYSE"
    -# Get all stocks in a stock exchange -if (FALSE) { -tq_exchange("NYSE") -}
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/man/FANG.Rd b/man/FANG.Rd index 093892c4..4a28c7d0 100644 --- a/man/FANG.Rd +++ b/man/FANG.Rd @@ -25,7 +25,7 @@ FANG } \description{ A dataset containing the daily historical stock prices for the "FANG" tech stocks, -"FB", "AMZN", "NFLX", and "GOOG", spanning from the beginning of +"META", "AMZN", "NFLX", and "GOOG", spanning from the beginning of 2013 through the end of 2016. } \keyword{datasets} diff --git a/man/av_api_key.Rd b/man/av_api_key.Rd index b47c569d..312fd2cf 100644 --- a/man/av_api_key.Rd +++ b/man/av_api_key.Rd @@ -13,7 +13,7 @@ av_api_key(api_key) Returns invisibly the currently set \code{api_key} } \description{ -Set Alpha Vantage API Key +Requires the alphavantager packager to use. } \details{ A wrapper for \code{alphavantager::av_api_key()} @@ -21,8 +21,10 @@ A wrapper for \code{alphavantager::av_api_key()} \examples{ \dontrun{ +if (rlang::is_installed("alphavantager")) { av_api_key(api_key = "foobar") } +} } \seealso{ diff --git a/man/coord_x_date.Rd b/man/coord_x_date.Rd index b6efbd82..c33b36a3 100644 --- a/man/coord_x_date.Rd +++ b/man/coord_x_date.Rd @@ -37,7 +37,6 @@ that enables quickly zooming in on plot regions using a date-time range. } \examples{ # Load libraries -library(tidyquant) library(dplyr) library(ggplot2) diff --git a/man/excel_date_functions.Rd b/man/excel_date_functions.Rd index 777a2fa6..4f5fc3b1 100644 --- a/man/excel_date_functions.Rd +++ b/man/excel_date_functions.Rd @@ -314,8 +314,6 @@ factor in workdays and \code{timeDate} holiday calendars for popular business ca } \examples{ # Libraries -library(tidyquant) -library(tidyverse) library(lubridate) # --- Basic Usage ---- diff --git a/man/excel_if_functions.Rd b/man/excel_if_functions.Rd index 8ce8fde6..a70ba609 100644 --- a/man/excel_if_functions.Rd +++ b/man/excel_if_functions.Rd @@ -84,8 +84,8 @@ value (scalar). See examples below. } \examples{ -library(tidyverse) -library(tidyquant) +\dontshow{if (rlang::is_installed("forcats")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +library(dplyr) library(timetk) library(stringr) library(lubridate) @@ -116,7 +116,7 @@ FANG \%>\% # Count negative returns by month FANG \%>\% - mutate(symbol = as_factor(symbol)) \%>\% + mutate(symbol = forcats::as_factor(symbol)) \%>\% group_by(symbol) \%>\% # Collapse from daily to FIRST value by month @@ -136,5 +136,5 @@ FANG \%>\% summarise( negative_monthly_returns = COUNT_IFS(returns, returns < 0) ) - +\dontshow{\}) # examplesIf} } diff --git a/man/excel_pivot_table.Rd b/man/excel_pivot_table.Rd index 910d7d2d..39be96dc 100644 --- a/man/excel_pivot_table.Rd +++ b/man/excel_pivot_table.Rd @@ -70,9 +70,6 @@ The key parameters are: } } \examples{ -library(tidyquant) -library(tidyverse) - # PIVOT TABLE ---- # Calculate returns by year/quarter FANG \%>\% diff --git a/man/excel_ref_functions.Rd b/man/excel_ref_functions.Rd index c6cd141a..328c970e 100644 --- a/man/excel_ref_functions.Rd +++ b/man/excel_ref_functions.Rd @@ -38,11 +38,10 @@ Most functions replicate the behavior of Excel: } } \examples{ -library(tidyquant) -library(tidyverse) +library(dplyr) lookup_table <- tibble( - stock = c("FB", "AMZN", "NFLX", "GOOG"), + stock = c("META", "AMZN", "NFLX", "GOOG"), company = c("Facebook", "Amazon", "Netflix", "Google") ) diff --git a/man/excel_stat_mutation_functions.Rd b/man/excel_stat_mutation_functions.Rd index c9ca561d..050eec7e 100644 --- a/man/excel_stat_mutation_functions.Rd +++ b/man/excel_stat_mutation_functions.Rd @@ -86,11 +86,10 @@ Most functions replicate the behavior of Excel: } \examples{ +\dontshow{if (rlang::is_installed("forcats")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # Libraries -library(tidyquant) library(timetk) -library(tidyverse) -library(forcats) +library(dplyr) # --- Basic Usage ---- @@ -103,7 +102,7 @@ PCT_CHANGE(c(21, 24, 22, 25), fill_na = 0) # Go from daily to monthly periodicity, # then calculate returns and growth of $1 USD FANG \%>\% - mutate(symbol = as_factor(symbol)) \%>\% + mutate(symbol = forcats::as_factor(symbol)) \%>\% group_by(symbol) \%>\% # Summarization - Collapse from daily to FIRST value by month @@ -119,5 +118,5 @@ FANG \%>\% returns = PCT_CHANGE(adjusted, fill_na = 0), growth = CUMULATIVE_SUM(returns) + 1 ) - +\dontshow{\}) # examplesIf} } diff --git a/man/excel_stat_summary_functions.Rd b/man/excel_stat_summary_functions.Rd index 0457ac2a..a70b0df6 100644 --- a/man/excel_stat_summary_functions.Rd +++ b/man/excel_stat_summary_functions.Rd @@ -100,11 +100,11 @@ Most functions replicate the behavior of Excel: } \examples{ +\dontshow{if (rlang::is_installed("forcats")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # Libraries -library(tidyquant) library(timetk) -library(tidyverse) library(forcats) +library(dplyr) # --- Basic Usage ---- @@ -117,7 +117,7 @@ PCT_CHANGE_FIRSTLAST(c(21, 24, 22, 25)) # Go from daily to monthly periodicity, # then calculate returns and growth of $1 USD FANG \%>\% - mutate(symbol = as_factor(symbol)) \%>\% + mutate(symbol = forcats::as_factor(symbol)) \%>\% group_by(symbol) \%>\% # Summarization - Collapse from daily to FIRST value by month @@ -126,5 +126,5 @@ FANG \%>\% .by = "month", adjusted = FIRST(adjusted) ) - +\dontshow{\}) # examplesIf} } diff --git a/docs/README_0_logo.png b/man/figures/logo.png similarity index 100% rename from docs/README_0_logo.png rename to man/figures/logo.png diff --git a/man/figures/sample_img_1_volatility.R b/man/figures/sample_img_1_volatility.R deleted file mode 100644 index 7572782d..00000000 --- a/man/figures/sample_img_1_volatility.R +++ /dev/null @@ -1,42 +0,0 @@ -library(tidyquant) - -# Get some data -FANG <- c("FB", "AMZN", "NFLX", "GOOG") %>% - tq_get(get = "stock.prices", from = "2007-01-01", to = "2017-01-01") - -# Setup dates for zoom window -end <- ymd("2017-01-01") -start <- end - weeks(20) - -# Visualize!!! -n_mavg <- 20 # Number of periods (days) for moving average -FANG %>% - filter(date >= start - days(2 * n_mavg)) %>% - ggplot(aes(x = date, y = close, group = symbol)) + - geom_candlestick(aes(open = open, close = close, high = high, low = low)) + - geom_bbands(aes(high = high, low = low, close = close), - ma_fun = SMA, n = n_mavg, sd = 2, size = 0.5) + - labs(title = "Multiple Stocks at Once!", - subtitle = "Quickly visualize the volatility of four stocks at once", - x = "", y = "Closing Price") + - coord_x_date(xlim = c(start, end)) + - facet_wrap(~ symbol, scales = "free_y") + - theme_tq() + - scale_y_continuous(labels = scales::dollar) - -ggsave("img/sample_img_1_volatility.png") - -# Website - -# FANG %>% -# filter(date >= start - days(2 * n_mavg)) %>% -# ggplot(aes(x = date, y = close, group = symbol)) + -# geom_candlestick(aes(open = open, close = close, high = high, low = low)) + -# geom_bbands(aes(high = high, low = low, close = close), -# ma_fun = SMA, n = n_mavg, sd = 2, size = 0.5) + -# coord_x_date(xlim = c(start, end)) + -# facet_wrap(~ symbol, scales = "free_y") + -# theme_tq() + -# scale_y_continuous(labels = scales::dollar) -# -# ggsave("docs/README_1_volatility.png", width = 8, height = 4.5) diff --git a/man/figures/sample_img_1_volatility.png b/man/figures/sample_img_1_volatility.png index 8386e285..8e9c4240 100644 Binary files a/man/figures/sample_img_1_volatility.png and b/man/figures/sample_img_1_volatility.png differ diff --git a/man/figures/sample_img_2_stock_returns.png b/man/figures/sample_img_2_stock_returns.png index 297b263e..d78b3013 100644 Binary files a/man/figures/sample_img_2_stock_returns.png and b/man/figures/sample_img_2_stock_returns.png differ diff --git a/man/figures/sample_img_3_portfolio_returns.png b/man/figures/sample_img_3_portfolio_returns.png index b859b794..9a3ae769 100644 Binary files a/man/figures/sample_img_3_portfolio_returns.png and b/man/figures/sample_img_3_portfolio_returns.png differ diff --git a/man/figures/tidyquant-logo.png b/man/figures/tidyquant-logo.png deleted file mode 100644 index 99777200..00000000 Binary files a/man/figures/tidyquant-logo.png and /dev/null differ diff --git a/man/geom_bbands.Rd b/man/geom_bbands.Rd index ada443cf..9cd443e0 100644 --- a/man/geom_bbands.Rd +++ b/man/geom_bbands.Rd @@ -160,8 +160,6 @@ The following aesthetics are understood (required are in bold): } \examples{ -# Load libraries -library(tidyquant) library(dplyr) library(ggplot2) diff --git a/man/geom_chart.Rd b/man/geom_chart.Rd index 26bdc333..525f16aa 100644 --- a/man/geom_chart.Rd +++ b/man/geom_chart.Rd @@ -119,8 +119,6 @@ The following aesthetics are understood (required are in bold): } \examples{ -# Load libraries -library(tidyquant) library(dplyr) library(ggplot2) diff --git a/man/geom_ma.Rd b/man/geom_ma.Rd index 9b566446..8d56f561 100644 --- a/man/geom_ma.Rd +++ b/man/geom_ma.Rd @@ -131,13 +131,13 @@ The following aesthetics are understood (required are in bold): \item \code{colour} \item \code{group} \item \code{linetype} +\item \code{linewidth} + \item \code{size} } } \examples{ -# Load libraries -library(tidyquant) library(dplyr) library(ggplot2) diff --git a/man/quandl_api_key.Rd b/man/quandl_api_key.Rd index 6c4b7d90..f49a1a62 100644 --- a/man/quandl_api_key.Rd +++ b/man/quandl_api_key.Rd @@ -21,9 +21,11 @@ A wrapper for \code{Quandl::Quandl.api_key()} \examples{ \dontrun{ +if (rlang::is_installed("Quandl")) { quandl_api_key(api_key = "foobar") } } +} \seealso{ \code{\link[=tq_get]{tq_get()}} \code{get = "quandl"} } diff --git a/man/quandl_search.Rd b/man/quandl_search.Rd index ef99a160..e7b97636 100644 --- a/man/quandl_search.Rd +++ b/man/quandl_search.Rd @@ -25,10 +25,12 @@ Search the Quandl database A wrapper for \code{Quandl::Quandl.search()} } \examples{ +\dontshow{if (rlang::is_installed("Quandl")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} \dontrun{ quandl_search(query = "oil") } +\dontshow{\}) # examplesIf} } \seealso{ \code{\link[=tq_get]{tq_get()}} \code{get = "quandl"} diff --git a/man/scale_manual.Rd b/man/scale_manual.Rd index 519d5c36..7e82d1e9 100644 --- a/man/scale_manual.Rd +++ b/man/scale_manual.Rd @@ -33,12 +33,11 @@ For use when \code{fill} is specified as an \code{aes()} in a ggplot.} } \examples{ # Load libraries -library(tidyquant) library(dplyr) library(ggplot2) # Get stock prices -stocks <- c("AAPL", "FB", "NFLX") \%>\% +stocks <- c("AAPL", "META", "NFLX") \%>\% tq_get(from = "2013-01-01", to = "2017-01-01") diff --git a/man/theme_tq.Rd b/man/theme_tq.Rd index ed52bb73..3ba945c3 100644 --- a/man/theme_tq.Rd +++ b/man/theme_tq.Rd @@ -22,7 +22,6 @@ The \code{theme_tq()} function creates a custom theme using tidyquant colors. } \examples{ # Load libraries -library(tidyquant) library(dplyr) library(ggplot2) diff --git a/man/tidyquant.Rd b/man/tidyquant-package.Rd similarity index 75% rename from man/tidyquant.Rd rename to man/tidyquant-package.Rd index 82fdb435..0d92bd40 100644 --- a/man/tidyquant.Rd +++ b/man/tidyquant-package.Rd @@ -1,8 +1,9 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/tidyquant.R \docType{package} -\name{tidyquant} +\name{tidyquant-package} \alias{tidyquant} +\alias{tidyquant-package} \title{tidyquant: Integrating quantitative financial analysis tools with the tidyverse} \description{ The main advantage of \code{tidyquant} is to @@ -29,3 +30,21 @@ Users will probably be interested in the following: To learn more about tidyquant, start with the vignettes: \code{browseVignettes(package = "tidyquant")} } +\seealso{ +Useful links: +\itemize{ + \item \url{https://business-science.github.io/tidyquant/} + \item \url{https://github.com/business-science/tidyquant} + \item Report bugs at \url{https://github.com/business-science/tidyquant/issues} +} + +} +\author{ +\strong{Maintainer}: Matt Dancho \email{mdancho@business-science.io} + +Authors: +\itemize{ + \item Davis Vaughan \email{dvaughan@business-science.io} +} + +} diff --git a/man/tiingo_api_key.Rd b/man/tiingo_api_key.Rd index 73be5a97..615ca60e 100644 --- a/man/tiingo_api_key.Rd +++ b/man/tiingo_api_key.Rd @@ -13,17 +13,17 @@ tiingo_api_key(api_key) Returns invisibly the currently set \code{api_key} } \description{ -Set Tiingo API Key +Requires the riingo package to be installled. } \details{ A wrapper for \code{riingo::ringo_set_token()} } \examples{ - +\dontshow{if (rlang::is_installed("riingo")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} \dontrun{ -tiingo_api_key(api_key = "foobar") + tiingo_api_key(api_key = "foobar") } - +\dontshow{\}) # examplesIf} } \seealso{ \code{\link[=tq_get]{tq_get()}} \code{get = "tiingo"} diff --git a/man/tq_get.Rd b/man/tq_get.Rd index ab3254ed..5bbca932 100644 --- a/man/tq_get.Rd +++ b/man/tq_get.Rd @@ -94,8 +94,6 @@ next version. Please use \code{tq_index_options()} instead. } \examples{ # Load libraries -library(tidyquant) -library(tidyverse) # Get the list of `get` options tq_get_options() @@ -104,7 +102,7 @@ tq_get_options() aapl_stock_prices <- tq_get("AAPL") # Get stock prices for multiple stocks -mult_stocks <- tq_get(c("FB", "AMZN"), +mult_stocks <- tq_get(c("META", "AMZN"), get = "stock.prices", from = "2016-01-01", to = "2017-01-01") @@ -113,15 +111,18 @@ mult_stocks <- tq_get(c("FB", "AMZN"), \dontrun{ # --- Quandl --- - +if (rlang::is_installed("quandl")) { quandl_api_key('') +tq_get("EIA/PET_MTTIMUS1_M", get = "quandl", from = "2010-01-01") +} + # Energy data from EIA -tq_get("EIA/PET_MTTIMUS1_M", get = "quandl", from = "2010-01-01") -# --- Tiingo --- +# --- Tiingo --- +if (rlang::is_installed("riingo")) { tiingo_api_key('') # Tiingo Prices (Free alternative to Yahoo Finance!) @@ -142,8 +143,11 @@ tq_get(c("btcusd", "btceur"), resample_frequency = "5min") +} + # --- Alpha Vantage --- +if (rlang::is_installed("alphavantager")) { av_api_key('') # Daily Time Series @@ -158,13 +162,13 @@ tq_get("AAPL", av_fun = "TIME_SERIES_INTRADAY", interval = "15min", outputsize = "full") - # FX DAILY tq_get("USD/EUR", get = "alphavantage", av_fun = "FX_DAILY", outputsize = "full") # FX REAL-TIME QUOTE tq_get("USD/EUR", get = "alphavantage", av_fun = "CURRENCY_EXCHANGE_RATE") +} } } \seealso{ diff --git a/man/tq_index.Rd b/man/tq_index.Rd index 6da4e05b..5c17cbce 100644 --- a/man/tq_index.Rd +++ b/man/tq_index.Rd @@ -45,8 +45,6 @@ in an exchange. Three stock exchanges are available (AMEX, NASDAQ, and NYSE). choose from. The options are AMEX, NASDAQ and NYSE. } \examples{ -# Load libraries -library(tidyquant) # Get the list of stock index options tq_index_options() diff --git a/man/tq_mutate.Rd b/man/tq_mutate.Rd index 86825f17..78418795 100644 --- a/man/tq_mutate.Rd +++ b/man/tq_mutate.Rd @@ -118,13 +118,12 @@ respectively. } \examples{ # Load libraries -library(tidyquant) library(dplyr) ##### Basic Functionality fb_stock_prices <- FANG \%>\% - filter(symbol == "FB") \%>\% + filter(symbol == "META") \%>\% filter( date >= "2016-01-01", date <= "2016-12-31" diff --git a/man/tq_performance.Rd b/man/tq_performance.Rd index 46b06ef9..3d7e5a71 100644 --- a/man/tq_performance.Rd +++ b/man/tq_performance.Rd @@ -57,11 +57,9 @@ that can be supplied to the \code{performance_fun} argument. } \examples{ # Load libraries -library(tidyquant) library(dplyr) # Use FANG data set -data(FANG) # Get returns for individual stock components grouped by symbol Ra <- FANG \%>\% diff --git a/man/tq_portfolio.Rd b/man/tq_portfolio.Rd index 7cfa59bb..daf90601 100644 --- a/man/tq_portfolio.Rd +++ b/man/tq_portfolio.Rd @@ -82,11 +82,9 @@ is a useful precursor to \code{tq_portfolio}. } \examples{ # Load libraries -library(tidyquant) library(dplyr) # Use FANG data set -data(FANG) # Get returns for individual stock components monthly_returns_stocks <- FANG \%>\% @@ -109,7 +107,7 @@ tq_portfolio(data = monthly_returns_stocks, # Note that GOOG's weighting is zero in Method 1. In Method 2, # GOOG is not added and same result is achieved. -weights_df <- tibble(symbol = c("FB", "AMZN", "NFLX"), +weights_df <- tibble(symbol = c("META", "AMZN", "NFLX"), weights = c(0.50, 0.25, 0.25)) tq_portfolio(data = monthly_returns_stocks, assets_col = symbol, @@ -128,7 +126,7 @@ weights <- c(0.50, 0.25, 0.25, 0.00, 0.00, 0.50, 0.25, 0.25, 0.25, 0.00, 0.50, 0.25, 0.25, 0.25, 0.00, 0.50) -stocks <- c("FB", "AMZN", "NFLX", "GOOG") +stocks <- c("META", "AMZN", "NFLX", "GOOG") weights_table <- tibble(stocks) \%>\% tq_repeat_df(n = 4) \%>\% bind_cols(tibble(weights)) \%>\% diff --git a/pkgdown/favicon/apple-touch-icon-120x120.png b/pkgdown/favicon/apple-touch-icon-120x120.png new file mode 100644 index 00000000..250f53e3 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-120x120.png differ diff --git a/pkgdown/favicon/apple-touch-icon-152x152.png b/pkgdown/favicon/apple-touch-icon-152x152.png new file mode 100644 index 00000000..0d29468a Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-152x152.png differ diff --git a/pkgdown/favicon/apple-touch-icon-180x180.png b/pkgdown/favicon/apple-touch-icon-180x180.png new file mode 100644 index 00000000..a33e238d Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-180x180.png differ diff --git a/pkgdown/favicon/apple-touch-icon-60x60.png b/pkgdown/favicon/apple-touch-icon-60x60.png new file mode 100644 index 00000000..3213252f Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-60x60.png differ diff --git a/pkgdown/favicon/apple-touch-icon-76x76.png b/pkgdown/favicon/apple-touch-icon-76x76.png new file mode 100644 index 00000000..a8fd1f77 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-76x76.png differ diff --git a/pkgdown/favicon/apple-touch-icon.png b/pkgdown/favicon/apple-touch-icon.png new file mode 100644 index 00000000..633ccd26 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon.png differ diff --git a/pkgdown/favicon/favicon-16x16.png b/pkgdown/favicon/favicon-16x16.png new file mode 100644 index 00000000..bee1c292 Binary files /dev/null and b/pkgdown/favicon/favicon-16x16.png differ diff --git a/pkgdown/favicon/favicon-32x32.png b/pkgdown/favicon/favicon-32x32.png new file mode 100644 index 00000000..dd80b375 Binary files /dev/null and b/pkgdown/favicon/favicon-32x32.png differ diff --git a/pkgdown/favicon/favicon.ico b/pkgdown/favicon/favicon.ico new file mode 100644 index 00000000..832ef39e Binary files /dev/null and b/pkgdown/favicon/favicon.ico differ diff --git a/tests/testthat.R b/tests/testthat.R index 5148de81..e86691b8 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,7 +1,12 @@ +# This file is part of the standard setup for testthat. +# It is recommended that you do not modify it. +# +# Where should you do additional test configuration? +# Learn more about the roles of various files in: +# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview +# * https://testthat.r-lib.org/articles/special-files.html + library(testthat) library(tidyquant) -library(tidyverse) -library(dplyr) -library(tibble) test_check("tidyquant") diff --git a/tests/testthat/test-excel-pivot_table.R b/tests/testthat/test-excel-pivot_table.R index 6ef1f9e9..dd9502cd 100644 --- a/tests/testthat/test-excel-pivot_table.R +++ b/tests/testthat/test-excel-pivot_table.R @@ -1,4 +1,3 @@ -library(tidyquant) context("Testing pivot_table()") # NORMAL ---- @@ -13,10 +12,8 @@ piv_1_tbl <- FANG %>% test_that("Test 1: Pivot table returns tibble with correct rows and columns.", { # Tibble expect_is(piv_1_tbl, "tbl") - # Rows - expect_equal(nrow(piv_1_tbl), 16) - # Columns - expect_equal(ncol(piv_1_tbl), 14) + # Rows + columns + expect_equal(dim(piv_1_tbl), c(16, 14)) }) # PROGRAMMING ---- @@ -34,7 +31,7 @@ piv_2_tbl <- FANG %>% test_that("Test 2: Pivot table returns tibble with correct rows and columns.", { # Tibble - expect_is(piv_2_tbl, "tbl") + expect_s3_class(piv_2_tbl, "tbl_df") # Rows expect_equal(nrow(piv_2_tbl), 16) # Columns diff --git a/tests/testthat/test-index-tq_index.R b/tests/testthat/test-index-tq_index.R index 9cdf33ff..3033572c 100644 --- a/tests/testthat/test-index-tq_index.R +++ b/tests/testthat/test-index-tq_index.R @@ -1,26 +1,29 @@ context("Testing tq_index()") -library(tidyquant) - #### Setup options <- tq_index_options() #### Tests test_that("Test returns list of 5 options", { - expect_equal(length(options), 5) + expect_length(options, 5) }) # Long running script: Collecting all stock lists test_that("Test all stock index options to ensure no issues during fetch.", { + skip_on_cran() - for (i in seq_along(options)) { - tq_index(options[[i]]) %>% - expect_is("tbl") %>% - nrow() %>% - expect_gt(3) + test_option <- function(object) { + expect_s3_class(object, "tbl_df") + expect_gt(nrow(object), 3) } + tq_indexes <- purrr::map( + purrr::set_names(options), + tq_index + ) + # Apply the test to every option + purrr::walk(tq_indexes, test_option) }) diff --git a/tests/testthat/test-index_tq_exchange.R b/tests/testthat/test-index_tq_exchange.R index 919f3f57..590ce4f5 100644 --- a/tests/testthat/test-index_tq_exchange.R +++ b/tests/testthat/test-index_tq_exchange.R @@ -8,17 +8,15 @@ options <- tq_exchange_options() #### Tests test_that("Test returns list of 18+ options when x = 'options'", { - options %>% - expect_is("character") %>% - length() %>% - expect_gte(3) + expect_type(options, "character") + expect_gte(length(options), 3) }) # Long running script: Collecting all stock lists test_that("Test all exchange options to ensure no issues during fetch.", { skip_on_cran() - skip_on_travis() + skip_on_ci() skip_on_os("windows") for (i in seq_along(options)) { tq_exchange(options[[i]]) %>% @@ -30,7 +28,7 @@ test_that("Test all exchange options to ensure no issues during fetch.", { }) test_that("Test returns error on invalid x input.", { - skip_on_travis() + skip_on_ci() skip_on_os("windows") expect_error(tq_exchange("XYZ")) }) diff --git a/tests/testthat/test-tq_get_stock_prices.R b/tests/testthat/test-tq_get_stock_prices.R index 27d70ed3..113a5fcd 100644 --- a/tests/testthat/test-tq_get_stock_prices.R +++ b/tests/testthat/test-tq_get_stock_prices.R @@ -1,5 +1,3 @@ -library(tidyquant) - #### Setup get <- "stock.prices" context(paste0("Testing tq_get(get = '", get, "')")) @@ -23,7 +21,7 @@ test_that("Test 1 returns tibble with correct rows and columns.", { test_that("Test 2 returns tibble with correct rows and columns.", { # Tibble - expect_is(test2, "tbl") + expect_s3_class(test2, "tbl_df") # Rows expect_equal(nrow(test2), 206) # Columns diff --git a/tests/testthat/test-tq_mutate.R b/tests/testthat/test-tq_mutate.R index 8772fe2e..4d03a98e 100644 --- a/tests/testthat/test-tq_mutate.R +++ b/tests/testthat/test-tq_mutate.R @@ -1,5 +1,3 @@ -library(tidyquant) -library(tidyverse) context("Testing tq_mutate()") #### Setup ---- @@ -25,16 +23,16 @@ test1.1_names <- c("symbol", "date", "open", "high", "low", "close", "volume", " "up", "pctB", "dn..1", "mavg..1", "up..1", "pctB..1") # Test 1.2: Grouped_df test -grouped_df <- tibble(symbol = c("META", "AMZN")) %>% +grouped_df <- dplyr::tibble(symbol = c("META", "AMZN")) %>% tq_get( get = "stock.prices", from = "2015-01-01", to = "2016-01-01" ) %>% - group_by(symbol) + dplyr::group_by(symbol) -test1.2a <- mutate(grouped_df, V1 = runSD(adjusted)) +test1.2a <- dplyr::mutate(grouped_df, V1 = runSD(adjusted)) test1.2b <- tq_mutate(grouped_df, adjusted, runSD, col_rename = "V1") @@ -56,14 +54,14 @@ test3 <- hourly_data %>% tq_mutate_xy(x = value, mutate_fun = MACD) # Test 4: Bind hourly data with tq_mutate_xy -test4 <- tibble(time_index, value) %>% +test4 <- dplyr::tibble(time_index, value) %>% tq_mutate_xy(x = value, mutate_fun = MACD) # Test 5: test5 <- c("AAPL", "META") %>% tq_get(from = "2016-01-01", to = "2017-01-01") %>% - group_by(symbol) + dplyr::group_by(symbol) my_lm_fun <- function(data) { coef(lm(close ~ open, data = as.data.frame(data))) } @@ -78,7 +76,7 @@ test5 <- test5 %>% test_that("Test 1 returns tibble with correct rows and columns.", { # Tibble - expect_is(test1, "tbl") + expect_s3_class(test1, "tbl_df") # Rows expect_equal(nrow(test1), 1258) # Columns @@ -152,12 +150,12 @@ test_that("Test error on invalid data inputs.", { # No date columns expect_error( - tibble(a = seq(1:100)) %>% + dplyr::tibble(a = seq(1:100)) %>% tq_mutate(select = NULL, mutate_fun = to.monthly), "No date or POSIXct column found in `data`." ) expect_error( - tibble(a = seq(1:100)) %>% + dplyr::tibble(a = seq(1:100)) %>% tq_mutate_xy(x = a, mutate_fun = to.monthly), "No date or POSIXct column found in `data`." ) diff --git a/tests/testthat/test-tq_performance.R b/tests/testthat/test-tq_performance.R index b6f46b80..c2442f7d 100644 --- a/tests/testthat/test-tq_performance.R +++ b/tests/testthat/test-tq_performance.R @@ -1,5 +1,3 @@ -library(tidyquant) - #### Setup context(paste0("Testing tq_performance")) @@ -9,7 +7,7 @@ Ra <- c("AAPL", "GOOG", "NFLX") %>% tq_get(get = "stock.prices", from = "2010-01-01", to = "2015-12-31") %>% - group_by(symbol) %>% + dplyr::group_by(symbol) %>% tq_transmute(adjusted, periodReturn, period = "monthly", col_rename = "Ra") # Get returns for SP500 as baseline @@ -20,7 +18,7 @@ Rb <- "^GSPC" %>% tq_transmute(adjusted, periodReturn, period = "monthly", col_rename = "Rb") # Merge stock returns with baseline -RaRb <- left_join(Ra, Rb, by = c("date" = "date")) +RaRb <- dplyr::left_join(Ra, Rb, by = c("date" = "date")) # Get performance metrics test1 <- RaRb %>% diff --git a/tests/testthat/test-tq_portfolio.R b/tests/testthat/test-tq_portfolio.R index a71f0d6f..2165e1ec 100644 --- a/tests/testthat/test-tq_portfolio.R +++ b/tests/testthat/test-tq_portfolio.R @@ -1,5 +1,3 @@ -library(tidyquant) - #### Setup context(paste0("Testing tq_portfolio")) @@ -13,7 +11,7 @@ stock_prices <- c("AAPL", "GOOG", "NFLX") %>% # Get returns for individual stock components portfolio_monthly_returns <- stock_prices %>% - group_by(symbol) %>% + dplyr::group_by(symbol) %>% tq_transmute(adjusted, periodReturn, period = "monthly") # Method 1: Use tq_portfolio with numeric vector of weights @@ -26,7 +24,7 @@ test1 <- tq_portfolio(data = portfolio_monthly_returns, wealth.index = FALSE) -weights_df <- tibble(symbol = c("AAPL", "NFLX"), +weights_df <- dplyr::tibble(symbol = c("AAPL", "NFLX"), weights = c(0.5, 0.5)) test2 <- tq_portfolio(data = portfolio_monthly_returns, assets_col = symbol, @@ -57,7 +55,7 @@ test3_equivalence <- tq_portfolio(data = portfolio_monthly_returns, test_that("Tests return equivalent tibbles", { # Tibble - expect_is(test1, "tbl") + expect_s3_class(test1, "tbl_df") # Equivalence expect_equal(test1, test2) # Rows diff --git a/tests/testthat/test-tq_transmute.R b/tests/testthat/test-tq_transmute.R index 1e29fb77..a701c210 100644 --- a/tests/testthat/test-tq_transmute.R +++ b/tests/testthat/test-tq_transmute.R @@ -1,5 +1,3 @@ -library(tidyquant) -library(tidyverse) context("Testing tq_transmute") #### Setup ---- @@ -10,16 +8,16 @@ test1 <- AAPL %>% tq_transmute(select = close, mutate_fun = to.period, period = "months") # Test 1.2: Grouped_df test -grouped_df <- grouped_df <- tibble(symbol = c("META", "AMZN")) %>% +grouped_df <- grouped_df <- dplyr::tibble(symbol = c("META", "AMZN")) %>% tq_get( get = "stock.prices", from = "2015-01-01", to = "2016-01-01" ) %>% - group_by(symbol) + dplyr::group_by(symbol) -test1.2a <- mutate(grouped_df, V1 = runSD(adjusted)) %>% - select(-(open:adjusted)) +test1.2a <- dplyr::mutate(grouped_df, V1 = runSD(adjusted)) %>% + dplyr::select(!open:adjusted) test1.2b <- tq_transmute(grouped_df, adjusted, runSD, col_rename = "V1") @@ -39,7 +37,7 @@ test2b <- grouped_df %>% # set.seed(1) # value <- rnorm(n = length(time_index)) # tz <- "Zulu" -# test3 <- tibble(time_index, value) %>% +# test3 <- dplyr::tibble(time_index, value) %>% # dplyr::mutate(time_index = lubridate::ymd_hms(time_index, tz = tz)) %>% # tq_transmute_xy(x = value, mutate_fun = MACD) @@ -52,7 +50,7 @@ fb_returns <- tq_get("META", get = "stock.prices", from = "2016-01-01", to = tq_transmute(adjusted, periodReturn, period = "monthly", col_rename = "fb.returns") xlk_returns <- tq_get("XLK", from = "2016-01-01", to = "2016-12-31") %>% tq_transmute(adjusted, periodReturn, period = "monthly", col_rename = "xlk.returns") -test5 <- left_join(fb_returns, xlk_returns, by = "date") +test5 <- dplyr::left_join(fb_returns, xlk_returns, by = "date") regr_fun <- function(data) { coef(lm(fb.returns ~ xlk.returns, data = as.data.frame(data))) } @@ -83,7 +81,7 @@ test_that("Test 1.2 grouped data frames are same with mutate and tq_transmute", test_that("Test 2 returns tibble with correct rows and columns.", { # Tibble - expect_is(test2, "tbl") + expect_s3_class(test2, "tbl_df") # Rows expect_equal(nrow(test2), 60) # Columns @@ -130,12 +128,12 @@ test_that("Test error on invalid data inputs.", { # No date columns expect_error( - tibble(a = seq(1:100)) %>% + dplyr::tibble(a = seq(1:100)) %>% tq_transmute(select = NULL, mutate_fun = to.monthly), "No date or POSIXct column found in `data`." ) expect_error( - tibble(a = seq(1:100)) %>% + dplyr::tibble(a = seq(1:100)) %>% tq_mutate_xy(x = a, mutate_fun = to.monthly), "No date or POSIXct column found in `data`." ) diff --git a/vignettes/TQ00-introduction-to-tidyquant.Rmd b/vignettes/TQ00-introduction-to-tidyquant.Rmd index c3ae4f2c..a176d19e 100644 --- a/vignettes/TQ00-introduction-to-tidyquant.Rmd +++ b/vignettes/TQ00-introduction-to-tidyquant.Rmd @@ -22,6 +22,8 @@ knitr::opts_chunk$set(message = FALSE, dpi = 200) library(tidyquant) +library(dplyr) +library(ggplot2) # devtools::load_all() # Travis CI fails on load_all() ``` @@ -85,10 +87,6 @@ For more information, refer to the third topic-specific vignette, [Scaling and M The `tidyquant` package includes charting tools to assist users in developing quick visualizations in `ggplot2` using the grammar of graphics format and workflow. ```{r, echo = F} -library(tidyverse) -library(tidyquant) - -data("FANG") end <- as_date("2017-01-01") start <- end - weeks(24) FANG %>% diff --git a/vignettes/TQ01-core-functions-in-tidyquant.Rmd b/vignettes/TQ01-core-functions-in-tidyquant.Rmd index f2a1b9c6..9fec72c1 100644 --- a/vignettes/TQ01-core-functions-in-tidyquant.Rmd +++ b/vignettes/TQ01-core-functions-in-tidyquant.Rmd @@ -44,7 +44,7 @@ Load the `tidyquant` package to get started. ```{r} # Loads tidyquant, lubridate, xts, quantmod, TTR -library(tidyverse) +library(dplyr) library(tidyquant) ``` @@ -126,7 +126,12 @@ wti_price_usd ## 2.3 Nasdaq Data Link (Quandl) API -[Quandl](https://data.nasdaq.com/) provides access to a vast number of financial and economic databases. The `Quandl` package has been integrated into `tidyquant` as follows. +[Quandl](https://data.nasdaq.com/) provides access to a vast number of financial and economic databases. +The Quandl packages must be installed separately. + +```r +install.packages("Quandl") +``` ### Authentication @@ -238,19 +243,24 @@ tq_get(c("btcusd"), ## 2.5 Alpha Vantage API -[Alpha Vantage](https://www.alphavantage.co/) provides access to a real-time and historical financial data. The `alphavantager` package, a lightweight R interface, has been integrated into `tidyquant` as follows. The benefit of the integration is the __scalability since we can now get multiple symbols returned in a tidy format__. +[Alpha Vantage](https://www.alphavantage.co/) provides access to a real-time and historical financial data. The `alphavantager` package, a lightweight R interface, has been integrated into `tidyquant` as follows. The benefit of the integration is the __scalability since we can now get multiple symbols returned in a tidy format__. You will need to install it first. + +```r +install.packages("alphavantager") +``` ### Authentication To make full use of the integration you need to get an API key and then set your api key. If you don't have one already, go to [Alpha Vantage](https://www.alphavantage.co/) account and get your FREE API key. You can then set it as follows: ```{r, eval = F} +# install.packages("alphavantager") av_api_key("") ``` ### Getting Alpha Vantage Data -Getting data is simple as the structure follows the [Alpha Vantage API documentation](https://www.alphavantage.co/documentation/). For example, if you wish to retrieve intraday data at 5 minute intervals for META and MSFT, you can build the parameters `x = c("FB", "MSFT"), get = "alphavantager", av_fun = "TIME_SERIES_INTRADAY", interval = "5min"`. The familiar `x` and `get` are the same as you always use. The `av_fun` argument comes from `alphavantager::av_get()` and the Alpha Vantage documentation. The `interval` argument comes from the docs as well. +Getting data is simple as the structure follows the [Alpha Vantage API documentation](https://www.alphavantage.co/documentation/). For example, if you wish to retrieve intraday data at 5 minute intervals for META and MSFT, you can build the parameters `x = c("META", "MSFT"), get = "alphavantager", av_fun = "TIME_SERIES_INTRADAY", interval = "5min"`. The familiar `x` and `get` are the same as you always use. The `av_fun` argument comes from `alphavantager::av_get()` and the Alpha Vantage documentation. The `interval` argument comes from the docs as well. ```{r, eval = F} # Scaling is as simple as supplying multiple symbols @@ -267,7 +277,8 @@ c("META", "MSFT") %>% To make full use of the integration you need to have a Bloomberg Terminal account (Note this is not a free service). If you have Bloomberg Terminal running on your machine, you can connect as follows: ```{r, eval = F} -blpConnect() +# install.packages("Rblpapi") +Rblpapi::blpConnect() ``` ### Getting Bloomberg Data @@ -297,11 +308,9 @@ my_bloomberg_data <- c('SPX Index','ODMAX Equity') %>% # 3.0 Mutate Quantitative Data -Mutating functions enable the `xts`/`zoo`, `quantmod` and `TTR` functions to shine. We'll touch on the mutation functions briefly using the `FANG` data set, which consists of daily prices for FB, AMZN, GOOG, and NFLX from the beginning of 2013 to the end of 2016. We'll apply the functions to grouped data sets to get a feel for how each works +Mutating functions enable the `xts`/`zoo`, `quantmod` and `TTR` functions to shine. We'll touch on the mutation functions briefly using the `FANG` data set, which consists of daily prices for META, AMZN, GOOG, and NFLX from the beginning of 2013 to the end of 2016. We'll apply the functions to grouped data sets to get a feel for how each works ```{r} -data("FANG") - FANG ``` diff --git a/vignettes/TQ02-quant-integrations-in-tidyquant.Rmd b/vignettes/TQ02-quant-integrations-in-tidyquant.Rmd index fb22fd36..2e67ce90 100644 --- a/vignettes/TQ02-quant-integrations-in-tidyquant.Rmd +++ b/vignettes/TQ02-quant-integrations-in-tidyquant.Rmd @@ -39,8 +39,11 @@ Load the `tidyquant` package to get started. ```{r} # Loads tidyquant, lubridate, xts, quantmod, TTR -library(tidyverse) library(tidyquant) +library(lubridate) +library(dplyr) +library(tidyr) +library(ggplot2) ``` # 1.0 Function Compatibility @@ -176,11 +179,9 @@ The `PerformanceAnalytics` mutation functions all deal with returns: # 2.0 Quantitative Power In Action -We'll go through some examples, but first let's get some data. The `FANG` data set will be used which consists of stock prices for FB, AMZN, NFLX, and GOOG from the beginning of 2013 to the end of 2016. +We'll go through some examples, but first let's get some data. The `FANG` data set will be used which consists of stock prices for META, AMZN, NFLX, and GOOG from the beginning of 2013 to the end of 2016. ```{r} -data("FANG") - FANG ``` @@ -269,7 +270,7 @@ FANG_daily <- FANG %>% FANG_daily %>% ggplot(aes(x = date, y = adjusted, color = symbol)) + - geom_line(size = 1) + + geom_line(linewidth = 1) + labs(title = "Daily Stock Prices", x = "", y = "Adjusted Prices", color = "") + facet_wrap(~ symbol, ncol = 2, scales = "free_y") + @@ -289,7 +290,7 @@ FANG_monthly <- FANG %>% FANG_monthly %>% ggplot(aes(x = date, y = adjusted, color = symbol)) + - geom_line(size = 1) + + geom_line(linewidth = 1) + labs(title = "Monthly Stock Prices", x = "", y = "Adjusted Prices", color = "") + facet_wrap(~ symbol, ncol = 2, scales = "free_y") + @@ -306,7 +307,7 @@ Return correlations are a common way to analyze how closely an asset or portfoli ```{r} # Asset Returns FANG_returns_monthly <- FANG %>% - group_by(symbol) %>% + dplyr::group_by(symbol) %>% tq_transmute(select = adjusted, mutate_fun = periodReturn, period = "monthly") @@ -347,7 +348,7 @@ And, we can plot the rolling correlations for the FANG stocks. FANG_rolling_corr %>% ggplot(aes(x = date, y = rolling.corr.6, color = symbol)) + geom_hline(yintercept = 0, color = palette_light()[[1]]) + - geom_line(size = 1) + + geom_line(linewidth = 1) + labs(title = "FANG: Six Month Rolling Correlation to XLK", x = "", y = "Correlation", color = "") + facet_wrap(~ symbol, ncol = 2) + @@ -433,7 +434,7 @@ And, we can visualize the data like so. FANG_by_qtr %>% ggplot(aes(x = year.qtr, color = symbol)) + geom_segment(aes(xend = year.qtr, y = min.close, yend = max.close), - size = 1) + + linewidth = 1) + geom_point(aes(y = max.close), size = 2) + geom_point(aes(y = min.close), size = 2) + facet_wrap(~ symbol, ncol = 2, scale = "free_y") + @@ -518,8 +519,8 @@ Finally, we can visualize the first coefficient like so. A horizontal line is ad ```{r} stock_pairs %>% ggplot(aes(x = date, y = coef.1)) + - geom_line(size = 1, color = palette_light()[[1]]) + - geom_hline(yintercept = 0.8134, size = 1, color = palette_light()[[2]]) + + geom_line(linewidth = 1, color = palette_light()[[1]]) + + geom_hline(yintercept = 0.8134, linewidth = 1, color = palette_light()[[2]]) + labs(title = "MA ~ V: Visualizing Rolling Regression Coefficient", x = "") + theme_tq() ``` @@ -535,7 +536,7 @@ stock_prices %>% col_rename = "returns") %>% mutate(wealth.index = 100 * cumprod(1 + returns)) %>% ggplot(aes(x = date, y = wealth.index, color = symbol)) + - geom_line(size = 1) + + geom_line(linewidth = 1) + labs(title = "MA and V: Stock Prices") + theme_tq() + scale_color_tq() diff --git a/vignettes/TQ03-scaling-and-modeling-with-tidyquant.Rmd b/vignettes/TQ03-scaling-and-modeling-with-tidyquant.Rmd index e593072d..9fd9c4de 100644 --- a/vignettes/TQ03-scaling-and-modeling-with-tidyquant.Rmd +++ b/vignettes/TQ03-scaling-and-modeling-with-tidyquant.Rmd @@ -7,7 +7,7 @@ output: toc: true toc_depth: 2 vignette: > - %\VignetteIndexEntry{Scaling Your Analysis with tidyquant} + %\VignetteIndexEntry{Scaling and Modeling with tidyquant} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- @@ -45,7 +45,11 @@ Load the `tidyquant` package to get started. ```{r} # Loads tidyquant, lubridate, xts, quantmod, TTR, and PerformanceAnalytics -library(tidyverse) +library(lubridate) +library(dplyr) +library(purrr) +library(ggplot2) +library(tidyr) library(tidyquant) ``` @@ -58,11 +62,11 @@ A very basic example is retrieving the stock prices for multiple stocks. There a ## Method 1: Map a character vector with multiple stock symbols ```{r} -c("AAPL", "GOOG", "FB") %>% +c("AAPL", "GOOG", "META") %>% tq_get(get = "stock.prices", from = "2016-01-01", to = "2017-01-01") ``` -The output is a single level tibble with all or the stock prices in one tibble. The auto-generated column name is "symbol", which can be pre-emptively renamed by giving the vector a name (e.g. `stocks <- c("AAPL", "GOOG", "FB")`) and then piping to `tq_get`. +The output is a single level tibble with all or the stock prices in one tibble. The auto-generated column name is "symbol", which can be pre-emptively renamed by giving the vector a name (e.g. `stocks <- c("AAPL", "GOOG", "META")`) and then piping to `tq_get`. ## Method 2: Map a tibble with stocks in first column @@ -117,8 +121,6 @@ You can use any applicable "getter" to get data for __every stock in an index or Once you get the data, you typically want to do something with it. You can easily do this at scale. Let's get the yearly returns for multiple stocks using `tq_transmute`. First, get the prices. We'll use the `FANG` data set, but you typically will use `tq_get` to retrieve data in "tibble" format. ```{r} -data("FANG") - FANG ``` @@ -200,7 +202,7 @@ AAPL_annual_log_returns %>% ggplot(aes(x = year(date), y = yearly.returns)) + geom_hline(yintercept = 0, color = palette_light()[[1]]) + geom_point(size = 2, color = palette_light()[[3]]) + - geom_line(size = 1, color = palette_light()[[3]]) + + geom_line(linewidth = 1, color = palette_light()[[3]]) + geom_smooth(method = "lm", se = FALSE) + labs(title = "AAPL: Visualizing Trends in Annual Returns", x = "", y = "Annual Returns", color = "") + diff --git a/vignettes/TQ04-charting-with-tidyquant.Rmd b/vignettes/TQ04-charting-with-tidyquant.Rmd index 840db07a..8c19e8ff 100644 --- a/vignettes/TQ04-charting-with-tidyquant.Rmd +++ b/vignettes/TQ04-charting-with-tidyquant.Rmd @@ -40,7 +40,9 @@ Load the `tidyquant` package to get started. ```{r} # Loads tidyquant, lubridate, xts, quantmod, TTR, and PerformanceAnalytics -library(tidyverse) +library(lubridate) +library(dplyr) +library(ggplot2) library(tidyquant) ``` @@ -48,8 +50,6 @@ The following stock data will be used for the examples. Use `tq_get` to get the ```{r} # Use FANG data set -data("FANG") - # Get AAPL and AMZN Stock Prices AAPL <- tq_get("AAPL", get = "stock.prices", from = "2015-09-01", to = "2016-12-31") AMZN <- tq_get("AMZN", get = "stock.prices", from = "2000-01-01", to = "2016-12-31") @@ -136,7 +136,7 @@ AAPL %>% labs(title = "AAPL Bar Chart", subtitle = "Zoomed in, Experimenting with Formatting", y = "Closing Price", x = "") + - coord_x_date(xlim = c(end - weeks(6), end), + coord_x_date(xlim = c(end - lubridate::weeks(6), end), c(aapl_range_60_tbl$min_low, aapl_range_60_tbl$max_high)) + theme_tq() ``` @@ -194,7 +194,7 @@ We can use `facet_wrap` to visualize multiple stocks at the same time. By adding ```{r, fig.height=5} start <- end - weeks(6) FANG %>% - filter(date >= start - days(2 * 15)) %>% + dplyr::filter(date >= start - days(2 * 15)) %>% ggplot(aes(x = date, y = close, group = symbol)) + geom_candlestick(aes(open = open, high = high, low = low, close = close)) + labs(title = "FANG Candlestick Chart", @@ -212,7 +212,7 @@ The `coord_x_date` coordinate function is designed to zoom into specific section ```{r, fig.height=5} start <- end - weeks(6) FANG %>% - filter(date >= start - days(2 * 15)) %>% + dplyr::filter(date >= start - days(2 * 15)) %>% ggplot(aes(x = date, y = close, group = symbol)) + geom_candlestick(aes(open = open, high = high, low = low, close = close)) + geom_ma(ma_fun = SMA, n = 15, color = "darkblue", size = 1) + @@ -295,7 +295,7 @@ We'll double up using a volume-weighted average (`VWMA`) and apply it to the FAN ```{r, fig.height=5} start <- end - weeks(6) FANG %>% - filter(date >= start - days(2 * 50)) %>% + dplyr::filter(date >= start - days(2 * 50)) %>% ggplot(aes(x = date, y = close, volume = volume, group = symbol)) + geom_candlestick(aes(open = open, high = high, low = low, close = close)) + geom_ma(ma_fun = VWMA, n = 15, wilder = TRUE, linetype = 5) + @@ -364,7 +364,7 @@ The process is very similar to charting moving averages for multiple stocks. ```{r, fig.height=5} start <- end - weeks(24) FANG %>% - filter(date >= start - days(2 * 20)) %>% + dplyr::filter(date >= start - days(2 * 20)) %>% ggplot(aes(x = date, y = close, open = open, high = high, low = low, close = close, group = symbol)) + @@ -455,7 +455,7 @@ And, we can zoom in on a specific region. Using `scale_color_gradient` we can qu ```{r} start <- end - weeks(24) AMZN %>% - filter(date >= start - days(50)) %>% + dplyr::filter(date >= start - days(50)) %>% ggplot(aes(x = date, y = volume)) + geom_segment(aes(xend = date, yend = 0, color = volume)) + geom_smooth(method = "loess", se = FALSE) + @@ -482,9 +482,9 @@ The `tidyquant` package comes with three themes to help quickly customize financ ```{r, fig.height = 6} n_mavg <- 50 # Number of periods (days) for moving average FANG %>% - filter(date >= start - days(2 * n_mavg)) %>% + dplyr::filter(date >= start - days(2 * n_mavg)) %>% ggplot(aes(x = date, y = close, color = symbol)) + - geom_line(size = 1) + + geom_line(linewidth = 1) + geom_ma(n = 15, color = "darkblue", size = 1) + geom_ma(n = n_mavg, color = "red", size = 1) + labs(title = "Dark Theme", @@ -493,6 +493,6 @@ FANG %>% facet_wrap(~ symbol, scales = "free_y") + theme_tq_dark() + scale_color_tq(theme = "dark") + - scale_y_continuous(labels = scales::dollar) + scale_y_continuous(labels = scales::label_dollar()) ``` diff --git a/vignettes/TQ05-performance-analysis-with-tidyquant.Rmd b/vignettes/TQ05-performance-analysis-with-tidyquant.Rmd index ab65e1be..cf7d1b5b 100644 --- a/vignettes/TQ05-performance-analysis-with-tidyquant.Rmd +++ b/vignettes/TQ05-performance-analysis-with-tidyquant.Rmd @@ -60,7 +60,8 @@ We'll use the `PerformanceAnalytics` function, `table.CAPM`, to evaluate the ret First, load the `tidyquant` package. ```{r} -library(tidyverse) +library(dplyr) +library(ggplot2) library(tidyquant) ``` @@ -617,7 +618,7 @@ portfolio_growth_monthly <- stock_returns_monthly %>% ```{r} portfolio_growth_monthly %>% ggplot(aes(x = date, y = investment.growth)) + - geom_line(size = 2, color = palette_light()[[1]]) + + geom_line(linewidth = 2, color = palette_light()[[1]]) + labs(title = "Portfolio Growth", subtitle = "50% AAPL, 0% GOOG, and 50% NFLX", caption = "Now we can really visualize performance!", @@ -648,7 +649,7 @@ portfolio_growth_monthly_multi <- stock_returns_monthly_multi %>% ```{r} portfolio_growth_monthly_multi %>% ggplot(aes(x = date, y = investment.growth, color = factor(portfolio))) + - geom_line(size = 2) + + geom_line(linewidth = 2) + labs(title = "Portfolio Growth", subtitle = "Comparing Multiple Portfolios", caption = "Portfolio 3 is a Standout!", diff --git a/vignettes/TQ06-excel-in-r.Rmd b/vignettes/TQ06-excel-in-r.Rmd index 94dbf94d..9883c06b 100644 --- a/vignettes/TQ06-excel-in-r.Rmd +++ b/vignettes/TQ06-excel-in-r.Rmd @@ -1,8 +1,8 @@ --- -title: "Excel in R - tidyquant 1.0.0" +title: "Excel in R with tidyquant" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{Excel in R - tidyquant 1.0.0} + %\VignetteIndexEntry{Excel in R with tidyquant} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} ---