Skip to content

Instantly share code, notes, and snippets.

@sinner- sinner-/gist:8727386
Created Jan 31, 2014

Embed
What would you like to do?
require(quantmod)
require(PerformanceAnalytics)
getSymbols('^GSPC',from='1970-01-01')
vol = 100 * sqrt(262) * runSD(dailyReturn(Ad(GSPC),type='log'),60)
backtest = dailyReturn(Ad(GSPC),type='log')
backtest[ lag(vol,1) > 15] = 0
charts.PerformanceSummary(backtest)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.