Overall Statistics |
Total Trades 441 Average Win 0.60% Average Loss -0.39% Compounding Annual Return 1.046% Drawdown 9.300% Expectancy 0.089 Net Profit 6.542% Sharpe Ratio 0.188 Probabilistic Sharpe Ratio 1.061% Loss Rate 58% Win Rate 42% Profit-Loss Ratio 1.56 Alpha 0.009 Beta -0.01 Annual Standard Deviation 0.043 Annual Variance 0.002 Information Ratio -0.738 Tracking Error 0.158 Treynor Ratio -0.824 Total Fees $586.14 Estimated Strategy Capacity $0 Lowest Capacity Asset TYC R735QTJ8XC9X |
class WellDressedYellowCat(QCAlgorithm): def Initialize(self): self.SetStartDate(2015, 9, 1) # Set Start Date self.SetEndDate(2021, 10, 1) self.SetCash(100000) # Set Strategy Cash self.change = self.AddData(SPYChange, "change", Resolution.Hour).Symbol self.AddRiskManagement(TrailingStopRiskManagementModel(0.03)) tickerList = ['UAL', 'ABS', 'FHN', 'BLK', 'EVRG', 'NFLX', 'DNB', 'CBOE', 'BIO', 'HRL', 'TDC', 'AMG', 'AVGO', 'ENPH', 'SII', 'XLNX', 'STR', 'OTIS', 'EVHC', 'CSC', 'LUK', 'IDXX', 'GNRC', 'NCR', 'XL', 'CFG', 'HWM', 'POOL', 'RX', 'CAM', 'LLTC', 'SNDK', 'FOXA', 'ABK', 'WB', 'HCBK', 'AAP', 'MJN', 'VRSK', 'PENN', 'WCG', 'HLT', 'JBL', 'ARG', 'TRMB', 'PCG', 'BIG', 'MOS', 'BXLT', 'LYV', 'TGNA', 'TSS', 'TIE', 'CRM', 'EQIX', 'CDW', 'PKG', 'ALTR', 'QEP', 'VTR', 'CNC', 'DLR', 'ATVI', 'CELG', 'RHT', 'HSIC', 'BC', 'FDC', 'GT', 'ROL', 'FRT', 'REGN', 'BBBY', 'BWA', 'TYL', 'HAR', 'CB', 'MPC', 'HP', 'TYC', 'VNT', 'LIFE', 'MOH', 'SBUX', 'HBI', 'ESV', 'JDSU', 'HCA', 'MRNA', 'DWDP', 'AMCR', 'APOL', 'ACE', 'FOX', 'APC', 'DO', 'DG', 'WRB', 'BEAM', 'O', 'FBHS', 'ABMD', 'NYT', 'EPAM', 'URBN', 'MON', 'EQT', 'ENDP', 'MEE', 'GRMN', 'ITT', 'COO', 'GOOGL', 'MUR', 'AKS', 'SE', 'RTN', 'LEH', 'PETM', 'NCLH', 'RRC', 'NE', 'MTCH', 'TRIP', 'BRO', 'JBHT', 'PGN', 'GPS', 'JNS', 'GLK', 'HII', 'CCI', 'IGT', 'PCL', 'LEG', 'FLS', 'RE', 'TEG', 'CPT', 'V', 'TWC', 'TSG', 'SPLS', 'PDCO', 'BTU', 'NOVL', 'MWW', 'ANDV', 'ODP', 'BMS', 'CPRI', 'XEC', 'JWN', 'FTR', 'ESS', 'CPGX', 'URI', 'LW', 'FTV', 'TDY', 'UA', 'NAVI', 'VRTX', 'FL', 'CERN', 'CVC', 'ATO', 'EW', 'TWTR', 'NVLS', 'MBI', 'BR', 'WPX', 'GM', 'MKTX', 'CEG', 'HFC', 'PCS', 'TECH', 'TDG', 'SBNY', 'JCP', 'ULTA', 'AMZN', 'TLAB', 'ALGN', 'JNY', 'POM', 'XYL', 'GR', 'STZ', 'ANET', 'JEC', 'KMI', 'UNM', 'CVH', 'WST', 'FAST', 'SLR', 'DLPH', 'M', 'KRFT', 'ANSS', 'HOLX', 'NVR', 'SCG', 'GAS', 'SGP', 'SIVB', 'LDW', 'VAR', 'ODFL', 'FDO', 'EMC', 'FB', 'SHLD', 'STI', 'EP', 'FOSL', 'UAA', 'NYX', 'WU', 'TIF', 'DPS', 'TEL', 'ALB', 'PCP', 'SLM', 'RSH', 'LKQ', 'AMD', 'AVP', 'AIV', 'WFR', 'PVH', 'OMX', 'ESRX', 'MMI', 'STJ', 'DXCM', 'NWS', 'AV', 'PRGO', 'CFN', 'BMC', 'CSRA', 'RMD', 'LVLT', 'MTD', 'MAC', 'S', 'CDAY', 'ICE', 'GENZ', 'WFM', 'NFX', 'FTNT', 'SEDG', 'EXPE', 'MNST', 'PNR', 'WLTW', 'KFT', 'RIG', 'AYI', 'ROST', 'ALK', 'ETSY', 'FNM', 'DELL', 'FRX', 'ADT', 'CEPH', 'AVB', 'MI', 'AJG', 'MGM', 'MHK', 'SIAL', 'KSE', 'FII', 'COG', 'OI', 'PCLN', 'MOLX', 'SWY', 'DXC', 'DOW', 'MNK', 'AYE', 'STE', 'CVG', 'SRCL', 'FLIR', 'LRCX', 'FANG', 'DD', 'WAB', 'R', 'GME', 'RCL', 'SIG', 'KEYS', 'LLL', 'JEF', 'CE', 'DNR', 'CZR', 'CNX', 'LNT', 'VIAB', 'TE', 'UDR', 'CARR', 'COL', 'EK', 'HOG', 'RAD', 'LM', 'SMS', 'CDNS', 'IR', 'KHC', 'PSX', 'DV', 'ATI', 'DF', 'PTC', 'GRA', 'GPN', 'NDSN', 'LSI', 'CTLT', 'DRE', 'XTO', 'TFX', 'BCR', 'BHF', 'TMUS', 'ANR', 'CHD', 'IEX', 'MAA', 'RAI', 'SBAC', 'MHS', 'SVU', 'Q', 'PBCT', 'DJ', 'AN', 'YHOO', 'TRB', 'DLTR', 'DAL', 'LDOS', 'PYPL', 'HPE', 'GMCR', 'RDC', 'SWN', 'GGP', 'HSP', 'JKHY', 'TSO', 'AOS', 'ALXN', 'COTY', 'FFIV', 'NSM', 'RRD', 'NOV', 'MPWR', 'SNI', 'TSCO', 'STX', 'QRVO', 'BS', 'CMG', 'FLT', 'GNW', 'INTU', 'ABBV', 'ZTS', 'SYF', 'FLR', 'SBL', 'CA', 'KORS', 'SNPS', 'WIN', 'THC', 'ADS', 'MFE', 'AA', 'ANF', 'CLF', 'NBR', 'KMX', 'CHK', 'TWX', 'ARE', 'NBL', 'CBE', 'MIL', 'AWK', 'FSLR', 'PAYC', 'TSLA', 'JNPR', 'T', 'ETFC', 'SAI', 'QTRN', 'TER', 'KG', 'ACN', 'DISH', 'KSS', 'IPGP', 'ARNC', 'FRC', 'MAT', 'LVS', 'NOW', 'X', 'CIEN', 'XRX', 'ILMN', 'CHTR', 'HRS', 'FDS', 'NKTR', 'INFO', 'BRCM', 'HRB', 'KBH', 'LXK', 'PLL', 'CMCSK', 'CPRT', 'SUN', 'INCY', 'NLSN', 'PTV', 'KSU', 'CXO', 'AET', 'COV', 'LO', 'MXIM', 'MLM', 'JOY', 'AME', 'FRE', 'HNZ', 'UHS', 'ACAS', 'WYN', 'AGN', 'CCE', 'CPWR', 'ALLE', 'FTI', 'SWKS', 'NXPI', 'CRL', 'REG', 'SLE', 'OGN', 'RJF', 'ZBRA', 'PBI', 'DPZ', 'AAL', 'DYN', 'IT', 'SLG', 'CTVA', 'DTV', 'CCK', 'HOT', 'DISCK', 'GHC', 'LYB', 'MSCI', 'BJS', 'EXR', 'TTWO'] for ticker in tickerList: self.AddEquity(ticker, Resolution.Daily) def OnData(self, data: Slice): if self.change in data: for ticker in data[self.change].Added: self.SetHoldings(ticker, 0.1) for ticker in data[self.change].Removed: self.SetHoldings(ticker, -0.05) class SPYChange(PythonData): def GetSource(self, config, date, isLive): source = "https://www.dropbox.com/s/7nl66xfh1jukgma/SPYChangesWiki.csv?dl=1" return SubscriptionDataSource(source, SubscriptionTransportMedium.RemoteFile); def Reader(self, config, line, date, isLive): if not (line.strip() and line[0].isdigit()): return None data = line.split(',') change = SPYChange() try: change.Symbol = config.Symbol change.Time = datetime.strptime(data[0], '%Y-%m-%d') + timedelta(hours=10) change.Value = 0 change["Added"] = str(data[1]).split(" ") change["Removed"] = str(data[2]).split(" ") except ValueError: return None return change