| Overall Statistics |
|
Total Trades 1441 Average Win 1.36% Average Loss -0.79% Compounding Annual Return 11.764% Drawdown 16.700% Expectancy 0.314 Net Profit 605.723% Sharpe Ratio 0.997 Probabilistic Sharpe Ratio 39.875% Loss Rate 52% Win Rate 48% Profit-Loss Ratio 1.72 Alpha 0.082 Beta 0.377 Annual Standard Deviation 0.127 Annual Variance 0.016 Information Ratio 0.051 Tracking Error 0.159 Treynor Ratio 0.337 Total Fees $56651785.88 |
class VentralParticlePrism(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2003, 1, 1) # Set Start Date
self.SetEndDate(2020, 7, 22)
self.SetCash(250000000) # Set Strategy Cash
self.AddEquity("QQQ", Resolution.Minute)
self.AddEquity("TQQQ", Resolution.Minute)
self.AddEquity("UVXY", Resolution.Minute)
self.vma = self.SMA("QQQ", 365, Resolution.Daily, Field.Volume)
self.vmaSlope = MomentumPercent(12)
self.BuyThreshold = ((self.vma.Current.Value)*(-0.123))*100
self.SellThreshold = ((self.vma.Current.Value)*(-0.1))*100
self.Schedule.On(
self.DateRules.EveryDay("QQQ"),
self.TimeRules.AfterMarketOpen("QQQ", 7),
self.Derp)
#Whenever I raise the number of minutes to anything over 10,
#it places and cancels an order every single trading day throughout
#the entire backtest. I don't understand this at all.
self.SetWarmup(365)
def OnData(self, data):
if self.IsWarmingUp:
return
self.vmaSlope.Update(self.Time, self.vma.Current.Value)
def Derp(self):
if self.vmaSlope.Current.Value <= self.BuyThreshold:
self.SetHoldings("TQQQ", 0)
self.SetHoldings("QQQ", 1)
self.SetHoldings("UVXY", 0)
#self.Short == False
#self.Long == True
if self.vmaSlope.Current.Value >= self.SellThreshold:
self.Liquidate("TQQQ")
self.Liquidate("QQQ")