quantmod

Download failed while using quantmod function getSymbols in For loop

社会主义新天地 提交于 2019-12-11 18:56:48
问题 I am trying to get data for the 1632 stocks that comprise the NSE index in India using the quantmod package. I am able to download stocks individually; however, when I loop over all the stocks, I am getting a timeout. How do I loop the getSymbols function to download the desire data? Following error is reported: Error: '20MICRONS.NS' download failed after two attempts. Error message: HTTP error 404. 5. stop(Symbols.name, " download failed after two attempts. Error", " message:\n", attr(dl,

getOptionChain() not returning any data in R

守給你的承諾、 提交于 2019-12-11 18:36:05
问题 for the past day I have not been able to get any option chains via quantmod::getOptionChain() and wanted to know if anyone else is experiencing the same or how I can fix the issue... library("quatmod") getOptionChain("AAPL") returns: named list() with no data sessionInfo() R version 3.3.0 (2016-05-03) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.11.5 (El Capitan) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1]

Problems plotting intraday OHLC data in R with quantmod chartSeries

浪子不回头ぞ 提交于 2019-12-11 17:16:34
问题 I have an xts/zoo object ESZ1: > class(ESZ1) [1] "xts" "zoo" with > class(time(ESZ1)) [1] "POSIXt" "POSIXct" and > colnames(ESZ1) [1] "ESZ1.Open" "ESZ1.High" "ESZ1.Low" "ESZ1.Close" "ESZ1.Volume" "ESZ1.WAP" "ESZ1.hasGaps" "ESZ1.Count" and I would like to plot it using the chartSeries function from the package quantmod. However, I get the following error: > chartSeries(ESZ1) Error in if (on == "years") { : missing value where TRUE/FALSE needed Any ideas of what the problem could be would be

Using lapply to find individual mean across multiple dataframes - error incorrect number of dimensions

一笑奈何 提交于 2019-12-11 13:32:27
问题 I have multiple dataframes that contain stock market data in the form: Open High Low Close Volume I am trying to get an average (over a given period) of the last row of each stock and combine them into a single data frame like so: Name SMA StockA 15.1 StockB 34.44 I have a simple function that calculates the mean value and formats it correctly. It works on when I run it on a single stock (dataframe). However when I try and use lapply to apply the function to a list of all the dataframes, I

Quantmod: Error loading symbols from MySQL DB

廉价感情. 提交于 2019-12-11 11:29:14
问题 I am trying to fetch symbols from a MySQL db using getSymbols, however the following code library(blotter) library(DBI) library(RMySQL) setDefaults(getSymbols.MySQL,user="****", password="****", dbname="quantmoddb") currency("USD") stock("myspy",currency="USD",multiplier=1) getSymbols("myspy",src="MySQL") throws Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘dbConnect’ for signature ‘"character"’ I am pretty sure the db is set up correctly as the

Overlap time series with different dataframes

梦想与她 提交于 2019-12-11 10:59:06
问题 I am using different time series in order to plot a graph with recession bars. For the single graph it works fine. However, I would like to overlap the different time series in one single graph. I used the code for the recession bars from [here][1]. Moreover, I thought a solution might be to bind or melt the different time series as described [here][2]. I would be very grateful, if somebody takes the time and effort to help me. Please, find my R code below: library(quantmod) library(ggplot2)

How to index one minute intraday data in xts?

烂漫一生 提交于 2019-12-11 05:33:01
问题 I have worked with daily stock data using quantmod. Quantmod automatically dowloads data from google/yahoo finance sites and convert automatically to a xts object as date as the index. AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted 2014-10-01 100.59 100.69 98.70 99.18 51491300 97.09741 2014-10-02 99.27 100.22 98.04 99.90 47757800 97.80230 2014-10-03 99.44 100.21 99.04 99.62 43469600 97.52818 2014-10-06 99.95 100.65 99.42 99.62 37051200 97.52818 2014-10-07 99.43 100.12 98.73

Date error while reading csv file into getSymbols

杀马特。学长 韩版系。学妹 提交于 2019-12-11 03:00:27
问题 I'm trying to read a csv file from my local machine using quantmod. I tried the getSymbols method but it failed but it seemed to be working when used with src="yahoo" . So I downloaded a file from yahoo and replaced it with my data. getSymbols("STOCKFUT",src="csv") R is now able to read the file. However when I type: > head(STOCKFUT) STOCKFUT.Open STOCKFUT.High STOCKFUT.Low STOCKFUT.Close 2014-03-18 393.70 396.00 388.10 391.65 2014-03-18 392.20 394.95 388.20 391.00 2014-03-18 389.00 389.00

quantmod::chartSeries does not plot all components

喜你入骨 提交于 2019-12-11 02:37:08
问题 I have read quite a lot of R docs, but I can't find anything I recognized as the answer to this. My forehead is sore from banging it against the desk. ;) This is specific to library(quantmod) , because that is what I am trying to learn, but I suppose it is a general question too. R 2.12.2 GUI 1.36 Leopard build 64-bit (5691) Mac OS X 10.6.6 I am trying to replicate the behaviour of a quantmod example at http://www.quantmod.com/examples/intro/ From the GUI, all is well - the below generates a

How to change the date format from yearmon to yyyy-mm-dd?

妖精的绣舞 提交于 2019-12-10 19:55:27
问题 My ultimate bjective is to plot the monthly S&P 500, Sotheby's, and Industrial Production into one normalized ggplot2, including recession bars. I collect my data via quantmod and Quandl: #======= LOAD PACKAGES ==================================== library(tseries) library(quantmod) library(Quandl) library(ggplot2) library(forecast) library(urca) #======= DATA IMPORT ====================================== env1 = new.env() getSymbols("^GSPC", env = env1, src ="yahoo", from = as.Date("1988-06-01