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

How to create a technical indicator in quantmod package

I'm a newbie to R and I am facing some problems with the creation of a technical indicator. More specifically, I want to create an indicator, Fibonacci, which will be added to the chartSeries and will consist of 5 horizontal lines. The data I am…
user3017291
  • 73
  • 1
  • 3
7
votes
1 answer

R: Backtesting a trading strategy. Beginners to quantmod and R

I'm very new to R and trying to backtest a strategy I've programmed already in WealthLab. Several stuff I don't understand (and it doesn't work obviously:) I don't get the Close Prices nicely into a vector...or some kind of vector but it starts…
MichiZH
  • 5,587
  • 12
  • 41
  • 81
7
votes
3 answers

Convert daily to weekly/monthly data with R

I have daily prices series over a wide range of products; I want to convert to a new dataframe with weekly or monthly data. I first used xts in order to apply the to.weekly function...which works only for OHLC format. I am sure there may exist a…
saradi
  • 141
  • 1
  • 1
  • 7
7
votes
4 answers

Removing NA columns in xts

I have an xts in the following format a b c d e f ...... 2011-01-03 11.40 NA 23.12 0.23 123.11 NA ...... 2011-01-04 11.49 NA 23.15 1.11 111.11 NA …
lab_notes
  • 407
  • 5
  • 11
7
votes
1 answer

Load multiple symbols using csv with quantmod

I am trying to load multiple symbols using a csv file rather than downloading from Yahoo. The original code works great and uses load.packages('quantmod') tickers = spl('TLT,IWM,GLD') data <- new.env() getSymbols(tickers, src = 'yahoo', from =…
AdmiralF
  • 113
  • 2
  • 8
6
votes
0 answers

Adding vertical lines to chart_Series and add_TA plots

After kind answer from Joshua on my previous post about this "issue" ( Issue with quantmod add_TA and chart_Series - lines and text disappear after next add_TA is called ) I have added some "extensions" to quantmod that enable drawing lines/segments…
Samo
  • 2,065
  • 20
  • 41
6
votes
2 answers

quantmod barChart (or chartSeries) formatting options

I have just started playing with the quantmod package. The documentation is however, quite sparse (perhaps understandably, since it is OSS). I am currently using barChart() which is a nice wrapper around chartSeries() and does most of what I want,…
Homunculus Reticulli
  • 65,167
  • 81
  • 216
  • 341
6
votes
1 answer

Issue with quantmod add_TA and chart_Series - lines and text disappear after next add_TA is called

I am using new chart_Series and add_TA quite a lot. It works very well for me and I find it very useful. I am trying to add a few things (horizontal lines and some text) on a graph. Here problems start to occur. After horizontal lines and text are…
Samo
  • 2,065
  • 20
  • 41
6
votes
1 answer

Adding Points, Legends and Text to plots using xts objects

I am starting on a bit of analysis on pairs of stocks (pairs trading) and here is the function I wrote for producing a graph (pairs.report - listed below). I need to plot three different lines in a single plot. The function I have listed does what I…
Soumendra
  • 1,174
  • 1
  • 15
  • 28
6
votes
1 answer

Improving a function to get stock news data from google in R

I've written a function to grab and parse news data from Google for a given stock symbol, but I'm sure there are ways it could be improved. For starters, my function returns an object in the GMT timezone, rather than the user's current timezone,…
Zach
  • 29,791
  • 35
  • 142
  • 201
6
votes
1 answer

How to show gaps in R/quantmod's chartSeries/candleChart plots

I am trying to show "gaps" in financial data using the plotting functions in the excellent quantmod package for R. Normally R allows you to show gaps in plots using NA values, as with: x<-1:10 y<-2*x y[4:7]<-NA plot(x,y,type="l") I would like to do…
fttb
  • 61
  • 2
6
votes
4 answers

Quantmod Error 'cannot open URL'

I started to experience an error today with the quantmod package. Anybody else have the same error when running this code (or requesting symbols in general)? library(quantmod) getSymbols("CPIAUCNS",src="FRED") Error: Error in…
Wolf
  • 562
  • 1
  • 7
  • 19
6
votes
1 answer

How to handle hyphens in yahoo finance tickers in Quantmod

When executing the following commands the hyphen in the ticker HM-B.ST is interpreted as a minus sign. I have tried to rename the xts object to something else but have not succeeded. Does anybody know a solution for…
johansson.lc
  • 322
  • 2
  • 12
6
votes
1 answer

How to get the list of all Yahoo Finance mutual funds in R?

I want to get the list of all the mutual funds that are available through Yahoo Finance into R. There is a stockSymbols function in the TTR package, but it does not seem to get the mutual funds. Thanks,
6
votes
1 answer

R quantmod: How to have two separate Y-scales?

I want to plot a trading strategy against a currency pair. Of course the trading strategy has large values (>10'000, since 10'000 is the initial capital) and the currency pair hovers around 1.5. So I want to overlay the strategy over the same chart…
MichiZH
  • 5,587
  • 12
  • 41
  • 81
1 2
3
78 79