Skip to contents

The rolling_sum() is a generic S3 function that builds upon 'type-safe'-esque workflows limited to classes in in base R, and the package-wide dependencies. Ie. class in, class out.

Usage

rolling_sum(x, n = 10)

Arguments

x

(double). A vector.

n

(integer). An integer of length 1.

Value

A double vector with the same length of x

Author

Serkan Korkmaz

Examples

## load Bitcoin (BTC)
## series
data(BTC, package = "talib")

## calculate the indicator
## Open
output <- talib::rolling_sum(x = BTC[[1]])

## display the results
utils::tail(output)
#> [1] 992608.1 982182.7 970213.6 965190.9 961369.3 956225.7