OPEN-SOURCE SCRIPT
ที่อัปเดต:

The Fantastic 4 - Momentum Rotation Strategy

373
Overview
The Fantastic 4 is a tactical momentum rotation indicator. It rotates capital monthly across four carefully selected assets based on their 75-day Rate of Change (ROC), allocating only to assets with positive momentum and proportionally weighting them by their momentum strength.

This indicator tracks the strategy's historical performance, displays current allocation recommendations, and sends monthly rebalance alerts so you can easily manage your portfolio. Simply set your capital amount and the indicator shows exactly how much to invest in each asset.

Why These Four Assets?
The selection of 20-year Bonds, Gold, Russell 2000, and Emerging Markets is based on their specific volatility and decorrelation characteristics, which allow the strategy to react quickly to market shifts while providing protection during downturns.

Russell 2000 (Small Caps)
Chosen over the S&P 500 because it is more "lively" and active (Nowadays you could use also the Nasdaq). Its trends are steeper and more vertical, making it easier for a momentum indicator to catch clear trends. While the S&P 500 has more inertia, the Russell 2000 develops faster, allowing the strategy to capture gains in shorter periods.

Emerging Markets
Included because they can act like a "rocket," offering explosive growth potential while maintaining high decorrelation from developed equity markets. When emerging markets trend, they trend hard.

20-Year Bonds
Selected because they are the most decorrelated asset from equities. When a stock market crash occurs, capital typically flows into fixed income, and long-term bonds (20-year) notice this influx the most, making their price reaction more significant and easier to trade. This is the strategy's primary "safe haven."

Gold
Along with bonds, gold serves as a defensive asset providing a "shield" for the portfolio when general market conditions deteriorate. It offers additional decorrelation and crisis protection.

How the Strategy Works

The 75-Day Momentum Engine
The strategy uses a 75-day momentum lookback (roughly 3.5 months), which is considered very "agile" compared to other models like Global Equity Momentum (GEM) that use 200-day periods. This shorter window allows the strategy to:
  • React quickly to changes in trend
  • Catch upward movements in volatile assets early
  • Exit quickly when trends break


Monthly Rebalancing Process
At the end of each month:

Step 1: Calculate 75-day ROC for each asset
Step 2: Filter out assets with negative momentum (they receive 0% allocation)
Step 3: Distribute capital proportionally based on momentum strength
Step 4: Apply 5% minimum threshold (smaller allocations become zero)
Step 5: Apply 80% maximum cap (no single asset exceeds 80%, remainder stays in cash)

The 80% Ceiling Rule
There is an 80% investment ceiling for any single asset to prevent over-exposure. If only one asset (like bonds) has positive momentum, 80% goes to that asset and 20% remains in cash/liquidity.

Behavior in Bearish Markets
When markets turn bearish, the strategy protects capital through several mechanisms:

Automatic Risk-Off
Because the strategy only invests in assets with positive momentum, it automatically moves away from crashing equities. If an asset's trend becomes negative, the strategy stays "on the sidelines" for that asset.

The Bond Haven
During prolonged bearish periods or sudden crashes (like COVID-19), the strategy typically shifts into 20-year bonds. During the COVID-19 crash in March 2020, while global markets were collapsing, strategies like this reportedly yielded positive returns by being positioned in bonds.

Full Liquidity Option
If no assets show positive momentum, the strategy moves to 100% cash. This is rare given the decorrelation between the four assets—when equities crash, bonds and gold typically rise.

What This Indicator Does
This is a tracking and alerting tool that:
  • Calculates the optimal allocation based on current momentum
  • Shows historical monthly performance of the strategy
  • Simulates portfolio equity growth from your specified starting capital
  • Displays exact dollar amounts to invest in each asset
  • Sends monthly rebalance alerts with complete instructions
  • Detects missing data to prevent false signals


Features
  • Dynamic allocation table showing weights, dollar amounts, and ROC values
  • Monthly returns history with color-coded performance
  • Data availability detection with visual status indicators
  • Configurable alerts for rebalancing, go-to-cash, and missing data
  • Simulated equity curve from initial capital


Settings Guide

Assets
Configure your four ETFs. The default European ETFs are:
  • Asset 1 - XETR:IS04: iShares 20+ Year Treasury Bond (Bonds)
  • Asset 2 - XETR:GZUR: Gold ETC
  • Asset 3 - XETR:XRS2: Xtrackers Russell 2000 (Small Caps)
  • Asset 4 - XETR:XMME: Xtrackers Emerging Markets (EM)


