I wanted to do a little analysis on the drawdown and recovery period on the S&P500 I would like to do this over even more data than the past 65yrs. Lets first take a visual cue on how this market has performed and then follow it with a table for some added statistics. If I could highlight one point which already knew but it is worth mentioning. The recovery usually takes 2 to 3 times the length it takes to form a trough. I love / hate trading that asymmetry. So much worry, pain and discomfort, and then very quickly it is “I love this job”.
The R code I wrote is really very simple and I thought I would add it for completeness.
library(quantmod) library(PerformanceAnalytics) library(gridExtra) getSymbols("^GSPC", from= "1900-01-01") # it only goes back to 1950 spret<- ROC(GSPC[,6], type = "discrete", n = 1) # want to create a % return of the adjusted close t<-table.Drawdowns(spret) charts.PerformanceSummary(spret) grid.newpage(recording = FALSE) grid.table(t) # I like the look of this table to the standard R print.