strength_SMA: Creates a ranking by strength of simple moving average...

Description Usage Arguments Value See Also Examples

View source: R/strength_SMA.R

Description

Creates a ranking by strength of simple moving average deviation over time. Uses the TTR::ROC function for rate-of-change value. Uses the TTR:SMA function for moving average of the value. Applies the TTR::runSD running standard deviations. Computes strength as strength <- (x - sma) / rd. Uses the discrete ROC type.

Usage

1
strength_SMA(x, roc_n = 1, sigma_n = 5, sma_n = 10)

Arguments

x

price history as XTS, more than one column of asset prices.

roc_n

ROC lookback period in same periodicity as x; default 1.

sigma_n

running standard deviation period lookback; default 5.

sma_n

simple moving average period lookback; default 10

Value

a row rank as determined by row_rank

See Also

row_rank, TTR::ROC, TTR::runSD

Examples

1
2
3
4
5
6
7
8
## Not run: 
library(quantmod)
getSymbols("XLP",auto.assign=TRUE)
getSymbols("XLV",auto.assign=TRUE)
ranking <- strength_SMA(cbind(Cl(XLP),Cl(XLV)))
tail(ranking)

## End(Not run)

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