Questions tagged [quantmod]

quantmod is a package for R designed to assist quantitative traders in the development, testing, and deployment of statistically based trading models.

quantmod is an package for quantitative financial modelling and trading framework. The package is designed to assist quantitative traders in the development, testing, and deployment of statistically based trading models.

Repositories

Other resources

Related tags

1182 questions
4
votes
1 answer

How to download multiple closing stock prices only with getSymbols into separate xts files?

How can I use getSymbols from the quantmod package to do the following: Download multiple stock price histories Select only the adjusted closing prices--i.e., suppress open/high/low and vol data Save each price history as a separate xts file, with…
James Picerno
  • 472
  • 4
  • 16
4
votes
0 answers

Replace NA's with zero in "xts" "zoo" object in R

I'm working on a function within the quantmod package where I want to figure out how to replace the NAs with a zero, such that I don't remove the entire row if I were to use the na.omit function, because I don't want to lose the other values…
NewComer
  • 205
  • 6
  • 12
4
votes
2 answers

R - formula to calculate Bollinger Bands without charting?

I have a OHLC data frame, and trying to calculate the Bollinger Bands without charting witin R. The below works but i'm looking to create a new data frame containing BB levels. head(stock) minutes.Open minutes.High minutes.Low…
user3773444
  • 333
  • 3
  • 12
4
votes
2 answers

Quantmod FRED Metadata in R

library(quantmod) getSymbols("GDPC1",src = "FRED") I am trying to extract the numerical economic/financial data in FRED but also the metadata. I am trying to chart CPI and have the meta data as a labels/footnotes. Is there a way to extract this…
jessica
  • 1,325
  • 2
  • 21
  • 35
4
votes
1 answer

chartSeries grey lines

I am using the chartSeries function from the quantmod package, and the theme I am using is white.mono. The chart is pretty clean, but I want to remove the horizontal grey lines that intersect the y axis. Anybody know how to turn these off? Also, is…
jonnie
  • 745
  • 1
  • 13
  • 22
4
votes
2 answers

R Recession Dates Conversion

I am downloading recession band data into R via quantmod. Now this comes as a binary information (in xts format) looking like this (just the first recession period shown) 1857-01-01 0 1857-02-01 0 1857-03-01 0 1857-04-01 0 1857-05-01 …
user2157086
  • 525
  • 1
  • 5
  • 20
4
votes
4 answers

Processing multiple quant mod stock tickers in parallel in R

I might not explain my questions clear in the title, apologize. Here is the question with the code, it will be clearer, library(zoo);library(quantmod) stockData <- new.env()#Make a new environment for quantmod to store data in startDate =…
StayFoolish
  • 531
  • 1
  • 12
  • 29
4
votes
1 answer

How to bind two xts data environments in R

I am completely new to R and I am learning how to program in R to get historical stock index data. I am planning to build an daily update code to update historic index data. I use a data environment call "indexData" to store the data as a xts. But…
4
votes
2 answers

R: Creating a dynamic list of xts objects

Going crazy trying to create some type of list/data frame containing xts objects. I'm trying loop through a vector of strings (each an economic "ticker"), and create an xts object for each (length varies for each "ticker") using the getSymbols…
ch-pub
  • 1,664
  • 6
  • 29
  • 52
4
votes
0 answers

Pulling Intraday Minute Bar Data with Quantmod in R

I expect this is a fairly simple answer (and I will be embarrassed when I see how easy the solution is), but I am having a lot of trouble pulling intraday stock data by minute using the getSymbols() function under the quantmod package. I try to…
user2665541
  • 153
  • 1
  • 8
4
votes
1 answer

Time series shift into future with R

I'm trying to shift a time series (zoo object) 7 days (trading week) ahead into future. library(quantmod) getSymbols(c("AAPL"), from="2013-01-01", return.class="zoo") aapl <- Ad(AAPL) tail(aapl) 2013-05-07 2013-05-08 2013-05-09 2013-05-10…
dansan566
  • 91
  • 1
  • 7
4
votes
2 answers

get xts objects from within an environment

I have stored xts objects inside an environment. Can I subset these objects while they are stored in an environment, i.e. act upon them "in-place"? Can I extract these objects by referring to their colname? Below an example of what I'm getting at. #…
PatrickT
  • 10,037
  • 9
  • 76
  • 111
4
votes
2 answers

Coercing a POSIXct object to Date object

Reproducible code: # Loading quantmod library(quantmod) # Please, put in R this structure a <- structure(c(2.4, 2.35, 2.44, 2.44, 2.31, 2.32, 2.41, 2.43, 2.46, 2.42, 2.45, 2.39, 2.3, 2.41, 2.33, 2.37, 2.38, 2.4, 2.275, 2.235, …
Lisa Ann
  • 3,345
  • 6
  • 31
  • 42
4
votes
2 answers

How can I download a set of prices with getSymbols and store them in the order it was requested?

I download historical prices with quantmod's getSymbols function for multiple tickers and convert them into either a list or a multivariate XTS with the following code: library(quantmod) myenv <- new.env() tickers <- c("^GSPC", "AAPL", "MSFT",…
mchangun
  • 9,814
  • 18
  • 71
  • 101
4
votes
1 answer

adding a vertical line to a chartSeries graphic

I hope this isn't redundant as I've googled extensively and still have not found an answer. I'm plotting intraday data and want to place a vertical line at a specific point in time. It seems I have to use the function addTA but it always plots below…
user1229681
  • 107
  • 2
  • 6