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
3
votes
2 answers

How to highlight individual candles in a quantmod chart?

I could not find anything about how could I highlight individual candles in quantmod charts. Here is an example code: library(quantmod) getSymbols("AAPL", src="yahoo") chart_Series(AAPL, subset="2007-01") AAPL$show <- ifelse(as.Date(index(AAPL)) ==…
nesvarbu
  • 986
  • 2
  • 9
  • 24
3
votes
1 answer

Cron job in R shiny - shiny task schedule in shinyapps io

I am planing on getting stock data from yahoo finance at the end of each business day (using quantmod). this data is then used to update my shiny app. Now I have to do this manually, I update my csv file which I than upload to shinyapps.io each day.…
Sue Tizzi
  • 33
  • 3
3
votes
1 answer

Quantmod: extracting split dates from yahoo EOD price data

This is in relation to stock data obtained from Yahoo Finance. I'm looking for a method for determining dates when a stock was split (or bonus shares were issued, the distinction is immaterial to current task). I could not find any specific…
R.S.
  • 2,093
  • 14
  • 29
3
votes
2 answers

quantmod adjustOHLC function - dividend adjusted prices

I need help in explaining a discrepancy in dividend adjusted prices using quantmod::adjustOHLC. Get adjusted and unadjusted prices for AAPL: library(quantmod) getSymbols("AAPL") AAPL.adjusted <- adjustOHLC(AAPL, adjust=c("dividend"),…
user3477071
  • 194
  • 1
  • 13
3
votes
1 answer

duplicated entries in indices error in optimize.portfolio in PortfolioAnalytics package

When I try to run the optimize.portfolio function using ROI I get the error. Error in ROI::V_bound(li = seq.int(1L, N), lb = as.numeric(lb), ui = seq.int(1L, : duplicated entries in indices. And when I use DEoptim I get. Error in…
House
  • 195
  • 1
  • 1
  • 5
3
votes
1 answer

R Differencing a matrix of stock prices: Delt and apply

I have a data frame where each column is the price history of a stock. I want to create from it a matrix of percentage change in those prices so I am trying to use the Delt function from quantmod. When I try to apply the Delt function using the…
user3390169
  • 1,015
  • 1
  • 11
  • 34
3
votes
1 answer

Calculating monthly returns in long format

I have daily closing prices data set in long format and I want to calculate monthly returns(arithmetic). It is calculated as (m1-m0)/m0 Where m1 and m0 are prices on the last days of current and last month respectively.This is a sample of two…
Polar Bear
  • 731
  • 1
  • 7
  • 21
3
votes
1 answer

How do I convert 15-minute data to time series in datetime format so I can plot it using quantmod?

So I got this data that I want to convert into xts so I can plot it using quantmod. (It is 15m chart) > sample Date Open High Low Close Vol.at.Price Volume 515 2016-06-15 pm 1:15:00 1.7381 1.7600 1.710 1.7399 1.7399…
이종연
  • 129
  • 1
  • 9
3
votes
1 answer

R - How can I change date format when I plot an xts & zoo object?

I am wondering how I can change date format. The code I am working on is following: library(quantmod) getSymbols("AAPL") price_AAPL <- AAPL[,6] plot(price_AAPL, main = "The price of AAPL") This results I want to alter date format from "%m %d…
Louis
  • 43
  • 1
  • 5
3
votes
1 answer

llply fails in Parallel - R

I am having trouble trying to run llply in parallel... getOC function I am trying to run (it is a modified version of quantmod::getOptionChain): `getOC` <- function(Symbols, Exp=NULL, src="yahoo", ...) { Call <-…
Rime
  • 912
  • 2
  • 11
  • 39
3
votes
1 answer

Add Technical Indicator to chart.Posn

For some reason I cannot add a ROC signal to a blotter chart. In the documentation it should be allowed. I want to create a new chart bellow with this indicator. Can someone help? # plot performance for symbol chart.Posn(strategy_AbsMom, Symbol =…
husvar
  • 373
  • 1
  • 3
  • 13
3
votes
2 answers

Combine multiple xts objects created by getSymbols

I'm attempting to carry out some stock portfolio simulations. Using the Package 'quantmod' I have downloaded price data on multiple securities. I would like to accomplish two things. 1) I'd like to create a list/array of the xts objects, where each…
Fanderson
  • 90
  • 9
3
votes
1 answer

How to dynamically add indicators to quantmod chart

I'd like to dynamically add indicators to a quantmod chart. I can successully add 1 indicator but how can I add multiple that are stored in a character vector? #### THIS WORKS VariableTA = "addBBands()" df<-data.frame (Open = seq(2,102,1), High =…
user3022875
  • 8,598
  • 26
  • 103
  • 167
3
votes
0 answers

R, quantmod, custom source

I have financial data stream from redis and/or rabbitmq. And would like to chart it with quantmod. I found in documentation that getSymbols has some predefined sources (yahoo, csv and others), but need none of them. So questions: How load data from…
user3003873
  • 543
  • 1
  • 4
  • 21
3
votes
1 answer

Plotting multiple symbols with a reactive statement with chartSeries

I am new to Shiny and finished the Shiny tutorial over here: http://shiny.rstudio.com/tutorial/ In lesson 6, the tutorial shows us how to create an App where you input the stock symbol and date range to see its chart on the main panel. I am trying…
Dronny
  • 109
  • 1
  • 1
  • 6