Expected lengths of streaks
About 1,000 years ago I calculated the expected length of a losing
streak by iterative simulation using rle
trades <- sample(c("W", "L"), 1000, replace = TRUE, prob =
c("0.66", "0.33"))
trades.rle <- rle(trades)
tapply(trades.rle$lengths, trades.rle$values, max)
There must be other, better ways today...
jab
John Bollinger, CFA, CMT www.BollingerBands.com If you advance far enough, you arrive at the beginning.