Skip to content
Prev 14035 / 15274 Next

Error:subscript out of bounds: no column name containing "Close

On 10/08/2016 10:55 PM, Ramesh wrote:
Please follow the posting guide:

https://www.r-project.org/posting-guide.html

You haven't provided a minimal reproducible example, or nearly enough 
data to answer your question with certainty.


For the purposes of my guestimate, we'll assume your variable is called 'x'

I suspect that your 'OHLC' data doesn't contain any columns that 
quantmod's OHLC utility functions can recognize as close data.

Check the column names of your data.

Try using quantmod functions such as Cl(x) or is.OHLC(x) to see if 
quantmod recognizes your column names. (They are looking for variations 
of English words such as 'open, 'high', 'low', and 'close', 
capitalization unimportant)

The TTR functions MACD and RSI expect univariate data, not OHLC data, as 
is noted in the documentation.  You could try something like:

RSI(getPrice(x))
MACD(getPrice(x))

and the quantmod function 'getPrice' will try to guess at a column that 
may contain price data.  This may suffer from the same problem as above.

In short, your problem is almost certainly that the column names of your 
imported data are unintelligible:  Check this first.

If you're still having trouble, please follow the posting guide and 
provide a minimal reproducible example.