| Overall Statistics |
|
Total Trades 32 Average Win 0.47% Average Loss -0.69% Compounding Annual Return -16.444% Drawdown 3.000% Expectancy -0.044 Net Profit -0.670% Sharpe Ratio -1.492 Probabilistic Sharpe Ratio 32.927% Loss Rate 43% Win Rate 57% Profit-Loss Ratio 0.67 Alpha 0.809 Beta 0.447 Annual Standard Deviation 0.122 Annual Variance 0.015 Information Ratio 14.475 Tracking Error 0.141 Treynor Ratio -0.407 Total Fees $43.35 |
class VerticalModulatedCoil(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2020, 2, 15) # Set Start Date
self.SetCash(100000) # Set Strategy Cash
self.SetUniverseSelection(ManualUniverseSelectionModel([Symbol.Create(symbol, SecurityType.Equity, Market.USA) for symbol in ["SPY", "TLT"]]))
self.SetAlpha(MyAlpha())
self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel())
self.SetExecution(ImmediateExecutionModel())
class MyAlpha(AlphaModel):
def __init__(self):
self.day = 0
def Update(self, algorithm, data):
insights = []
if self.day == algorithm.Time.day:
return insights
self.day = algorithm.Time.day
marketClose = None
for symbol in data.Keys:
if marketClose is None:
marketClose = algorithm.Securities[symbol].Exchange.Hours.GetNextMarketClose(algorithm.Time, False);
insights.append(Insight.Price(symbol, marketClose-timedelta(minutes=1), InsightDirection.Up))
return insights