OPEN-SOURCE SCRIPT
12M Return Strategy

This strategy is based on the original Dual Momentum concept presented by Gary Antonacci in his book “Dual Momentum Investing.”
It implements the absolute momentum portion of the framework using a 12-month rate of change, combined with a moving-average filter for trend confirmation.
The script automatically adapts the lookback period depending on chart timeframe, ensuring the return calculation always represents approximately one year, whether you are on daily, weekly, or monthly charts.
How the Strategy Works
1. 12-Month Return Calculation
The core signal is the 12-month price return, computed as:
(Current Price ÷ Price from ~1 year ago) − 1
This return:
Plots as a histogram
Turns green when positive
Turns red when negative
The lookback adjusts automatically:
1D chart → 252 bars
1W chart → 52 bars
1M chart → 12 bars
Other timeframes → estimated to approximate 1 calendar year
2. Trend Filter (Moving Average of Return)
To smooth volatility and avoid noise, the strategy applies a moving average to the 12M return:
Default length: 12 periods
Plotted as a white line on the indicator panel
This becomes the benchmark used for crossovers.
3. Trade Signals (Long / Short / Cash)
Trades are generated using a simple crossover mechanism:
Bullish Signal (Go Long)
When:
12M Return crosses ABOVE its MA
Action:
Close short (if any)
Enter long
Bearish Signal (Go Short or Go Flat)
When:
12M Return crosses BELOW its MA
Action:
If shorting is enabled → Enter short
If shorting is disabled → Exit position and go to cash
Shorting can be enabled or disabled with a single input switch.
4. Position Sizing
The strategy uses:
Percent of Equity position sizing
You can specify the percentage of your portfolio to allocate (default 100%).
No leverage is required, but the strategy supports it if your account settings allow.
5. Visual Signals
To improve clarity, the strategy marks signals directly on the indicator panel:
Green Up Arrows: return > MA
Red Down Arrows: return < MA
A status label shows the current mode:
LONG
SHORT
CASH
6. Backtest-Ready
This script is built as a full TradingView strategy, not just an indicator.
This means you can:
Run complete backtests
View performance metrics
Compare long-only vs long/short behavior
Adjust inputs to tune the system
It provides a clean, rule-driven interpretation of the classic absolute momentum approach.
Inspired By: Gary Antonacci – Dual Momentum Investing
This script reflects the absolute momentum side of Antonacci’s original research:
Uses 12-month momentum (the most statistically validated lookback)
Applies a trend-following overlay to control downside risk
Recreates the classic signal structure used in academic studies
It is a simplified, transparent version intended for practical use and educational clarity.
Disclaimer
This script is for educational and research purposes only.
Historical performance does not guarantee future results.
Always use proper risk management.
It implements the absolute momentum portion of the framework using a 12-month rate of change, combined with a moving-average filter for trend confirmation.
The script automatically adapts the lookback period depending on chart timeframe, ensuring the return calculation always represents approximately one year, whether you are on daily, weekly, or monthly charts.
How the Strategy Works
1. 12-Month Return Calculation
The core signal is the 12-month price return, computed as:
(Current Price ÷ Price from ~1 year ago) − 1
This return:
Plots as a histogram
Turns green when positive
Turns red when negative
The lookback adjusts automatically:
1D chart → 252 bars
1W chart → 52 bars
1M chart → 12 bars
Other timeframes → estimated to approximate 1 calendar year
2. Trend Filter (Moving Average of Return)
To smooth volatility and avoid noise, the strategy applies a moving average to the 12M return:
Default length: 12 periods
Plotted as a white line on the indicator panel
This becomes the benchmark used for crossovers.
3. Trade Signals (Long / Short / Cash)
Trades are generated using a simple crossover mechanism:
Bullish Signal (Go Long)
When:
12M Return crosses ABOVE its MA
Action:
Close short (if any)
Enter long
Bearish Signal (Go Short or Go Flat)
When:
12M Return crosses BELOW its MA
Action:
If shorting is enabled → Enter short
If shorting is disabled → Exit position and go to cash
Shorting can be enabled or disabled with a single input switch.
4. Position Sizing
The strategy uses:
Percent of Equity position sizing
You can specify the percentage of your portfolio to allocate (default 100%).
No leverage is required, but the strategy supports it if your account settings allow.
5. Visual Signals
To improve clarity, the strategy marks signals directly on the indicator panel:
Green Up Arrows: return > MA
Red Down Arrows: return < MA
A status label shows the current mode:
LONG
SHORT
CASH
6. Backtest-Ready
This script is built as a full TradingView strategy, not just an indicator.
This means you can:
Run complete backtests
View performance metrics
Compare long-only vs long/short behavior
Adjust inputs to tune the system
It provides a clean, rule-driven interpretation of the classic absolute momentum approach.
Inspired By: Gary Antonacci – Dual Momentum Investing
This script reflects the absolute momentum side of Antonacci’s original research:
Uses 12-month momentum (the most statistically validated lookback)
Applies a trend-following overlay to control downside risk
Recreates the classic signal structure used in academic studies
It is a simplified, transparent version intended for practical use and educational clarity.
Disclaimer
This script is for educational and research purposes only.
Historical performance does not guarantee future results.
Always use proper risk management.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.