Overall Statistics |
Total Orders 548 Average Win 0.56% Average Loss -0.14% Compounding Annual Return 11.698% Drawdown 38.400% Expectancy 3.673 Start Equity 100000 End Equity 841199.64 Net Profit 741.200% Sharpe Ratio 0.548 Sortino Ratio 0.589 Probabilistic Sharpe Ratio 5.338% Loss Rate 4% Win Rate 96% Profit-Loss Ratio 3.89 Alpha 0.025 Beta 0.687 Annual Standard Deviation 0.121 Annual Variance 0.015 Information Ratio 0.083 Tracking Error 0.073 Treynor Ratio 0.096 Total Fees $556.12 Estimated Strategy Capacity $8600000.00 Lowest Capacity Asset GLD T3SKPOF94JFP Portfolio Turnover 0.09% |
# region imports from AlgorithmImports import * # endregion class EqualWeightedPortfolio(QCAlgorithm): def Initialize(self): self.SetStartDate(2005, 1, 1) self.SetCash(100000) self.symbols = [self.AddEquity(ticker).Symbol for ticker in ["SPY", "QQQ", "GLD"]] self.SetBenchmark("SPY") self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel()) self.Schedule.On(self.DateRules.MonthStart("SPY"), self.TimeRules.AfterMarketOpen("SPY", 0), self.Rebalance) self.spyInitialPrice = None self.initialBenchmarkValue = None self.initialPortfolioValue = self.Portfolio.TotalPortfolioValue def Rebalance(self): # Perform rebalancing logic here for symbol in self.symbols: self.SetHoldings(symbol, 1/len(self.symbols)) def OnData(self, data): pass