Overall Statistics
Total Trades
3732
Average Win
1.98%
Average Loss
-2.19%
Compounding Annual Return
37.836%
Drawdown
59.000%
Expectancy
0.082
Net Profit
1011.165%
Sharpe Ratio
0.947
Probabilistic Sharpe Ratio
24.509%
Loss Rate
43%
Win Rate
57%
Profit-Loss Ratio
0.90
Alpha
0.435
Beta
0.226
Annual Standard Deviation
0.49
Annual Variance
0.24
Information Ratio
0.663
Tracking Error
0.503
Treynor Ratio
2.051
Total Fees
$124489.18
Estimated Strategy Capacity
$14000000.00
Lowest Capacity Asset
TQQQ UK280CGTCB51
class VirtualRedDogfish(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2014, 1, 9)
        self.SetCash(100000) 
        
        self.AddEquity("TQQQ", Resolution.Daily)
        self.AddEquity("TMF", Resolution.Daily)
        self.AddEquity("UVXY", Resolution.Daily)
        
       
        self.vix = 'CBOE/VIX'
        self.vxv = 'CBOE/VXV'
        
        self.AddData(QuandlVix, self.vix, Resolution.Daily)
        self.AddData(Quandl, self.vxv, 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)
        
        
        
    def OnData(self, data):
        if not (self.vix_sma.IsReady and self.vxv_sma.IsReady and self.ratio.IsReady): 
            return
        if self.ratio.Current.Value < .923:
            self.SetHoldings("UVXY", .6)
            self.Liquidate("TMF")
            self.Liquidate("TQQQ")
            self.SetHoldings("TQQQ", 0)
            self.SetHoldings("TMF", 0)
            
        else:
            self.Liquidate("TQQQ")
            self.Liquidate("TMF")
            self.SetHoldings("TQQQ", .8)
            self.SetHoldings("UVXY", 0)
            self.SetHoldings("TMF", 0)
            


    
     
     
class QuandlVix(PythonQuandl):
    
    def __init__(self):
        self.ValueColumnName = "Close"