Overall Statistics |
Total Trades 252 Average Win 0.53% Average Loss -0.01% Compounding Annual Return 13.365% Drawdown 25.400% Expectancy 74.729 Net Profit 321.169% Sharpe Ratio 1.134 Probabilistic Sharpe Ratio 58.081% Loss Rate 1% Win Rate 99% Profit-Loss Ratio 75.36 Alpha 0.027 Beta 0.71 Annual Standard Deviation 0.124 Annual Variance 0.015 Information Ratio -0.356 Tracking Error 0.056 Treynor Ratio 0.197 Total Fees $255.91 Estimated Strategy Capacity $10000000.00 Lowest Capacity Asset TLT SGNKIKYGE9NP |
# Trading Quandl SHILLER_PE_RATIO_MONTH # ------------------------------------- STOCK = 'SPY'; BOND = 'TLT'; LEV = 1.0; # ------------------------------------- class SHILLER_PE_RATIO_MONTH(QCAlgorithm): def Initialize(self): self.SetStartDate(2010, 1, 1) self.SetEndDate(2021, 6, 15) self.SetCash(100000) self.stock = self.AddEquity(STOCK, Resolution.Minute).Symbol self.bond = self.AddEquity(BOND, Resolution.Minute).Symbol Quandl.SetAuthCode("zkdoRxRXbAQdUxzXZKBy") self.shiller = self.AddData(QuandlCustomColumns, "MULTPL/SHILLER_PE_RATIO_MONTH", Resolution.Daily, TimeZones.NewYork) self.Schedule.On(self.DateRules.MonthStart(self.stock), self.TimeRules.AfterMarketOpen(self.stock, 61), self.trade) def trade(self): if self.shiller.Close < 10: self.SetHoldings(self.stock, .40,) self.SetHoldings(self.bond, .60) elif self.shiller.Close < 14 and self.shiller.Close > 10: self.SetHoldings(self.stock, .60,) self.SetHoldings(self.bond, .40) else: self.SetHoldings(self.stock, .8) self.SetHoldings(self.bond, .20) class QuandlCustomColumns(PythonQuandl): def __init__(self): self.ValueColumnName = "value"