Overall Statistics |
Total Trades 1327 Average Win 0.08% Average Loss -0.01% Compounding Annual Return 7.287% Drawdown 20.900% Expectancy 3.901 Net Profit 44.081% Sharpe Ratio 0.585 Probabilistic Sharpe Ratio 14.897% Loss Rate 24% Win Rate 76% Profit-Loss Ratio 5.42 Alpha 0.065 Beta -0.016 Annual Standard Deviation 0.109 Annual Variance 0.012 Information Ratio -0.215 Tracking Error 0.164 Treynor Ratio -4.006 Total Fees $1473.78 |
class StarterV0(QCAlgorithm): def Initialize(self): self.SetStartDate(2014, 11, 1) self.SetCash(1e6) self.AddEquity('AAPL') self.AddEquity('SPY') self.SetBenchmark('SPY') self.SetBrokerageModel(AlphaStreamsBrokerageModel()) self.SetExecution(ImmediateExecutionModel()) self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel()) self.UniverseSettings.Resolution = Resolution.Minute self.universe = {} self.count = 0 self.Schedule.On(self.DateRules.EveryDay('SPY'), self.TimeRules.AfterMarketOpen('SPY', 10), self.Daily) def Daily(self): insights = [] for symbol, symbolData in self.universe.items(): if self.count == 0: # Everything looks good. self.Debug('[{}]: BUY {}'.format(self.Time, symbol)) insights.append(Insight.Price(symbol, timedelta(weeks=100), InsightDirection.Up)) if self.count == 10: # Nevermind. self.Debug('[{}]: SELL {}'.format(self.Time, symbol)) insights.append(Insight.Price(symbol, timedelta(1), InsightDirection.Flat)) self.EmitInsights(insights) self.count += 1 def OnSecuritiesChanged(self, changes): symbols = [x.Symbol for x in changes.AddedSecurities] for symbol in symbols: self.universe[symbol] = Symbol(symbol) class Symbol: def __init__(self, symbol): self.symbol = symbol