Here is one possible approach:
# Load package
library(data.table)
# Generate data
set.seed(1)
DT = data.table(x=rnorm(10))
DT[,cumsumX:=cumsum(x)]
# Define number of rows in data table and index variable
DT$index <- rownames(DT)
length.DT <- nrow(DT)
# Calculate maxdrawdown
DT[ ,maxdrawdown:=min(DT$cumsumX[index:length.DT]), by=index]
# Substitute the minimum value of the entire column to be NA
DT$maxdrawdown[DT$cumsumX==min(DT$cumsumX)] <- NA
The result would look like this:
> DT
x cumsumX index maxdrawdown
1: -0.6264538 -0.6264538 1 -1.2784391
2: 0.1836433 -0.4428105 2 -1.2784391
3: -0.8356286 -1.2784391 3 NA
4: 1.5952808 0.3168417 4 -0.1741189
5: 0.3295078 0.6463495 5 -0.1741189
6: -0.8204684 -0.1741189 6 -0.1741189
7: 0.4874291 0.3133101 7 0.3133101
8: 0.7383247 1.0516348 8 1.0516348
9: 0.5757814 1.6274162 9 1.3220278
10: -0.3053884 1.3220278 10 1.3220278