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

Getting stock news data from google in R

I can use quantmod to get historical data and close-to-realtime quotes for stocks. I can also use quantmod to get financials data from Google. Are there any existing R packages that would let me grab Google's news feed for a given stock? If not, is…
Zach
  • 29,791
  • 35
  • 142
  • 201
3
votes
1 answer

Handling the "Error in x[, 1] : incorrect number of dimensions"

I've downloaded stocks data with the getSymbols function and one of the downloads failed. So I managed to get around that as you can see in the my_symbols_df list but I encountered another problem ahead. Basically when I'm using the loop, it stops…
Artur Dutra
  • 515
  • 3
  • 18
3
votes
0 answers

ModuleNotFoundError: No module named 'quantmod.theming'

Trying to install quantmod in Python 3.6 and getting this error: ModuleNotFoundError: No module named 'quantmod.theming' Here are the imports: import pandas as pd pd.core.common.is_list_like = pd.api.types.is_list_like import numpy as np import…
funk101
  • 163
  • 4
  • 13
3
votes
1 answer

Trying to create a rolling period cummax

I am trying to create a function that buys an N period high. So if I have a vector: x = c(1, 2, 3, 4, 5, 1, 2, 3, 4, 5) I want to take the rolling 3 period high. This is how I would like the function to look x = c(1, 2, 3, 4, 5, 5, 5, 3, 4,…
Jordan Wrong
  • 1,205
  • 1
  • 12
  • 32
3
votes
1 answer

quantmod::chart_Series() how to simplify x-axis labels?

What is the proper way to remove the bottom portion of the x-axis labels for chart_Series()? eg. I would like to remove "Jan 03 2007 ... Oct 19 2018", but leave the years above the x-axis. github link:…
AG1
  • 6,648
  • 8
  • 40
  • 57
3
votes
3 answers

How do I store data from getSymbols (quantmod library) to a list?

Here's the code I'm running library(quantmod) library(tseries) Stocks={} companies=c("IOC.BO","BPCL.BO","ONGC.BO","HINDPETRO.BO","GAIL.BO") for(i in companies){ Stocks[i]=getSymbols(i) } I'm trying to get a list of dataframes that are obtained…
Nikhil Gopal
  • 107
  • 3
  • 6
  • 11
3
votes
1 answer

How to use R packages MACD functions?

I am learning to use R. I have an interest in pulling stock data and calculating various technical indicators on the stock data. My test benchmark is Google Finance. That is, I check my results with GF's results. While trying to implement some sort…
3
votes
0 answers

Imputing Multiple Leading and Lagging Time Series

Looking to do imputation for missing cointegrated time series -- in this hypothetical case, imputing the time series for FB on the trailing and leading sides. Tried using the forecast package along with imputeTS package, but it only imputes a…
3
votes
1 answer

R: Get quantmod's chartSeries and AddTA to not show last value

When using chartSeries, by default it also shows on the top left of the plot the last value. Is there any way to prevent it from doing it? When adding a new TA with addTA, you can avoid the last value on the plot by setting the argument legend = "",…
3
votes
1 answer

Quantstrat: Backtesting custom 'bollinger band' like strategy

I'm new with quantstrat and I would like to use then to simulate my strategy that essentially is a Bollinger Band. My code isn't working to close the open position when the Premium crosses the Avg. The algo logic that defines the strategy…
Jose Filho
  • 61
  • 3
3
votes
1 answer

Calculating Credit Impulse in R growth of growth

Part Finance Part R question I have been trying to replicate the below formula in R using the Quantmod package and xts also using the diff function. The code gives me a plot for credit impulse but it doesn't seem to be replicating what I am trying…
mannym
  • 325
  • 1
  • 16
3
votes
0 answers

quantmod::getFX function returns "character in a standard unambiguous format"

I have been using quantmod::getFX on an almost daily basis recently, and for some reason today it makes my shiny app crashes. I updated R, all my packages, tried the function on two different computers, but still get the same error. To replicate the…
Charles
  • 150
  • 1
  • 1
  • 10
3
votes
2 answers

Quandl, Quantmod, or TrueFX hourly data

I have been trying to find some source code in R using either Quantmod, TrueFX or Quandl for downloading historical Hourly and H4 currency data. Unfortunately almost every provider only has daily data. TrueFX provides historical tick-data in CSV…
H701
  • 51
  • 3
3
votes
1 answer

R quantmod buildModel() does not fit model

I can't ride of an error when fitting model with quantmod, buildModel seems to not work and so use of tradeModel rise error : getSymbols('GS',src='yahoo') q.model = specifyModel(Next(OpCl(GS)) ~ Lag(OpHi(GS),0:3)) buildModel(q.model,…
Qbik
  • 5,885
  • 14
  • 62
  • 93
3
votes
1 answer

Exact time stamp on quantmod currency (FX) data

we may collect daily data from Oanda and Yahoo finance with the quantmod package as such: getFX("USD/JPY",from="2007-01-01", to = Sys.Date()) getSymbols("EUR=X",src="yahoo",from="2002-01-01",auto.assign=F) After checking data carefully, you may…
Cyril DL
  • 43
  • 7