Skip to contents

The rolling_max() 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_max(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_max(x = BTC[[1]])

## display the results
utils::tail(output)
#> [1] 106136.9 106136.9 100146.7  99356.0  99356.0  99356.0