Overall Statistics
Total Trades
5
Average Win
0%
Average Loss
0%
Compounding Annual Return
0.391%
Drawdown
0.100%
Expectancy
0
Net Profit
0.162%
Sharpe Ratio
1.309
Probabilistic Sharpe Ratio
59.542%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.001
Beta
0.014
Annual Standard Deviation
0.002
Annual Variance
0
Information Ratio
-2.394
Tracking Error
0.098
Treynor Ratio
0.183
Total Fees
$5.00
Estimated Strategy Capacity
$3300000000.00
Lowest Capacity Asset
BND TRO5ZARLX6JP
# region imports
from AlgorithmImports import *
# endregion

class AdaptableBlackCaterpillar(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2021, 3, 1)  # Set Start Date
        self.SetEndDate(2021, 8, 1)
        self.SetCash(100000)  # Set Strategy Cash
        self.AddEquity("SPY", Resolution.Minute)
        self.AddEquity("BND", Resolution.Minute)
        self.AddEquity("AAPL", Resolution.Minute)
        self.AddEquity("TSLA", Resolution.Minute)
        self.AddEquity("MSFT", Resolution.Minute)
        self.AddEquity("META", Resolution.Minute)

       
        
       
       
         # For other security types, use QuoteBar

        # Creates an indicator and adds to a rolling window when it is updated
        
        
        
    def OnData(self, data: Slice):

        #invested = [r.Key for r in self.Portfolio if r.Value.Invested]
        


        
            
        
        for x in self.Portfolio.Keys:
            invested = [r.Key for r in self.Portfolio if r.Value.Invested]
    
            if len(invested) < 5:
                self.Debug(invested)
                self.Debug(len(invested))
                self.Buy(x, 1)