Created
January 31, 2014 06:14
-
-
Save sinner-/8727386 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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