Overall Statistics
'''An implementation of Meb Faber's base model: Global Tactical Asset Allocation model (GTAA)(5) 
Buy&Hold portfolio (monthly rebalance), as found in the paper: 
"A Quantitative Approach to Tactical Asset Allocation" published May 2006.
'''
class GlobalTacticalAssetAllocationBase(QCAlgorithm):
    def Initialize(self):
        backtestDuration = 365*10
        self.SetStartDate(2011, 10, 29) # (datetime.now() - timedelta(backtestDuration))
        self.SetEndDate(2020, 5, 20) # (datetime.now())
        self.SetCash(100000) 
        self.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Margin)
        self.UniverseSettings.Resolution = Resolution.Minute
        symbols = [Symbol.Create(ticker, SecurityType.Equity, Market.USA) 
                    for ticker in [ "SPY", # US Large Cap ETF
                                    "VEA", # Developed Foreign Stocks (TradedSince: 2007/8)ETF 
                                    "IEF", # US 10Y Gov.Bonds ETF 
                                    "DBC", # GSCI Commodities ETF (TradedSince: 2006/3)
                                    "VNQ"  # US RealEstate ETF
                                    ]]
        self.AddUniverseSelection(ManualUniverseSelectionModel(symbols))
        self.AddAlpha(ConstantAlphaModel(InsightType.Price, InsightDirection.Up, timedelta(days = backtestDuration), None, None))
        self.Settings.RebalancePortfolioOnInsightChanges = False
        self.Settings.RebalancePortfolioOnSecurityChanges = False
        self.SetPortfolioConstruction( EqualWeightingPortfolioConstructionModel(self.DateRules.MonthStart("SPY")) )
        self.SetExecution( ImmediateExecutionModel() ) 
        self.AddRiskManagement( NullRiskManagementModel() )