Overall Statistics |
Total Trades
750
Average Win
0.65%
Average Loss
-1.40%
Compounding Annual Return
6.636%
Drawdown
32.000%
Expectancy
0.230
Net Profit
296.011%
Sharpe Ratio
0.57
Probabilistic Sharpe Ratio
1.189%
Loss Rate
16%
Win Rate
84%
Profit-Loss Ratio
0.46
Alpha
0.06
Beta
-0.003
Annual Standard Deviation
0.106
Annual Variance
0.011
Information Ratio
-0.066
Tracking Error
0.206
Treynor Ratio
-23.704
Total Fees
$1833.98
Estimated Strategy Capacity
$2500000.00
Lowest Capacity Asset
GSG TKH7EPK7SRC5
|
# https://quantpedia.com/strategies/asset-class-trend-following/ # # Use 5 ETFs (SPY - US stocks, EFA - foreign stocks, IEF - bonds, VNQ - REITs, # GSG - commodities), equal weight the portfolio. Hold asset class ETF only when # it is over its 10 month Simple Moving Average, otherwise stay in cash. class AssetClassTrendFollowing(QCAlgorithm): def Initialize(self): self.SetStartDate(2000, 1, 1) self.SetCash(100000) self.data = {} period = 10 * 21 self.SetWarmUp(period) self.symbols = ["SPY", "EFA", "IEF", "VNQ", "GSG"] self.tracked_symbol = None for symbol in self.symbols: self.AddEquity(symbol, Resolution.Daily) self.data[symbol] = self.SMA(symbol, period, Resolution.Daily) self.tracked_symbol = symbol self.Schedule.On(self.DateRules.MonthStart(self.symbols[0]), self.TimeRules.AfterMarketOpen(self.symbols[0]), self.Rebalance) def Rebalance(self): long = [x[0] for x in self.data.items() if self.Securities.ContainsKey(x[0]) and x[1].IsReady and self.Securities[x[0]].Price > x[1].Current.Value] # Trade execution. invested = [x.Key.Value for x in self.Portfolio if x.Value.Invested] for symbol in invested: if symbol not in long: self.Liquidate(symbol) for symbol in long: if symbol == self.tracked_symbol: self.Log(self.data[symbol].Current.Value) self.SetHoldings(symbol, 1 / len(long))