Overall Statistics |
Total Trades 9 Average Win 0% Average Loss -9.65% Compounding Annual Return -55.279% Drawdown 52.800% Expectancy -1 Net Profit -33.500% Sharpe Ratio -0.252 Probabilistic Sharpe Ratio 14.682% Loss Rate 100% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.233 Beta 0.062 Annual Standard Deviation 0.85 Annual Variance 0.723 Information Ratio -0.598 Tracking Error 0.864 Treynor Ratio -3.453 Total Fees $0.00 |
class ModulatedResistanceShield(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 5, 30) # Set Start Date self.SetCash(100000) # Set Strategy Cash self.AddFuture(Futures.Indices.VIX).SetFilter(timedelta(0), timedelta(90)) self.vx1 = self.AddData(QuandlFutures, "CHRIS/CBOE_VX1", Resolution.Daily).Symbol def OnData(self, data): if not data.ContainsKey(self.vx1): return for chain in data.FuturesChains.Values: chain = [c for c in chain.Contracts.Values] chain = sorted(chain, key=lambda c: c.Expiry) if len(chain) < 2: return vx1 = chain[0] vx1_symbol = vx1.Symbol # use this to buy/sell contracts vx2 = chain[1] vx2_symbol = vx2.Symbol self.Plot('VIX', 'VX1', vx1.LastPrice) self.Plot('VIX', 'VX2', vx2.LastPrice) if data[self.vx1].Value > 25: self.SetHoldings(self.vx1, 1) else: self.Liquidate(self.vx1) class QuandlFutures(PythonQuandl): def __init__(self): self.ValueColumnName = "Settle"