Overall Statistics |
Total Trades 111 Average Win 0.29% Average Loss -0.20% Compounding Annual Return 2.276% Drawdown 5.400% Expectancy 0.182 Net Profit 4.674% Sharpe Ratio 0.408 Probabilistic Sharpe Ratio 15.423% Loss Rate 52% Win Rate 48% Profit-Loss Ratio 1.44 Alpha 0.005 Beta 0.132 Annual Standard Deviation 0.04 Annual Variance 0.002 Information Ratio -0.525 Tracking Error 0.134 Treynor Ratio 0.125 Total Fees $111.00 Estimated Strategy Capacity $14000000.00 Lowest Capacity Asset XLV RGRPZX100F39 |
# Long-Short static sample portfolio from AlgorithmImports import * # ------------------------------------------------------------------------------------------------------- LONGS = ['XLK', 'XLY', 'XLB', 'XLI', 'AAPL']; SHORTS = ['XLP', 'XLF', 'XLU', 'XLV', 'AMZN']; LEV = 0.995; # ------------------------------------------------------------------------------------------------------- class PositiveMarSectorETF(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 6, 3) self.SetCash(10000) res = Resolution.Minute self.Longs = [self.AddEquity(ticker, res).Symbol for ticker in LONGS] self.Shorts = [self.AddEquity(ticker, res).Symbol for ticker in SHORTS] self.Schedule.On(self.DateRules.MonthStart(self.Longs[0]), self.TimeRules.AfterMarketOpen(self.Longs[0], 30), self.rebalance) def rebalance(self): for sec in self.Longs: self.SetHoldings(sec, 0.5*LEV/len(self.Longs)) for sec in self.Shorts: self.SetHoldings(sec, -0.5*LEV/len(self.Longs))