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

class FormalBlackAnguilline(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2022, 11, 1)
        self.SetCash(100000)  # Set Strategy Cash

        spy = self.AddEquity("SPY", Resolution.Minute)
        self.symbol = spy.Symbol

        contracts = [
            Symbol.CreateOption(self.symbol, Market.USA, OptionStyle.American, OptionRight.Call, 395, datetime(2022, 11, 30)),
            Symbol.CreateOption(self.symbol, Market.USA, OptionStyle.American, OptionRight.Put, 395, datetime(2022, 11, 30))
        ]
        for contract in contracts:
            option = self.AddOptionContract(contract, Resolution.Minute)

    def OnData(self, data: Slice):
        if self.IsWarmingUp: return

        equity = self.Securities[self.symbol]
        for canonical_symbol, chain in data.OptionChains.items():
            for contract in chain:
                symbol = contract.Symbol
                right = "Put" if symbol.ID.OptionRight == 1 else "Call"
                greeks = contract.Greeks

                self.Log(f'''{self.Time}::{contract.Symbol}::{right}
                IV: {contract.ImpliedVolatility},
                Delta: {greeks.Delta},
                Gamma: {greeks.Gamma},
                Vega: {greeks.Vega},
                Rho: {greeks.Rho},
                ThetaPerDay: {greeks.ThetaPerDay},
                LastPrice: {contract.LastPrice},
                Close: {self.Securities[contract.Symbol].Close},
                underlyingPrice: {equity.Close}''')