Overall Statistics |
Total Trades 2202 Average Win 0.17% Average Loss -0.07% Compounding Annual Return 15.084% Drawdown 15.300% Expectancy 1.639 Net Profit 320.260% Sharpe Ratio 1.366 Probabilistic Sharpe Ratio 80.343% Loss Rate 19% Win Rate 81% Profit-Loss Ratio 2.27 Alpha 0.116 Beta 0.272 Annual Standard Deviation 0.116 Annual Variance 0.014 Information Ratio 0.003 Tracking Error 0.164 Treynor Ratio 0.585 Total Fees $3661942.09 Estimated Strategy Capacity $1900000.00 |
from QuantConnect.Data.Custom.CBOE import * class AIMPortfoliosFireandForget(QCAlgorithm): def Initialize(self): self.SetStartDate(2011, 1, 1) #TQQQ Latest Inception Date --> February 9, 2010 self.SetEndDate(2021, 3, 18) self.SetCash(1000000000) self.SetWarmUp(180) self.SetBenchmark('SPY') self.dayCounter = 0 self.AddEquity('QQQ', Resolution.Minute) self.AddEquity('SPY', Resolution.Minute) self.AddEquity('IWM', Resolution.Minute) #self.AddEquity('UVXY', Resolution.Minute) #self.AddEquity('URTY', Resolution.Minute) self.AddEquity('SCO', Resolution.Minute) self.AddEquity('GLD', Resolution.Minute) self.AddEquity('TLT', Resolution.Minute) #self.AddEquity('TQQQ', Resolution.Minute) #self.AddEquity('UPRO', Resolution.Minute) self.AddEquity('TMF', Resolution.Minute) self.Schedule.On (self.DateRules.EveryDay("QQQ"), self.TimeRules.AfterMarketOpen("QQQ", 30), self.Rebalance) self.leverageA = 1 def OnData(self, data): if self.IsWarmingUp: return def Rebalance(self): if not self.Securities['QQQ'].Invested: self.SetHoldings('QQQ', 0.24) self.SetHoldings('SPY', 0.24) self.SetHoldings('IWM', 0.14) self.SetHoldings('SCO', 0.11) self.SetHoldings('GLD', 0.11) self.SetHoldings('TMF', 0.16) #self.SetHoldings('UVXY', 0.04) self.dayCounter = 0 elif self.dayCounter is 6: self.SetHoldings('QQQ', 0.24) self.SetHoldings('SPY', 0.24) self.SetHoldings('IWM', 0.14) self.SetHoldings('SCO', 0.11) self.SetHoldings('GLD', 0.11) self.SetHoldings('TMF', 0.16) #self.SetHoldings('UVXY', 0.025) self.dayCounter = 0 else: self.dayCounter = self.dayCounter+1