Overall Statistics |
Total Trades 3 Average Win 0.00% Average Loss 0% Compounding Annual Return 7.474% Drawdown 4.600% Expectancy 0 Net Profit 3.699% Sharpe Ratio 1.356 Probabilistic Sharpe Ratio 59.476% Loss Rate 0% Win Rate 100% Profit-Loss Ratio 0 Alpha 0.063 Beta -0.021 Annual Standard Deviation 0.046 Annual Variance 0.002 Information Ratio 0.098 Tracking Error 0.421 Treynor Ratio -3.011 Total Fees $9.15 |
class ModulatedQuantumGearbox(QCAlgorithm): def Initialize(self): self.SetStartDate(2019, 12, 25) # Set Start Date self.SetCash(10000000) # Set Strategy Cash symbols = [ Symbol.Create(t, SecurityType.Equity, Market.USA) for t in ["SPY", "TSLA"]] self.SetUniverseSelection( ManualUniverseSelectionModel(symbols) ) self.UniverseSettings.Resolution = Resolution.Daily self.AddAlpha(MyAlphaModel()) self.SetPortfolioConstruction(AccumulativeInsightPortfolioConstructionModel(lambda time: None)) self.SetExecution(ImmediateExecutionModel()) class MyAlphaModel(AlphaModel): symbols = None emitted = 0 def Update(self, algorithm, slice): if self.symbols is not None and self.emitted < 2: self.emitted += 1 return [Insight(self.symbols[self.emitted - 1], timedelta(days = 365), InsightType.Price, InsightDirection.Up)] return [] def OnSecuritiesChanged(self, algorithm, changes): added = [c.Symbol for c in changes.AddedSecurities] if added: self.symbols = added