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 handle dash in yahoo finance tickers with getSymbols in R?

Know very little about R. Trying to adapt some codes to finish an assignment. However, got stuck with the dash in the ticker. symbol.vec=c("BTC-USD","ETH-USD") getSymbols(symbol.vec,from="2015-08-07",to="2017-12-16") BTC =…
Victor Wang
  • 765
  • 12
  • 26
4
votes
1 answer

Why Open,High,Low prices are wrong when using quantmod?

I use this code on a weekly basis, however, when I tried it today I got wrong results of OHL and SPY.Adjusted, looking at the Close prices and Volume they seem correct so what's wrong? rm(list =…
mql4beginner
  • 2,193
  • 5
  • 34
  • 73
4
votes
2 answers

How to loop through objects in the global environment - R

I have looked far and wide for a solution to this issue, but I cannot seem to figure it out. I do not have much experience working with xts objects in R. I have 40 xts objects (ETF data) and I want to run the quantmod function WeeklyReturn on each…
Jared Marks
  • 948
  • 8
  • 15
4
votes
2 answers

Merge xts objects with different time intervals

I download quotes from yahoo with quantmod, compute quarterly returns and want to merge the returns and quotes into one xts object. In this new object I would like to see only the date where I have both a return and a quarterly return (typically…
Dr. Jones
  • 141
  • 1
  • 10
4
votes
3 answers

How to overlay multiple TA in new plot using quantmod?

We can plot candle stick chart using chart series function chartSeries(Cl(PSEC)) I have created some custom values (I1,I2 and I3) which I want to plot together(overlay) outside the candle stick pattern. I have used addTA() for this…
Eka
  • 14,170
  • 38
  • 128
  • 212
4
votes
1 answer

Add vertical line in background in quantmod chart

How can I add vertical line to chart in quantmod that appears in the background? Consider this example: library(quantmod) symbol <- "AAPL" cache <- new.env() getSymbols(symbol, env=cache) chartSeries(cache$AAPL, subset="last 3…
mavam
  • 12,242
  • 10
  • 53
  • 87
4
votes
1 answer

Error while installing xts package on R

I got following errors from the xts package while trying to install the quantmod package: > install.packages("quantmod", repos="http://R-Forge.R-project.org", type="source") also installing the dependencies ‘xts’, ‘TTR’ пробую URL…
pupadupa
  • 1,530
  • 2
  • 17
  • 29
4
votes
1 answer

How to subtract rows in xts

I am using quantmod and I require to find the difference between close value of today and 50th day close value. I tried like this library(quantmod) tickers = 'AAPL' symbol = getSymbols(tickers,from="2014-04-01",auto.assign=F) change…
Eka
  • 14,170
  • 38
  • 128
  • 212
4
votes
1 answer

Getting specific line from Cash Flow

I'm trying to get data from Cash Flow with getFinancials function in R. library(quantmod) s <- c("AAPL","GOOG","IBM","GS","AMZN","GE") fin <- lapply(s, getFinancials, auto.assign=FALSE) names(fin) <- s But when I try to get a specific line…
Filipe Ferminiano
  • 8,373
  • 25
  • 104
  • 174
4
votes
0 answers

How to have addTA() not print legend when the indicator is overlaid on another chart?

In this code: library(quantmod) getSymbols("YHOO") candleChart(YHOO) addTA(Cl(YHOO)/2, legend = "", on = NA ) the legend parameter of addTa() works as expected. But the same value to that parameter does not work if I let on =…
mauna
  • 1,098
  • 13
  • 25
4
votes
1 answer

How I can retrieve the list of all symbols accessible through getSymbols in quantmod?

Is there a function that can return the list of all symbols I can access using getSymbols function from quantmod? I am interested in the downloadable CFDs symbol list for src = 'oanda'. Thanks, Vladimir
4
votes
0 answers

How to write dates to csv file in R?

I'm trying to get dividend information from the web and save it to a .csv file. My code is: library(quantmod) stokname = 'XOM' divseries = getDividends(stokname) write.csv(divseries, file = paste("C:/DATA/dividends/",stokname,".csv", sep = ""),…
siegel
  • 819
  • 2
  • 12
  • 24
4
votes
0 answers

How do blotter/quantstrat/quantmod/performanceanalytics handle internal cashflows and expiring instruments?

I don't understand how internal cashflows are handled in blotter/quantstrat/quantmod/performanceanalytics. This mainly concerns two aspects: Regular cashflows like dividends, coupons etc. as well as cashflows from expiring instruments (e.g. a cash…
Ueli Hofstetter
  • 2,409
  • 4
  • 29
  • 52
4
votes
1 answer

Can getSymbols still work with oanda?

I want to get the data of currencies and metals. As I tried some packages, many person suggest quantmod. So I used getSymbols as the following: getSymbols("USD/EUR",src="oanda") Error in download.file(paste(oanda.URL, from.date, to.date, "exch=",…
kanpu
  • 251
  • 2
  • 10
4
votes
1 answer

xts to.weekly returns both Fridays and Mondays as the end of the week

I don't seem to be able to get the to.weekly and endpoints (which is used by to.weekly) functions in xts to give me the correct end days of weeks for most types of date data. I've had this problem with both the CRAN and R-Forge versions of the xts…