For US markets, consider: TLT (20-year bonds), GLD (Gold), IWM (Russell 2000), EEM (Emerging Markets)

Strategy Settings
  • ROC Period - Momentum lookback in daily bars. Default: 75 days (~3.5 months)
  • Max Allocation % - Maximum weight for any single asset. Default: 80%
  • Min Allocation % - Threshold below which allocation becomes zero. Default: 5%


Capital
  • Initial Capital - Your portfolio value. The indicator calculates exact amounts for each asset based on this. Default: $20,000


Display
  • Table Positions - Position the allocation and history tables on screen
  • Months of History - How many past months to display (3-24)


Alerts
  • Monthly Rebalance Alert - Sends complete allocation details at month end
  • Go-to-Cash Alert - Alerts when all assets have negative momentum
  • Missing Data Alert - Warns when asset data is unavailable


How to Use

Initial Setup
  • Add indicator to any chart and switch to MONTHLY timeframe
  • Configure your four ETF tickers
  • Set your portfolio capital amount
  • Position the tables where you prefer


Setting Up Alerts
  • Click Alert button or press Alt+A
  • Set Condition to "Fanta4"
  • Select "Any alert() function call"
  • Choose notification method (Email, Push, Webhook, etc.)
  • Set expiration to "Open-ended"


Monthly Workflow
  • Receive rebalance alert at the start of each month
  • Alert shows exact percentages AND dollar amounts for each asset
  • Adjust your portfolio accordingly
  • No action needed during the month


Reading the Tables
  • Green = positive returns/momentum
  • Red = negative returns/momentum
  • Orange "N/A" = missing data
  • Alloc column shows weight distribution (e.g., "45/35/20/—")


Alert Message Example
Monthly alerts include:
  • Target month for the new allocation
  • Current portfolio value
  • Each asset's percentage AND dollar amount
  • Each asset's momentum (ROC) value
  • Cash allocation if applicable
  • Total return since inception


Historical Context
This strategy combines elements of:
  • Dual Momentum (Gary Antonacci) - Relative and absolute momentum
  • Global Equity Momentum (GEM) - But with shorter 75-day vs 200-day lookback
  • Risk parity concepts - Decorrelated asset selection


The key innovation is the specific asset selection optimized for momentum trading and the agile 75-day lookback period that allows faster reactions to trend changes.

Data Requirements
The strategy activates only when all four assets have valid price data (minimum 75 days of history). The data status row shows checkmarks for available data. Note: Some ETFs have limited history (e.g., XMME data starts June 2017).

Limitations
  • This is a tracking indicator, not an automated trading system
  • Past performance is hypothetical and does not guarantee future results
  • Requires all four assets to have valid data; partial allocation not supported
  • Monthly rebalancing may miss shorter-term momentum shifts
  • Transaction costs, slippage, and taxes are not included in simulation
  • ETF availability and liquidity vary by region
  • The 75-day momentum may whipsaw in choppy, trendless markets


Disclaimer
This indicator is for educational and informational purposes only. It does not constitute financial advice.

Version History
v1.0 - Initial release with momentum rotation, allocation tables, data validation, and monthly alerts
เอกสารเผยแพร่
v1.1: Updated Bug in input asset "XETR:XMME"
เอกสารเผยแพร่
Version History
v1.1 - Fixed history table to show active allocation matching returns; improved data validation for low-volatility periods; added webhook JSON alerts; simplified allocation table

Webhook Integration (v1.1)
For automated trading systems, enable "Use Webhook JSON Format" in settings to receive structured JSON payloads instead of human-readable alerts.

JSON Payload Fields
  • source - "fantastic4_rotation"
  • status - "rebalance", "go_to_cash", or "no_data"
  • target_month / target_year - The month this allocation applies to
  • portfolio - Current equity, initial capital, total return
  • allocation - Each asset's percentage, dollar amount, ROC, and validity
  • symbols - Full ticker symbols for each asset


Setting Up Webhook Alerts
  • Enable "Use Webhook JSON Format" in indicator settings
  • Create alert with "Any alert() function call" condition
  • Set Webhook URL as your notification method
  • Your backend receives JSON at each month-end rebalance


Understanding the History Table (v1.1)
The Alloc column now correctly shows the allocation that was ACTIVE during that month:
  • If October shows Alloc "—/80/—/—" (80% GZUR) and GZUR returned +5%
  • TOTAL will show ~4% (80% × 5%)
  • The numbers now match - allocation × returns = total

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน