weight_ave_3ROC: Provides a ranking of weighted-average rate of change (ROC)...

Description Usage Arguments Value Examples

View source: R/weight_ave_3ROC.R

Description

Provides a ranking of weighted-average rate of change (ROC) of a given price history time series over three periods, using only ROC values that are positive for each period. Returns all ROC and weighted average results, regardless of sign.

Usage

1
weight_ave_3ROC(x, n = c(1, 3, 6), weights = c(1/3, 1/3, 1/3))

Arguments

x

price history as XTS

n

an array of ROC lookback periods, in same perodicity as x; must include exactly three elements; default 1, 3, 6.

weights

an array of weights for each ROC, must be length 3 and sum to 1. default is 1/3 for each entry.

Value

ranking as determined by row_rank

Examples

1
2
3
4
5
6
7
## Not run: 
library(quantmod)
getSymbols("XLK",auto.assign=TRUE)
wa <- weight_ave_3ROC(XLK,n=c(2,4,6),weights=c(.5,.3,.2))
tail(wa)

## End(Not run)

greatgray/scorecard documentation built on May 17, 2019, 8:34 a.m.