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.099
Tracking Error
0.403
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
class LogicalMagentaFish(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 1, 1) 
        self.SetEndDate(2020, 7, 1) 
        self.SetCash(100000) 
        self.spy = self.AddEquity("AAPL", Resolution.Daily).Symbol # time keeper
        
        self.signal = False
        self.spy = self.AddEquity("SPY", Resolution.Daily).Symbol

    def OnData(self, data): 
        
        if self.Portfolio.Invested:
            return
        
        # Signal detected at midnight 00:00 June 2nd
        if self.Time.month == 6 and self.Time.day==2:
            self.RemoveSecurity(self.spy)
            self.AddEquity("SPY", Resolution.Second)
            self.signal = True
            return
        
        # June 3rd 2020
        if self.signal:
            self.Buy(self.spy, 1) 
        
        
        
        #if self.Time.month == 6 and self.Time.day==3:
        #if self.Time.month == 6 and self.Time.day==4: