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
-1
votes
1 answer

Exporting Quantmod stock data to excel

I'm trying to export yahoo stock data imported using the getSymbols function to Excel, anyone know how to do this?
Peter
  • 151
  • 1
  • 11
-1
votes
1 answer

Inserting returns from dataframe

I´m trying to insert a column in a dataframe named Reference with returns of stocks obtained from another dataframe called Quotes. Quotes <- data.frame (Ticker = c("Petr4","Petr4","Petr4","Abev3","Abev3","Petr4","Petr4","Abev3","Abev3","Abev3" ), …
WsnCode
  • 39
  • 5
-1
votes
1 answer

Error installing quantmod in RStudio Ubuntu

I have encountered problem installing quantmod in my RStudio Ubuntu VM, which I need help in
Roy.L
  • 1
  • 1
  • 1
  • 3
-1
votes
1 answer

Does this actually return the total return of a portfolio?

I've ran into a bit of trouble of late trying to calculate the returns of my investment portfolio. Here's one way which has been recommended on the Rstudio blog. This way uses the Return.portfolio function from PerformanceAnalytics and which shows…
DavimusPrime
  • 368
  • 4
  • 17
-1
votes
1 answer

Calculating portfolio level returns

EDIT UPDATED I've found a great post by the authors of performanceAnalytics. This post basically sums up the ins-outs of cumulative portfolio returns, and as the author shows it's pretty tricky (he got it wrong too)! Here it is for reference:…
DavimusPrime
  • 368
  • 4
  • 17
-1
votes
2 answers

Plot function outside the candlestick pattern in R

I have two xts objects: stock and base. I calculate the relative strength (which is simply the ratio of closing price of stock and of the base index) and I want to plot the weekly relative strength outside the candlestick pattern. The links for the…
SiXUlm
  • 159
  • 3
  • 12
-1
votes
3 answers

Error in as.POSIXlt.character(x, tz, …) : character string is not in a standard unambiguous format

I use a data set imported from excel: OBX <- read_excel("C:/Users/neri_/Desktop/OBX Weekly Return.xlsx") Date OBX 1 2010-12-28 0.0071366 2 2010-12-29 4.97265e-05 3 2010-12-30 -0.00452489 4 2011-01-03 0.00896603 5 …
Neri Kim
  • 135
  • 1
  • 2
  • 9
-1
votes
1 answer

How do you use stock tickers and for-loops together in R for technical analysis?

I am having trouble finding stock technical indicators using a for-loop to loop through stocks. Below I am using 10 stocks and am trying to see (through the output) if the current 10 day moving average (MA) for each stock is above, below, or at the…
scuba
  • 3
  • 3
-1
votes
1 answer

object mktdata not found

I believe this is a formatting issue with my indicator. Can someone tell me what im doing wrong here? #....omitted the portfolio initialization above #returns change from past day, or NA if one of the values is…
Rilcon42
  • 9,584
  • 18
  • 83
  • 167
-1
votes
1 answer

Adding Function Calculated Column to List of Data Frames

I have started my R learning by using a loop with the quantmod package. Essentially, I'm looping through a vector of stock symbols to download a csv of data from Yahoo, then applying the SMA (sma10 <- SMA(data[c('Adj.Close')],n=10) function to add…
Boone
  • 137
  • 3
  • 14
-1
votes
1 answer

Pass vector of dates to quantmod

I have the following vectors with tickers, start and end dates for which I want to download stock data with quantmod. stock = c("MSFT", "WMT", "APPL") start = c("2015-08-26", "2013-11-12","2015-11-08") end = c("2015-09-26",…
masta-g3
  • 1,202
  • 4
  • 17
  • 27
-1
votes
1 answer

calling addCCI() in quantmod with different maTypes

I tried to use different maType while calling addCCI to make the analysis more accurate. However, when I tried to use maType = "DEMA" or maType = "HMA", quantmod gave me error like: addCCI(maType = "DEMA") Error in runMAD(HLC, n, center = mavg, stat…
Hao Wang
  • 11
  • 1
-1
votes
1 answer

How to save results into a various data.frames with various names

I have the following vector: USTickers=c("BAC","C","JPM","HBS","WFC","GS","MS","USB","BK","PNC") Actually this vector of mine is much longer, but I just cut it short. This vector has ticker names of stocks. I use quantmod to download data of the…
-1
votes
1 answer

How to calculate daily returns of multiple products in R

I have a dataset like the following which contains 46 products price history from 2014-5-1 to 2014-11-30: prodid price date 19119665 27.89999962 11/25/2014 19119665 27.89999962 11/25/2014 19119665 26.89999962 11/27/2014 19119665…
lll
  • 1,049
  • 2
  • 13
  • 39
-1
votes
1 answer

Bollinger Strategy in R with Entry and Exit Signals at Re-allocation Dates

I have the following simple trading strategy: Entry Signal: when the Price of IBM is above the upper Bollinger band. Close Signal: when the Price of IBM is below the lower Bollinger band. Here are the Bollinger Bands: require(quantmod) # load IBM…
Pat
  • 1,299
  • 4
  • 17
  • 40
1 2 3
78
79