Overall Statistics |
Total Trades 6158 Average Win 0.37% Average Loss -1.06% Compounding Annual Return 51.105% Drawdown 45.600% Expectancy 0.167 Net Profit 11559.143% Sharpe Ratio 1.263 Probabilistic Sharpe Ratio 51.966% Loss Rate 14% Win Rate 86% Profit-Loss Ratio 0.35 Alpha 0.422 Beta 0.835 Annual Standard Deviation 0.423 Annual Variance 0.179 Information Ratio 0.993 Tracking Error 0.403 Treynor Ratio 0.64 Total Fees $89216.56 Estimated Strategy Capacity $12000000.00 Lowest Capacity Asset TQQQ UK280CGTCB51 |
# Trading based on CBOE vix-vxv ratio from QuantConnect.Data.Custom.CBOE import * class VirtualRedDogfish(QCAlgorithm): def Initialize(self): self.SetStartDate(2010, 1, 1) self.SetCash(100000) self.AddEquity("TQQQ", Resolution.Minute).Symbol self.AddEquity("TMF", Resolution.Minute).Symbol self.AddEquity("UVXY", Resolution.Minute).Symbol self.AddEquity("SPY", Resolution.Minute).Symbol self.vix = 'CBOE/VIX' self.vxv = 'CBOE/VXV' self.AddData(QuandlVix, self.vix, Resolution.Daily) self.AddData(Quandl, self.vxv, Resolution.Daily) self.SetWarmUp(100, Resolution.Daily) self.vix_sma = self.SMA(self.vix, 1, Resolution.Daily) self.vxv_sma = self.SMA(self.vxv, 1, Resolution.Daily) self.ratio = IndicatorExtensions.Over(self.vxv_sma, self.vix_sma) self.spySMA = self.SMA("SPY", 100, Resolution.Daily) self.Schedule.On(self.DateRules.EveryDay("SPY"), self.TimeRules.AfterMarketOpen("SPY", 1), self.Trade) def Trade(self): if not (self.vix_sma.IsReady or self.vxv_sma.IsReady or self.ratio.IsReady): return if self.spySMA is None or not self.spySMA.IsReady: return if self.spySMA.Current.Value < self.Securities["SPY"].Price: if self.ratio.Current.Value < .923: self.SetHoldings("UVXY", .6) self.SetHoldings("TMF", 0) self.SetHoldings("TQQQ", 0) self.SetHoldings("SPY", .4) else: self.SetHoldings("UVXY", 0) self.SetHoldings("TMF", 0) self.SetHoldings("TQQQ", .8) self.SetHoldings("SPY", .2) else: if self.ratio.Current.Value < .923: self.SetHoldings("UVXY", .6) self.SetHoldings("TMF", .4) self.SetHoldings("TQQQ", 0) self.SetHoldings("SPY", 0) else: self.SetHoldings("UVXY", 0) self.SetHoldings("TMF", .2) self.SetHoldings("TQQQ", .4) self.SetHoldings("SPY", .4) class QuandlVix(PythonQuandl): def __init__(self): self.ValueColumnName = "Close"