Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Net Profit
0%
Sharpe 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
$1.00
Estimated Strategy Capacity
$390000.00
Lowest Capacity Asset
QQQ XL7X5ITEF0TI|QQQ RIWIV7K5Z9LX
class EmotionalYellowGreenOwlet(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 11, 23)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        
        self.SetStartDate(2021,1,1)    #Set Start Date
        self.SetEndDate(2021,5,15)      #Set End Date
        self.SetCash(1000000)             #Set Strategy Cash
        
        self.equity_symbol = self.AddEquity("QQQ").Symbol
        option = self.AddOption("QQQ", Resolution.Minute) # Add the option corresponding to underlying stock
        self.option_symbol = option.Symbol
        option.SetFilter(-2, +2, timedelta(6), timedelta(13))


    def OnData(self, data):
        for symbol, chain in data.OptionChains.items():
            contracts = [c for c in chain if c.Right == OptionRight.Call and c.UnderlyingLastPrice > c.Strike]
            if len(contracts) == 0:
                continue
            sorted_contracts = sorted(contracts, key=lambda x: x.Strike, reverse=True)
            contract = sorted_contracts[0].Symbol
            self.MarketTicket = self.MarketOrder(contract, 1)
            
            self.Quit(f"Equity Symbol: {self.Portfolio[self.equity_symbol].Invested}; QQQ: {self.Portfolio['QQQ'].Invested}; Option symbol: {self.Portfolio[self.option_symbol].Invested}; Contract symbol: {self.Portfolio[contract].Invested}")