Overall Statistics |
Total Orders 4 Average Win 0% Average Loss 0% Compounding Annual Return -14.362% Drawdown 1.000% Expectancy 0 Start Equity 100000 End Equity 99126 Net Profit -0.874% Sharpe Ratio -3.64 Sortino Ratio -2.573 Probabilistic Sharpe Ratio 2.369% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.115 Beta 0.058 Annual Standard Deviation 0.033 Annual Variance 0.001 Information Ratio -0.726 Tracking Error 0.063 Treynor Ratio -2.044 Total Fees $4.00 Estimated Strategy Capacity $2800000.00 Lowest Capacity Asset GOOCV 30JDODOEFOQTI|GOOCV VP83T1ZUHROL Portfolio Turnover 0.40% |
# region imports from AlgorithmImports import * # endregion class JellyRollOptionStrategy(QCAlgorithm): def initialize(self): self.set_start_date(2017, 4, 1) self.set_end_date(2017, 4, 23) self.set_cash(100000) option = self.add_option("GOOG", Resolution.MINUTE) self._symbol = option.symbol # set our strike/expiry filter for this option chain option.set_filter(lambda x: x.include_weeklys().strikes(-5, 5).expiration(30, 60)) def on_data(self, slice): if self.portfolio.invested: return # Get the OptionChain chain = slice.option_chains.get(self._symbol, None) if not chain: return # Select an expiry date and ITM & OTM strike prices strike = sorted([x.strike for x in chain], key=lambda x: abs(x - chain.underlying.price))[0] contracts = [x for x in chain if x.strike == strike] far_expiry = max([x.expiry for x in contracts]) near_expiry = min([x.expiry for x in contracts]) jelly_roll = OptionStrategies.jelly_roll(self._symbol, strike, near_expiry, far_expiry) self.buy(jelly_roll, 1)