I use the function to find the maximum in a sliding window of size 100, and in addition to finding the maximum, I would also like to get the time from the "open_time" column corresponding to the maximum value in the window. How to get this value correctly?
library(data.table)
library(zoo)
library(binancer)
data <- binance_klines(symbol = 'ETHUSDT', interval = '1h', limit = 1000)[,1:5]
data <- data.table(data, rollingMax = rollmax(x = data$high, k = 100, na.pad = T, align = 'right'))