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.
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.
Examples
## calculate the lookback
## for the bollinger bands
talib::lookback(
talib::bollinger_bands,
x = talib::BTC
)
#> [1] 4
