| Overall Statistics |
|
Total Trades 783 Average Win 1.47% Average Loss -0.05% Compounding Annual Return 8.434% Drawdown 33.200% Expectancy 1.335 Net Profit 17.631% Sharpe Ratio 0.451 Probabilistic Sharpe Ratio 19.253% Loss Rate 93% Win Rate 7% Profit-Loss Ratio 32.16 Alpha 0.221 Beta -0.756 Annual Standard Deviation 0.273 Annual Variance 0.075 Information Ratio -0.012 Tracking Error 0.493 Treynor Ratio -0.163 Total Fees $9399866.35 |
class VentralParticlePrism(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2018, 7, 17) # Set Start Date
self.SetEndDate(2020, 7, 17)
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)
#I need the MOMP of this 'object', self.vma --> The moving average of trading volume for 'QQQ'
# over the course of a year.
self.vmaSlope = MomentumPercent(14)
#Do I need to specify resolution?
self.Schedule.On(
self.DateRules.EveryDay("QQQ"),
self.TimeRules.AfterMarketOpen("QQQ", 5),
self.Derp)
self.SetWarmup(365)
def OnData(self, data):
if self.IsWarmingUp:
return
self.vmaSlope.Update(self.Time, self.vma.Current.Value)
#Here is where I am getting the error message: Runtime Error: Trying to dynamically access a method
# that does not exist throws a TypeError exception. To
# prevent the exception, ensure each parameter type matches
# those required by the Update method. Please checkout the
# API documentation.
# at OnData in main.py:line 24
# TypeError : No method matches given arguments for Update
def Derp(self):
if not self.vmaSlope.IsReady:
return
if self.vmaSlope.Current.Value <= -0.1:
self.SetHoldings("TQQQ", 0.9)
self.SetHoldings("QQQ", 0)
self.SetHoldings("UVXY", 0.1)
if self.vmaSlope.Current.Value <= -0.01:
self.Liquidate("TQQQ")