quantmod

Why is there a delay in getting opening trade price using quantmod

社会主义新天地 提交于 2021-02-19 07:01:06
问题 I'm using quantmod package for my trading but in the last few days I get a delay in getting the open daily price ( SPY ) when I run my code on market open time 9:30 AM EST. After about 10 minutes all is working great and I get the numbers but how can I bypass this delay ? Is it because of my code or another reason? I use quantmod Version 0.4-4. # rm(list = ls()) # generally considered as bad manner in an MWE require(quantmod) options(scipen=999) spy <- getSymbols(("SPY") , src = 'yahoo', from

R code to rename header of an xts object using name(object) <- vector

旧巷老猫 提交于 2021-02-19 05:38:08
问题 I'm new to learning R and I'm having an issue with some of my R code. I placed all the code for your convenience so that you can see the logic in what I am trying to do. My issue is renaming the header of my xts object Monthly_Quotes. I understand that when having an invalid stock symbol, the getsymbols function will not retrieve the quotes for "zzzz", which is why I am running into the issue of renaming the header. I'd like to resolve this such that if I have a much larger list of ticker

How to get ETF Financial information (e.g. NAV) from Yahoo (with Quantmod)?

百般思念 提交于 2021-02-07 09:51:22
问题 I know that I can use the quantmod package to get stock financial information easily from yahoo. For example, if I want to get the Volume, P/E ratio and Dividend Yield: > library(quantmod) > AAPL <- getSymbols("AAPL") Warning message: In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, : downloaded length 167808 != reported length 200 > what_metrics <- yahooQF(c("Name", + "Volume", + "P/E Ratio", + "Dividend Yield" + + )) > > getQuote(AAPL, what=what_metrics) Trade Time Name

How to get ETF Financial information (e.g. NAV) from Yahoo (with Quantmod)?

假装没事ソ 提交于 2021-02-07 09:50:15
问题 I know that I can use the quantmod package to get stock financial information easily from yahoo. For example, if I want to get the Volume, P/E ratio and Dividend Yield: > library(quantmod) > AAPL <- getSymbols("AAPL") Warning message: In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, : downloaded length 167808 != reported length 200 > what_metrics <- yahooQF(c("Name", + "Volume", + "P/E Ratio", + "Dividend Yield" + + )) > > getQuote(AAPL, what=what_metrics) Trade Time Name

Shiny app Error chartSeries requires an xtsible object?

≯℡__Kan透↙ 提交于 2021-01-29 13:03:16
问题 I have following basic code with shiny: library(quantmod); library(shiny); ui <- fluidPage( textInput("Symbol","Assign_Symbol","GOOG"), dateRangeInput("Date","Assing_Date", start = Sys.Date() - 20, end = Sys.Date()), plotOutput("Chart") ) server <- function(input, output) { envSymbol <- new.env() Sym <- "Sym" envSymbol[[Sym]] <- reactive({ as.xts(getSymbols(input$Symbol, auto.assign = FALSE)) }) output$Chart <- renderPlot({ chartSeries( envSymbol[[Sym]], theme = chartTheme("white"), type =

xtsible object, looping in quantmod

谁都会走 提交于 2021-01-29 01:49:45
问题 I would like to loop through a list of stock symbols and print them with chartSeries . It would be easier than always changing the argument. Unfortunatly I always get an error, when I want to loop or subset: Error in try.xts(x, error = "chartSeries requires an xtsible object"): chartSeries requires an xtsible object Here the code that produces the error: library(quantmod) stocks <- c("FIS", "AXP", "AVB") symbols <- (getSymbols(stocks, src='yahoo')) for (i in symbols){ chartSeries(i, theme=

xtsible object, looping in quantmod

自闭症网瘾萝莉.ら 提交于 2021-01-29 01:49:34
问题 I would like to loop through a list of stock symbols and print them with chartSeries . It would be easier than always changing the argument. Unfortunatly I always get an error, when I want to loop or subset: Error in try.xts(x, error = "chartSeries requires an xtsible object"): chartSeries requires an xtsible object Here the code that produces the error: library(quantmod) stocks <- c("FIS", "AXP", "AVB") symbols <- (getSymbols(stocks, src='yahoo')) for (i in symbols){ chartSeries(i, theme=

xtsible object, looping in quantmod

那年仲夏 提交于 2021-01-29 01:48:35
问题 I would like to loop through a list of stock symbols and print them with chartSeries . It would be easier than always changing the argument. Unfortunatly I always get an error, when I want to loop or subset: Error in try.xts(x, error = "chartSeries requires an xtsible object"): chartSeries requires an xtsible object Here the code that produces the error: library(quantmod) stocks <- c("FIS", "AXP", "AVB") symbols <- (getSymbols(stocks, src='yahoo')) for (i in symbols){ chartSeries(i, theme=

xtsible object, looping in quantmod

好久不见. 提交于 2021-01-29 01:42:02
问题 I would like to loop through a list of stock symbols and print them with chartSeries . It would be easier than always changing the argument. Unfortunatly I always get an error, when I want to loop or subset: Error in try.xts(x, error = "chartSeries requires an xtsible object"): chartSeries requires an xtsible object Here the code that produces the error: library(quantmod) stocks <- c("FIS", "AXP", "AVB") symbols <- (getSymbols(stocks, src='yahoo')) for (i in symbols){ chartSeries(i, theme=

Rbind with XTS. How to stack without sorting by index date

北战南征 提交于 2021-01-04 02:41:41
问题 I am using quantmod which generates XTS objects with ticker info, and I am looking to compile/stack a bunch of XTS documents on top of each other to process code. Using Rbind with XTS I find that it does not stack XTS on top of each other, rather it merges and sorts by date: x <- xts(1:10, Sys.Date()+1:10) x [,1] 2014-07-10 1 2014-07-11 2 2014-07-12 3 2014-07-13 4 2014-07-14 5 2014-07-15 6 2014-07-16 7 2014-07-17 8 2014-07-18 9 2014-07-19 10 y <- xts(rep(2,3), Sys.Date()+c(1,2,3)) y [,1] 2014