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

Description Usage Arguments Value Examples

View source: R/weight_ave_3ROC_strict.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. If any of the three ROC values is zero or negative for a day, then return NA for the rank for that date.

Usage

1
weight_ave_3ROC_strict(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_strict(XLK,n=c(2,4,6),weights=c(.5,.3,.2))
tail(wa)

## End(Not run)

greatgray/scorecard documentation built on Feb. 14, 2018, 4:28 a.m.