Overall Statistics |
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return -22.158% Drawdown 0.900% Expectancy 0 Net Profit -0.500% Sharpe Ratio -6 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0.45 Beta -45.677 Annual Standard Deviation 0.03 Annual Variance 0.001 Information Ratio -6.378 Tracking Error 0.03 Treynor Ratio 0.004 Total Fees $0.25 |
from QuantConnect.Securities.Option import OptionPriceModels from datetime import timedelta class OptionsAlgorithm(QCAlgorithm): def Initialize(self): self.SetStartDate(2017, 7, 1) self.SetEndDate(2017, 7, 3) self.SetCash(100000) option = self.AddOption("GOOG") option.SetFilter(-10, +10, timedelta(0), timedelta(30)) option.PriceModel = OptionPriceModels.CrankNicolsonFD() self.SetWarmUp(TimeSpan.FromDays(7)) def OnData(self,slice): if self.Portfolio.Invested: return for kvp in slice.OptionChains: chain = kvp.Value contracts = [i for i in chain] if len(contracts) == 0: continue self.Log("Delta: " + str([i.Greeks.Delta for i in contracts])) self.Log("Vega: " + str([i.Greeks.Vega for i in contracts])) self.Log("Gamma: " + str([i.Greeks.Gamma for i in contracts])) self.MarketOrder(contracts[0].Symbol, 1)