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
0
Tracking Error
0
Treynor Ratio
0
Total Fees
$0.00
class GeneralPractice(QCAlgorithm):

    def Initialize(self):
        self.UniverseSettings.Resolution = Resolution.Minute
        self.SetStartDate(2020, 9, 28)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        self.Schedule.On(self.DateRules.On(2020, 9, 28), self.TimeRules.At(9, 20, 20), Action(self.AddTickers))
        

    def AddTickers(self):
        self.Log("AddTickers(): Fired at : {0}".format(self.Time))
        tickers = ['AMD','INO','NIO']
        for x in tickers:
            self.Log("Adding: " + str(x))
            self.AddEquity(x, Resolution.Minute, Market.USA, True, 1, True).Symbol



    def OnData(self, data):
        if (self.Time.hour >= 8) & (self.Time.hour < 12):
            tradeBars = data.Bars
            TradeBar = tradeBars['AMD']
            Open = TradeBar.Open      ## Open price
            Close = TradeBar.Close    ## Close price
            time = TradeBar.EndTime
            self.Debug("Printing Open: %s"%str(Open))
            self.Debug("Printing Close: %s"%str(Close))
            self.Debug("Printing Period: %s"%str(time))

        
    def OnSecuritiesChanged(self, changes):
        self.Log("OnSecuritiesChanged: Fired at : {0}".format(self.Time))
        # selected symbols will be found in Log
        self.Log(f'New Securities Added: {[security.Symbol.Value for security in changes.AddedSecurities]}')
        self.Log(f'Securities Removed{[security.Symbol.Value for security in changes.RemovedSecurities]}')