1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
202 lines of Pine Script v5 from dual_momentum_indicator_v1-1.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Dual Momentum requests monthly closes for a US equity ETF, an international equity ETF and a bond ETF, and compares their returns over a set number of months, 12 by default, with a manually entered Treasury bill rate as the absolute momentum test. It shows the resulting allocation signal in a table and background colour, with alerts on signal change and at month end. It uses monthly data, so signals change slowly.
Relative momentum between US and international equity ETFs
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
US Equities Symbol
symbol
SPY
usEquitySymbol
International Equities Symbol
symbol
EFA
intlEquitySymbol
Defensive Asset Symbol
symbol
AGG
defensiveSymbol
Lookback Period (Months)
int
12
lookbackMonths
T-Bill Annual Rate (%)
float
4.0
tbillRate
Show Signal Table
bool
true
showTable
Table Position
string
top_right
tablePosition
Show Background Color
bool
true
showBackground
Background Transparency
int
90
bgTransparency
Alert on Signal Change
bool
true
alertOnChange
Alert on Month End
bool
true
alertOnMonthEnd
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This overlay indicator screens a pasted list of up to forty symbols and draws a table on the price chart. It classifies bullish or bearish setups from the percent change between the current candle and the candle 250 bars back, then shows RSI with a simple movi
This multi-symbol indicator evaluates a combined trading condition across up to 40 user-defined symbols. It processes MACD bullish crossovers, RSI thresholds, Bollinger Band boundaries, and DMI/ADX trend filters using security calls. When buy or sell criteria
TradersPost Trading Checklist is an overlay indicator that evaluates a suite of popular technical conditions for long and short trade setups. It checks session-anchored VWAP, fast and slow EMA alignments and crosses, 200 SMA, RSI overbought or oversold conditi
The 8zz Contrarian Indicator plots reverse sentiment trading signals directly on the price chart based on tracked retail post activity. It generates bullish signals during retail panic and bearish signals during market euphoria. The indicator features adjustab
This indicator colors the chart background using a full-screen single-cell table based on the 20-period Relative Strength Index (RSI). When the RSI is above 50, the table applies a bullish background color, and when below 50, a bearish color. The background up
This indicator analyzes historical candle direction and price range over a configurable lookback window to gauge market trend. It categorizes trend direction using candle count, price range sum, or both. Signals are filtered using a Simple Moving Average to en