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

an alternative Quantmod ZigZag overlay

i'm currently using quantmod ZigZag overlay and i noticed it is calculated a bit differently then the original overlay. I've demonstrated the difference in the following picture of RDWR using ZigZag(5%) with quantmod and a with a different program.…
haki
  • 9,389
  • 15
  • 62
  • 110
6
votes
1 answer

addSMA not drawn on graph when called from function

I am a newbie for R and have got stuck here. I am trying to draw a graph with price, sma and ema. When I call the graph from the command line it draws fine including price, sma and ema: tickers =…
user1848880
  • 77
  • 10
5
votes
0 answers

Using MySQL as cache for quantmod getSymbols

I've been using quantmods getSymbols function a lot and would like to reduce the load on the external data providers and reduce the time it takes to execute longer code loops because of network latency. Ideal would be a function that takes a list of…
psandersen
  • 113
  • 1
  • 5
5
votes
2 answers

Parsing quotes in R: Quantmod application

I'm trying to create function that provides historical volatility after getting symbol from Yahoo. However, when I pass output to volatility function it doesn't like it; The Get variable gets assigned a vector with quotes, e.g. "SPY", but the…
jd8585
  • 187
  • 1
  • 8
5
votes
2 answers

quantmod: buildData(,na.rm=FALSE) drops head of time series

I want to create a dataset from FRED series and I use the quantmod package like so: library(quantmod) getSymbols(c('FEDFUNDS', 'GDPPOT', 'DGS10'), src='FRED') dat <- buildData(FEDFUNDS ~ DGS10 + GDPPOT, na.rm=FALSE) What I need is an xts object…
Vincent
  • 15,809
  • 7
  • 37
  • 39
5
votes
3 answers

How can I eliminate quote marks around parameters in R function?

Here are the first few lines of an R function that works: teetor <- function(x,y) { require("quantmod") require("tseries") alpha <- getSymbols(x, auto.assign=FALSE) bravo <- getSymbols(y, auto.assign=FALSE) t <- as.data.frame(merge(alpha,…
Milktrader
  • 9,278
  • 12
  • 51
  • 69
5
votes
2 answers

Quantmod getFX function error

I have been using the function the last months but the last couple of day it stopped working: library(quantmod) getFX("USD/JPY") Error in open.connection(con, "rb") : HTTP error 404. Anyone else having the same problem? Any alternatives in R for…
sen_saven
  • 182
  • 12
5
votes
1 answer

Adding Multiple Chart Series in Quantmod R

I am trying to plot two charts on one chartSeries in quantmod in R. I am having some difficulty doing this. library(quantmod) tickers <- c('GLD', 'GDX') data <- new.env() getSymbols(tickers, src = 'yahoo', from = '1980-01-01', env =…
Defcon
  • 807
  • 3
  • 15
  • 36
5
votes
1 answer

Change background color panel based on year in ggplot R

I'm plotting a time series for three different years 2013, 2014, 2015. require(quantmod) require(ggplot2) getSymbols("AAPL", from='2013-01-1') aapl.df = data.frame(date=time(AAPL), coredata(AAPL.Close)) ggplot(data=aapl.df, aes(x=date,…
Rhodo
  • 1,234
  • 4
  • 19
  • 35
5
votes
1 answer

Quantmod Oscillators

Utilizing the chartSeries function in the quantmod package, I want to modify the RSI oscillator. Given an xts object containing OHLC price data, here is the call that I am using: chartSeries(plot_report[, 1:4], name = substr(ticker,…
jonnie
  • 745
  • 1
  • 13
  • 22
5
votes
2 answers

Plot time series using different colours based on factor

I'd like to plot a single line which is multi-coloured, and the colours are based on the corresponding value in a factor. For instance, a time series of daily stock close price, where the days it has gone up by more than a certain amount are in…
Darren Cook
  • 27,837
  • 13
  • 117
  • 217
5
votes
2 answers

R: Converting output from getSymbols() to data frame in one command without calling the object name explicitly

I would like to to convert output from the getSymbols in quantmod package to a data frame. Presently I achieve that with the following code. Data <- new.env() getSymbols(Symbols = "EUR/USD", src = "oanda", from = "2005-01-01", to =…
Konrad
  • 17,740
  • 16
  • 106
  • 167
5
votes
1 answer

Loading intraday data into R for handling it with quantmod

I need to modify this example code for using it with intraday data which I should get from here and from here. As I understand, the code in that example works well with any historical data (or not?), so my problem then boils down to a question of…
5
votes
1 answer

Y Axis is cut off using Chartseries in R

I am using chartSeries and the Y axis is getting cut off. I'd like the price on the right to extend to 2 decimal places. It seems to be an issue of margins or font size, but after doing some searching around, I can't find anywhere to adjust these…
mks212
  • 901
  • 1
  • 18
  • 40
5
votes
1 answer

Read intraday data with getSymbols.csv

I installed the quantmod package and I'm trying to import a csv file with 1 minute intraday data. Here is a sample GAZP.csv…
Vladimir
  • 51
  • 2