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
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
$0.00
class HorizontalResistanceAutosequencers(QCAlgorithm):

    def Initialize(self):
        #Set start/end dates and cash    
        self.SetStartDate(2018, 12, 18)
        self.SetEndDate(2019, 10, 19)
        self.SetCash(1000000)
        equity = self.AddEquity("JNJ", Resolution.Daily, leverage=1.0)
        self.syl = equity.Symbol
        
        #Set Brokerage Model
        self.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Cash)
        
        #Add Securities from symbols and set data normalization mode to raw
        self.Securities[self.syl].SetDataNormalizationMode(DataNormalizationMode.Raw)
        
        #set variables for setsignal
        self.open = []
        self.close = []
        self.high = []
        self.low = []
        self.volume = []
        self.time = []
        
        self.Schedule.On(self.DateRules.EveryDay(self.syl),self.TimeRules.AfterMarketOpen(self.syl,0),Action(self.SetSignal))
    
    def SetSignal(self):
        history = self.History(1, Resolution.Daily)

        for slice in history:  
            bar = slice[self.syl]
            self.open.append(bar.Open)
            self.close.append(bar.Close)
            self.high.append(bar.High)
            self.low.append(bar.Low)
            self.volume.append(bar.Volume)
            self.time.append(bar.Time)
            self.Debug("{0}: {1}: {2}: {3}: {4}: {5}".format(self.open[-1], self.close[-1], self.high[-1], self.low[-1], self.volume[-1], self.time[-1]))
            
    def OnData(self, data):
        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
            Arguments:
                data: Slice object keyed by symbol containing the stock data
        '''

        # if not self.Portfolio.Invested:
        #    self.SetHoldings("SPY", 1)