Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
168.948%
Drawdown
2.400%
Expectancy
0
Net Profit
8.080%
Sharpe Ratio
13.382
Probabilistic Sharpe Ratio
99.707%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0.357
Beta
1.088
Annual Standard Deviation
0.099
Annual Variance
0.01
Information Ratio
8.778
Tracking Error
0.05
Treynor Ratio
1.223
Total Fees
$1.39
Estimated Strategy Capacity
$46000000.00
Lowest Capacity Asset
QQQ RIWIV7K5Z9LX
from datetime import date
from datetime import datetime

class Example_Plot(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2021, 10, 4)
        Today = datetime.now().date()
        TodayTime =  datetime.now()
        self.Debug(f'{TodayTime} UTC_Time')
        self.SetEndDate(Today)
        #self.SetEndDate(2021, 11, 1)
        
        self.SetCash(100000)
        
        self.SetTimeZone("America/New_York")
        #self.SetTimeZone("Europe/Amsterdam")
        
        self.SetWarmUp(10, Resolution.Daily)
        
        self.Data = {}
                
        self.symbols = ["QQQ"]
        
        for ticker in self.symbols:
            security = self.AddEquity(ticker, Resolution.Minute)
            symbol = security.Symbol
            self.Data[symbol] = SymbolData(self, security, symbol)
            stockPlot = Chart(ticker)
            stockPlot.AddSeries(Series("Price", SeriesType.Line, 0))
            self.AddChart(stockPlot)
        
    def OnData(self, data):
        
        if self.IsWarmingUp: return
     
        for symbol in self.Data.keys():
            SymbolData = self.Data[symbol]
            
            if (not self.Portfolio[symbol].Invested):
                self.SetHoldings(symbol, 1/len(self.symbols))
            
            current_time = datetime.strftime(self.Time,"%H:%M")
                
            if self.Time >= self.StartDate and current_time > "09:30" and current_time <= "09:31":
                self.Debug(f'AM Minute {self.Time}  {symbol.Value}  {SymbolData.closeM.Current.Value}')
                
            if self.Time >= self.StartDate and current_time > "15:59" and current_time <= "16:00":
                self.Debug(f'PM Minute {self.Time}  {symbol.Value}  {SymbolData.closeM.Current.Value}')
                
    
    def OnEndOfDay(self, symbol):        
            
            if self.IsWarmingUp: return
        
            SymbolData = self.Data[symbol]
            
            if self.Time >= self.StartDate:
                self.Debug(f'EOD Daily {self.Time}  {symbol.Value}  {SymbolData.close.Current.Value}')
                self.Plot(symbol.Value, "Price", SymbolData.close.Current.Value)
            
            
                
class SymbolData(object):
    
    def __init__(self, algorithm, security, symbol):

     
        self.algorithm = algorithm
        self.closeM = algorithm.SMA(symbol, 1, Resolution.Minute)
        self.close = algorithm.SMA(symbol, 1, Resolution.Daily)