OPEN-SOURCE SCRIPT
Mebane Faber GTAA 5

In 2007, Mebane Faber published research that challenged the conventional wisdom of buy-and-hold investing. His paper, titled "A Quantitative Approach to Tactical Asset Allocation" and published in the Journal of Wealth Management, demonstrated that a simple timing mechanism could reduce portfolio volatility and drawdowns while maintaining competitive returns (Faber, 2007). This indicator implements his Global Tactical Asset Allocation strategy, known as GTAA5, following the original methodology.
The core insight of Faber's research stems from a century of market data. By analyzing asset class performance from 1901 onwards, Faber found that a ten-month simple moving average served as an effective trend filter across major asset classes. When an asset trades above its ten-month moving average, it tends to continue its upward trajectory; when it falls below, significant drawdowns often follow (Faber, 2007, pp. 12-16). This observation aligns with momentum research by Jegadeesh and Titman (1993), who documented that intermediate-term momentum persists across equity markets.
The GTAA5 strategy allocates capital equally across five diversified asset classes: domestic equities (SPY), international developed markets (EFA), aggregate bonds (AGG), commodities (DBC), and real estate investment trusts (VNQ). Each asset receives a twenty percent allocation when trading above its ten-month moving average. When an asset falls below this threshold, its allocation moves to short-term treasury bills (SHY), creating a dynamic cash position that scales with market risk (Cambria Investment Management, 2013).
The strategy's historical performance during market crises illustrates its function. During the 2008 financial crisis, traditional sixty-forty portfolios experienced drawdowns exceeding forty percent. The GTAA5 strategy limited losses to approximately twelve percent by reducing equity exposure as prices declined below their moving averages (Faber, 2013). This asymmetric return profile represents the strategy's primary characteristic.
This implementation uses monthly closing prices retrieved via request.security() to calculate the ten-month simple moving average. This distinction matters, as approximations using daily data (such as a 200-day moving average) can generate different signals during volatile periods. Monthly data ensures the indicator produces signals consistent with published academic research.
The indicator provides position monitoring, automatic rebalancing detection on either the first or last trading day of each month, and share calculations based on user-defined capital. A dashboard displays current trend status for each asset class, target versus actual weightings, and trade instructions for rebalancing. Performance metrics including annualized volatility and Sharpe ratio provide ongoing risk assessment.
Several limitations warrant acknowledgment. First, the strategy rebalances monthly, meaning it cannot respond to intra-month market crashes. Second, transaction costs and taxes from monthly rebalancing may reduce net returns for taxable accounts. Third, the ten-month lookback period, while historically robust, offers no guarantee of future effectiveness. As Ilmanen (2011) notes in "Expected Returns", all timing strategies face the risk of regime change, where historical relationships break down.
This indicator serves educational purposes and portfolio monitoring. It does not constitute financial advice.
References:
Cambria Investment Management (2013). Global Tactical Asset Allocation: An Introduction to the Approach. Research Report, Los Angeles.
Faber, M.T. (2007). A Quantitative Approach to Tactical Asset Allocation. Journal of Wealth Management, Spring 2007, pp. 9-79.
Faber, M.T. (2013). Global Asset Allocation: A Survey of the World's Top Asset Allocation Strategies. Cambria Investment Management, Los Angeles.
Ilmanen, A. (2011). Expected Returns: An Investor's Guide to Harvesting Market Rewards. John Wiley and Sons, Chichester.
Jegadeesh, N. and Titman, S. (1993). Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. Journal of Finance, 48(1), pp. 65-91.
The core insight of Faber's research stems from a century of market data. By analyzing asset class performance from 1901 onwards, Faber found that a ten-month simple moving average served as an effective trend filter across major asset classes. When an asset trades above its ten-month moving average, it tends to continue its upward trajectory; when it falls below, significant drawdowns often follow (Faber, 2007, pp. 12-16). This observation aligns with momentum research by Jegadeesh and Titman (1993), who documented that intermediate-term momentum persists across equity markets.
The GTAA5 strategy allocates capital equally across five diversified asset classes: domestic equities (SPY), international developed markets (EFA), aggregate bonds (AGG), commodities (DBC), and real estate investment trusts (VNQ). Each asset receives a twenty percent allocation when trading above its ten-month moving average. When an asset falls below this threshold, its allocation moves to short-term treasury bills (SHY), creating a dynamic cash position that scales with market risk (Cambria Investment Management, 2013).
The strategy's historical performance during market crises illustrates its function. During the 2008 financial crisis, traditional sixty-forty portfolios experienced drawdowns exceeding forty percent. The GTAA5 strategy limited losses to approximately twelve percent by reducing equity exposure as prices declined below their moving averages (Faber, 2013). This asymmetric return profile represents the strategy's primary characteristic.
This implementation uses monthly closing prices retrieved via request.security() to calculate the ten-month simple moving average. This distinction matters, as approximations using daily data (such as a 200-day moving average) can generate different signals during volatile periods. Monthly data ensures the indicator produces signals consistent with published academic research.
The indicator provides position monitoring, automatic rebalancing detection on either the first or last trading day of each month, and share calculations based on user-defined capital. A dashboard displays current trend status for each asset class, target versus actual weightings, and trade instructions for rebalancing. Performance metrics including annualized volatility and Sharpe ratio provide ongoing risk assessment.
Several limitations warrant acknowledgment. First, the strategy rebalances monthly, meaning it cannot respond to intra-month market crashes. Second, transaction costs and taxes from monthly rebalancing may reduce net returns for taxable accounts. Third, the ten-month lookback period, while historically robust, offers no guarantee of future effectiveness. As Ilmanen (2011) notes in "Expected Returns", all timing strategies face the risk of regime change, where historical relationships break down.
This indicator serves educational purposes and portfolio monitoring. It does not constitute financial advice.
References:
Cambria Investment Management (2013). Global Tactical Asset Allocation: An Introduction to the Approach. Research Report, Los Angeles.
Faber, M.T. (2007). A Quantitative Approach to Tactical Asset Allocation. Journal of Wealth Management, Spring 2007, pp. 9-79.
Faber, M.T. (2013). Global Asset Allocation: A Survey of the World's Top Asset Allocation Strategies. Cambria Investment Management, Los Angeles.
Ilmanen, A. (2011). Expected Returns: An Investor's Guide to Harvesting Market Rewards. John Wiley and Sons, Chichester.
Jegadeesh, N. and Titman, S. (1993). Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. Journal of Finance, 48(1), pp. 65-91.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Where others speculate, we systematize.
edgetools.org
edgetools.org
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Where others speculate, we systematize.
edgetools.org
edgetools.org
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.