Hello,

assigning labels via add.indicator function (in quantstrat) does not work
for TTR function "momentum" or "ROC" and generally other functions having
output with non-null column names. Labelling works properly only for
indicator functions that have empty column names, e.g. RSI, SMA used in
demos.
getSymbols('AAPL')
head(RSI(Cl(AAPL)))
head(SMA(Cl(AAPL)))
head(momentum(Cl(AAPL)))
head(ROC(Cl(AAPL)))

For example, I have line, in which assignment label="momentum" will be
totally ignored later by applyIndicators:

mystrat <- add.indicator(strategy = mystrat, name = "momentum", arguments =
list(x=quote(Cl(mktdata))), label = "mom" )

This piece of code in applyIndicators causes the behavior:
if (is.null(names(tmp_val)) & ncol(tmp_val) == 1)
   names(tmp_val) <- indicator$label

My suggestion is to replace it with more intuitive behavior:
if (!is.null(indicator$label) & ncol(tmp_val) == 1)
   names(tmp_val) <- indicator$label

Thank you.

Daniel Krizian

	[[alternative HTML version deleted]]

