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

Backtesting accuracy of regression model through rolling window regression with quantmod

I´ve been trying to backtest the predictability of a regression (trying to get one-step-ahead predictions) by implementing a rolling window regression and calculating and recording the difference between the estimation and the last available day,…
Pedro9
  • 186
  • 1
  • 11
5
votes
1 answer

Removing NULL objects from an environment

I have an environment of objects that are either xts or NULL. I would like to remove all the NULL from the environment. Is there a function I can use with eapply to achieve this?
lab_notes
  • 407
  • 5
  • 11
5
votes
1 answer

XTS dates from different sources. Using R to calculate beta

I'm somewhat new to R. I imagine my error will be trivial to the experienced. I'm attempting to write an R program that will calculate beta for a number of stocks. The stock symbols are read from Input.csv, and the data is downloaded from yahoo. The…
Daniel Morgan
  • 179
  • 1
  • 5
5
votes
1 answer

Working with chartSeries in quantmod

I'm a newbie to R and it has been very helpful to use your website. Unfortunately I've been struggling with my code now for two days so I wanted to ask few questions. I've been trying to create nice graphs to put into a pdf sheet but I'm having…
Denni17
  • 51
  • 1
  • 2
5
votes
2 answers

quantmod::chart_Series() bug?

I would like to chart SPX using quantmod::chart_Series() and below draw changes in GDP and 12 month SMA of changes of GDP. No matter how I try to do it (what combinations I use) eithe errors occur or quantmod::chart_Series() displays just partial…
Samo
  • 2,065
  • 20
  • 41
5
votes
1 answer

Override y-scale and x-scale using xlim/ylim or xrange/yrange in quantmod::chart_Series() - impossible?

I am trying to plot some support/resistance lines on top of quantmod::chart_Series(). The issue is that the interesting support/resistance lines are outside (below or above) series data range up to current time (I would also like to extend a chart a…
Samo
  • 2,065
  • 20
  • 41
5
votes
1 answer

How to get Dow Jones Index (DJI) data from Google?

I am trying to get the data for the Dow Jones Index from google. I have tried a number of things but they do not seem to work. require(quantmod) getSymbols(".DJI",src = "google") getSymbols("^DJI",src = "google") getSymbols("INDEXDJX:.DJI",src =…
adam.888
  • 7,686
  • 17
  • 70
  • 105
4
votes
2 answers

R/quantmod: how to specify the bollinger bands colour?

This could be more generally be How to change the theme colours? Or maybe TA colours are not controlled by theme? This makes bollinger bands with a nice cloud effect: chartSeries(bars, theme="white") addBBands() (See example of how it looks (near…
Darren Cook
  • 27,837
  • 13
  • 117
  • 217
4
votes
1 answer

Set Quantmod chartSeries line color from green to another color

Using version.string R version 2.11.0 (2010-04-22) quantmod "0.3-17" Windows XP When using the chartSeries function in quantmod with type="line" the line color that is displayed on the chart is green. I would like to change the color from green…
tuffgoat
  • 43
  • 1
  • 3
4
votes
1 answer

Pulling historic analyst opinions from yahoo finance in R

Yahoo Finance has data on historic analyst opinions for stocks. I'm interested in pulling this data into R for analysis, and here is what I have so far: getOpinions <- function(symbol) { require(XML) require(xts) yahoo.URL <-…
Zach
  • 29,791
  • 35
  • 142
  • 201
4
votes
1 answer

Adding points to xts plot

I thought Adding Points, Legends and Text to plots using xts objects would have the answer to this question, but apparently not... require(quantmod) getSymbols("SAM") big.red.dot <- zoo(85, as.Date("2011-05-05")) plot(SAM['2011']) points( …
isomorphismes
  • 8,233
  • 9
  • 59
  • 70
4
votes
2 answers

Changing the name of a column when using getSymbols("JOSJFSODFJSODfJ", src = "FRED")

This is probably stupid but i've not been able to see a solution. When downloading FRED data it has horrible names such as FranceExports <<- getSymbols("FRAXTEXVA01CXMLM", src = "FRED", auto.assign = FALSE) I want to put a lot of data in a…
4
votes
2 answers

R: Convert daily returns to monthly returns

I have an xts of daily returns and I'd like to convert it to monthly returns. I can find tonnes of threads to convert daily prices to period returns, but I need to convert daily returns. Having followed the advice in this thread, which works well, I…
Jimbo Mahoney
  • 220
  • 2
  • 9
4
votes
2 answers

Function to calculate daily % change from yesterday close and apply it to multiple tickers

With the help of community I've created the code to download multiple tickers from a .csv file list and create a daily range function to all of them. Now I would like to create a similar function to calculate the daily percentage change (%) of each…
user9985437
4
votes
1 answer

Normalizing stock charts using xts

I want to do a project with quantmod and compare Stock charts. As these Charts usually have different absolute values I wanted to normalize by dividing through the first value. loading data getSymbols(Symbols = "^IXIC", verbose = FALSE, warnings =…
vvostock
  • 43
  • 2