Overall Statistics
Total Trades
9
Average Win
0%
Average Loss
0%
Compounding Annual Return
-12.259%
Drawdown
6.500%
Expectancy
0
Net Profit
-1.199%
Sharpe Ratio
-0.442
Probabilistic Sharpe Ratio
33.244%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.182
Beta
1.676
Annual Standard Deviation
0.23
Annual Variance
0.053
Information Ratio
-1.353
Tracking Error
0.11
Treynor Ratio
-0.061
Total Fees
$9.00
Estimated Strategy Capacity
$14000000.00
Lowest Capacity Asset
VOO 31UH85M5FS5C6|VOO UPSZVZA9EQUD
from QuantConnect.Securities.Option import OptionPriceModels
from datetime import timedelta
import math

class Wheelinginthemoney(QCAlgorithm):

    def Initialize(self):
        
        self.SetStartDate(2021, 5, 1)
        self.SetEndDate(2021, 6,3)
        self.SetCash(100000)
        
        self.SetSecurityInitializer(self.security_initializer)
        tickers = ["VTI","VOO","IVV"]
        self.symbols = [self.AddEquity(ticker).Symbol
            for ticker in ["VTI","VOO","IVV"] ]
            
        
        

    def security_initializer(self, security):
        if security.Type == SecurityType.Equity:
            security.SetDataNormalizationMode(DataNormalizationMode.Raw)
        elif security.Type == SecurityType.Option:
            security.SetMarketPrice(self.GetLastKnownPrice(security))
        
                   
    def OnData(self, data):
        for symbol in self.symbols:
            if not (data.ContainsKey(symbol) and data[symbol] is not None):
               return
        
            if self.Portfolio[symbol].Invested:
                continue

            contracts = self.OptionChainProvider.GetOptionContractList(symbol, data.Time)
            if len(contracts) == 0:
                return
            contract = contracts[0]
            self.AddOptionContract(contract, Resolution.Minute)
            self.MarketOrder(contract, 1)