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
28
votes
5 answers

Error in model.frame.default: variable lengths differ

On running a gam model using the mgcv package, I encountered a strange error message which I am unable to understand: “Error in model.frame.default(formula = death ~ pm10 + Lag(resid1, 1) + : variable lengths differ (found for 'Lag(resid1,…
Meso
  • 1,375
  • 5
  • 17
  • 36
27
votes
1 answer

How do I rename an R object?

I'm using the quantmod package to import financial series data from Yahoo. library(quantmod) getSymbols("^GSPC") [1] "GSPC" I'd like to change the name of object "GSPC" to "SPX". I've tried the rename function in the reshape package, but it only…
Milktrader
  • 9,278
  • 12
  • 51
  • 69
24
votes
1 answer

Error in new.session() : Could not establish session after 5 attempts

I've been facing in R the error message for days using getSymbols of the quantmod package: Error in new.session() : Could not establish session after 5 attempts. getSymbols(tick, from = date_from, to = date_to, warnings = FALSE, auto.assign =…
Marco Rago
  • 343
  • 1
  • 2
  • 6
14
votes
6 answers

Can't download data from Yahoo Finance using Quantmod in R

I'm trying to download data from Yahoo using this code: library(quantmod) getSymbols("WOW", auto.assign=F) This has worked for me in the past in every occasion except now, 5 days before my group assignment is due. Except now I receive this…
Daniel
  • 149
  • 1
  • 1
  • 4
14
votes
1 answer

ADD a new column into an XTS object

Hi: I have an xts object as such: AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted 2013-09-09 505.00 507.92 503.48 506.17 12116200 506.17 2013-09-10 506.20 507.45 489.50 494.64 …
Ahdee
  • 4,679
  • 4
  • 34
  • 58
13
votes
2 answers

Real time stock price R

I am trying to do some market analysis using R. Is there any way to get real time stock quotes at minutely intervals using a package? I am familiar with quantmod and have used the getSymbols() function, however, all data I am able to mine is 15…
user3731327
  • 131
  • 1
  • 1
  • 4
13
votes
2 answers

Add vertical lines to quantmod::chart_Series

I want to add vertical lines on several dates on a certain graph. So far I haven't managed to achieve this simple task. This is what I tried: > s <- get(getSymbols('nvmi'))["2012::"] > d1 <- index(s[100]) > d1 [1] "2012-05-24" >…
haki
  • 9,389
  • 15
  • 62
  • 110
13
votes
1 answer

Simple function of quantmod not working anymore

I am turning in my thesis tomorow and I'm getting a very bizzare error message with quantmod which I never had during the last weeks while working with this package. I can't manage to import data specificly of Dow Jones index (^DJI). I get the…
jeremy.staub
  • 369
  • 4
  • 12
12
votes
2 answers

Parallelize a rolling window regression in R

I'm running a rolling regression very similar to the following code: library(PerformanceAnalytics) library(quantmod) data(managers) FL <- as.formula(Next(HAM1)~HAM1+HAM2+HAM3+HAM4) MyRegression <- function(df,FL) { df <- as.data.frame(df) model…
Zach
  • 29,791
  • 35
  • 142
  • 201
11
votes
2 answers

R obtaining rownames date using quantmod

Using quantmod and collecting data from Yahoo. I am trying to get the dates that are in rownames. However I am just getting NULL. library("quantmod") sp500 <- new.env() getSymbols("^GSPC", env = sp500, src = "yahoo", from =…
adam.888
  • 7,686
  • 17
  • 70
  • 105
10
votes
1 answer

Obtain date column from xts object

I used getSymbols to obtain stock data, and it returned something like this: > require(quantmod) > getSymbols(AAPL) > head(AAPL) AAPL.Open AAPL.High AAPL.Low AAPL.Close 2007-01-03 86.29 86.58 81.90 83.80 2007-01-04 …
NewbieDave
  • 1,199
  • 3
  • 12
  • 23
10
votes
2 answers

Does Python has a similar library like quantmod in R that can download financial statement data?

Does Python has a similar library like quantmod in R that can download financial statement data? I want to download the historical revenue of each stock in Python. Can someone give me a hint? Thanks.
user2668789
  • 211
  • 1
  • 2
  • 10
9
votes
1 answer

R - Loading External Indicators into Quantstrat

I noticed that Quantstrat typically takes indicators that are based on price. However, I would like to load several indicators that have been externally calculated along with the price data. For instance, I have 2 extra columns in a csv file that…
Tyler
  • 91
  • 3
9
votes
2 answers

Creating Trading Signals in R

I'm constructing a trading strategy and am stuck at two key areas. When using Stoch and MACD in quantmod, I am trying to create a signal when the slow stochastic crosses over the fast stochastic (1), and visa-versa(-1), and flat when in between (0).…
SJSU2013
  • 585
  • 3
  • 8
  • 18
9
votes
3 answers

Downloading FRED data with quantmod: can dates be specified?

I am downloading data from FRED with the quantmod library (author Jeffrey A. Ryan). With Yahoo and Google data, I am able to set start and end dates. Can the same be done for FRED data? The help page does not list "from" and "to" as options of…
PatrickT
  • 10,037
  • 9
  • 76
  • 111
1
2 3
78 79