Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
6.351%
Drawdown
0.700%
Expectancy
0
Net Profit
0.079%
Sharpe Ratio
-5.609
Probabilistic Sharpe Ratio
6.825%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.01
Beta
0.834
Annual Standard Deviation
0.053
Annual Variance
0.003
Information Ratio
4.516
Tracking Error
0.011
Treynor Ratio
-0.357
Total Fees
$5.00
Estimated Strategy Capacity
$6700000.00
Lowest Capacity Asset
SPY R735QTJ8XC9X
# SPY Test
from AlgorithmImports import *


class SpyDataReadFailure(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2004, 11, 12)          
        self.SetEndDate(2004, 11, 16)          
        self.SetCash(100000)
        self.spy = self.AddEquity("SPY", Resolution.Minute).Symbol        

         
    def OnData(self, data):      
        if not (self.Time.hour == 9 and self.Time.minute == 31): return        
        if not self.spy in data: 
            self.Log("data but not spy?")
            return
        
        close = self.Securities[self.spy].Close
        try:
            close1 = data[self.spy].Close
            self.Log("close: " + str(close) + " close1: " + str(close1))
        except:
            self.Log("close: " + str(close) + " close1: unavailable")
        
        if not self.Portfolio[self.spy].Invested:
            self.MarketOrder(self.spy, 1000)