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 3.168 Tracking Error 0.306 Treynor Ratio 0 Total Fees $0.00 |
class ResistanceVerticalRadiator(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 9, 5) # Set Start Date self.SetCash(100000) # Set Strategy Cash self.symbol_data_by_symbol = {} self.AddEquity("AAPL", Resolution.Daily) self.SetUniverseSelection(MyUniverse()) def OnSecuritiesChanged(self, changes): for security in changes.AddedSecurities: self.symbol_data_by_symbol[security.Symbol] = SymbolData(security) self.Log(self.symbol_data_by_symbol[security.Symbol].Rev) for security in changes.RemovedSecurities: self.symbol_data_by_symbol.pop(security.Symbol, None) from Selection.FundamentalUniverseSelectionModel import FundamentalUniverseSelectionModel class MyUniverse(FundamentalUniverseSelectionModel): def __init__(self): self.curr_month = -1 super().__init__(True) def SelectCoarse(self, algorithm, coarse): if self.curr_month == algorithm.Time.month: return Universe.Unchanged self.curr_month = algorithm.Time.month return [x.Symbol for x in coarse if x.HasFundamentalData and x.Price > 5][:10] def SelectFine(self, algorithm, fine): return [x.Symbol for x in fine][:10] class SymbolData: def __init__(self, security): self.security = security @property def MarketCap(self): return self.security.Fundamentals.CompanyProfile.MarketCap @property def Rev(self): income_statement = self.security.Fundamentals.FinancialStatements.IncomeStatement return income_statement.TotalRevenue.TwelveMonths