Overall Statistics |
Total Trades 645 Average Win 2.59% Average Loss -1.73% Compounding Annual Return 15.534% Drawdown 26.900% Expectancy 0.491 Net Profit 1097.046% Sharpe Ratio 0.916 Probabilistic Sharpe Ratio 34.184% Loss Rate 40% Win Rate 60% Profit-Loss Ratio 1.50 Alpha 0.13 Beta -0.015 Annual Standard Deviation 0.14 Annual Variance 0.02 Information Ratio 0.199 Tracking Error 0.216 Treynor Ratio -8.591 Total Fees $29799.09 |
class MultidimensionalUncoupledAntennaArray(QCAlgorithm): def Initialize(self): self.SetStartDate(2003, 1, 4) # Set Start Date self.SetCash(100000) # Set Strategy Cash # self.AddEquity("SPY", Resolution.Minute) self.SetCash(100000) # Set Strategy Cash self.UniverseSettings.Resolution = Resolution.Daily self.AddUniverse(self.CoarseSelectionFunction,self.FineSelectionFunction) def CoarseSelectionFunction(self, coarse): selected = [x for x in coarse if (x.HasFundamentalData)] return [ x.Symbol for x in selected ] def FineSelectionFunction(self, fine): selected = [x for x in fine if (self.Time-x.SecurityReference.IPODate).days<50 and (self.Time-x.SecurityReference.IPODate).days>20 and x.OperationRatios.ROIC.ThreeMonths>0.03] sortedByPeRatio = sorted(selected,key=lambda x: x.OperationRatios.ROIC.ThreeMonths, reverse=True)[:5] for security in sortedByPeRatio: self.Debug(security.Symbol) self.Debug((self.Time-security.SecurityReference.IPODate).days) self.Debug(security.OperationRatios.ROIC.ThreeMonths) return [ x.Symbol for x in sortedByPeRatio ] def OnSecuritiesChanged(self, changes): for security in changes.RemovedSecurities: self.Liquidate(security.Symbol) for security in changes.AddedSecurities: self.SetHoldings(security.Symbol, 0.2) def OnData(self, data): '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here. Arguments: data: Slice object keyed by symbol containing the stock data ''' pass