Skip to contents

The function calculates the lookback period for a given indicator. Its primarily meant as a helper function for downstream packages that wants to use a customized control-flow.

Usage

lookback(FUN, ...)

Arguments

FUN

A call or function.

...

Additional parameters passed into the indicator function. See examples for more details.

Value

The minimum lookback required to calculate the indicator. If the indicator specification and input data are invalid the function returns NA, otherwise it returns an integer of length 1.

Author

Serkan Korkmaz

Examples

## calculate the lookback
## for the bollinger bands
talib::lookback(
  talib::bollinger_bands,
 x = talib::BTC
)
#> [1] 4