Overall Statistics |
Total Trades 49 Average Win 0.90% Average Loss -0.52% Compounding Annual Return 2.972% Drawdown 4.400% Expectancy 1.053 Net Profit 12.420% Sharpe Ratio 0.443 Probabilistic Sharpe Ratio 10.374% Loss Rate 25% Win Rate 75% Profit-Loss Ratio 1.74 Alpha 0.024 Beta 0.019 Annual Standard Deviation 0.059 Annual Variance 0.003 Information Ratio -0.63 Tracking Error 0.123 Treynor Ratio 1.394 Total Fees $0.00 Estimated Strategy Capacity $0 Lowest Capacity Asset VIX.CBOE 2S |
from AlgorithmImports import * from QuantConnect.Data.Custom.CBOE import * class CustomDataIndicatorExtensionsAlgorithm(QCAlgorithm): # Initialize the data and resolution you require for your strategy def Initialize(self): self.SetStartDate(2014,1,1) self.SetEndDate(2018,1,1) self.SetCash(25000) self.vix = 'VIX' self.vxv = 'CBOE/VXV' # Define the symbol and "type" of our generic data self.AddData(CBOE, self.vix, Resolution.Daily) self.AddData(Quandl, self.vxv, Resolution.Daily) # Set up default Indicators, these are just 'identities' of the closing price self.vix_sma = self.SMA(self.vix, 1, Resolution.Daily) self.vxv_sma = self.SMA(self.vxv, 1, Resolution.Daily) # This will create a new indicator whose value is smaVXV / smaVIX self.ratio = IndicatorExtensions.Over(self.vxv_sma, self.vix_sma) # Plot indicators each time they update using the PlotIndicator function self.PlotIndicator("Ratio", self.ratio) self.PlotIndicator("Data", self.vix_sma, self.vxv_sma) # OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here. def OnData(self, data): # Wait for all indicators to fully initialize if not (self.vix_sma.IsReady and self.vxv_sma.IsReady and self.ratio.IsReady): return if not self.Portfolio.Invested and self.ratio.Current.Value > 1: self.MarketOrder(self.vix, 100) elif self.ratio.Current.Value < 1: self.Liquidate()