x <- c(1:10, 9:7, 8:14, 13:8, 9:20)
maxdrawdown(x)
plot(x)
lines(x = c(20, 28), y = c(14, 14), col="grey")
lines(x = c(20, 28), y = c(8, 8), col="grey")
arrows(26, 14, 26, 8, , col="red", length = 0.16)
Run the code above in your browser using DataLab