Page 1 of 1

Cumulative loss function

Posted: Mon Feb 26, 2024 12:03 am
by 27npg
Sorry for cross posting here. I am hoping someone could help with this. I am looking to compute the cumulative maximum loss (CMAX) that
corresponds to the maximum loss compared to the highest level of a stock index over a two year period, using monthly data. I am having trouble doing this as I am unsure how to loop over the rolling two year window. Does anyone have any idea how to do this?

Thanks!