| Overall Statistics |
|
Total Trades 0 Average Win 0% Average Loss 0% Compounding Annual Return 0% Drawdown 0% Expectancy 0 Net Profit 0% Sharpe Ratio 0 Sortino Ratio 0 Probabilistic Sharpe Ratio 0% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0 Beta 0 Annual Standard Deviation 0 Annual Variance 0 Information Ratio 0 Tracking Error 0 Treynor Ratio 0 Total Fees $0.00 Estimated Strategy Capacity $0 Lowest Capacity Asset Portfolio Turnover 0% |
# region imports
from AlgorithmImports import *
# endregion
class LogicalFluorescentOrangeWhale(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2023, 6, 1)
self.SetEndDate(2023, 6, 1)
self.SetCash(100000)
index_symbol = self.AddIndex("SPX").Symbol
option = self.AddIndexOption(index_symbol, "SPXW")
option.SetFilter(lambda universe: universe.IncludeWeeklys().Strikes(-2, 2).Expiration(0, 30))
#option.SetFilter(-2, 2, 0, 30)
self.symbol = option.Symbol
self.log_count=0
def OnData(self, data: Slice):
weekly_chain = data.OptionChains.get(self.symbol)
if weekly_chain:
for contract in weekly_chain:
if self.log_count >100:
return
self.Log(f"{contract.Symbol} price at {data.Time}: {contract.LastPrice} Expiry: {contract.Expiry.date()}")
self.log_count+=1