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
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
-11.094
Tracking Error
0.215
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
Portfolio Turnover
0%
# region imports
from AlgorithmImports import *
# endregion

class SmoothBlackKangaroo(QCAlgorithm):

    def Initialize(self) -> None:
        self.SetStartDate(2023, 1, 31)
        self.SetEndDate(2023, 2, 3)
        self.SetCash(1000000)

        self.symbol = self.AddEquity("SQQQ", Resolution.Minute, dataNormalizationMode=DataNormalizationMode.Raw)
        self.symbol.VolatilityModel = StandardDeviationOfReturnsVolatilityModel(30)

        self.option = self.AddOption(self.symbol.Symbol)
        self.option.SetFilter(lambda filter: filter.Strikes(30, 50)
                      .Expiration(0, 7)
                      .IncludeWeeklys()
                      .PutsOnly()
                      .OnlyApplyFilterAtMarketOpen())

    def OnData(self, data):
        if datetime(2023, 2, 1, 15, 10, 0) <= self.Time <= datetime(2023, 2, 1, 15, 20, 0):
            chain = data.OptionChains.get(self.option.Symbol)
            if not chain: return

            for contract in chain:
                self.Log(f"{contract.Symbol.Value} :: BidPrice: {contract.BidPrice} :: AskPrice: {contract.AskPrice} :: delta: {contract.Greeks.Delta}")