A separate-pane indicator that ranks four user-chosen ETFs, preloaded with gold, Nasdaq, ChiNext and Nikkei funds, by momentum over a set number of weeks, and tracks a rotation into the top few.
1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
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
The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.
Overview
Settings choose the weekday that ends each week, rebalance at the close or open, minimum holding weeks and a backtest date range. An optional benchmark moving average filter can remove selected symbols and force exits. It follows a net value curve starting at one. Labels are in Chinese.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Symbol 1
symbol
SSE:518880
symbol1
Label 1
string
黄金ETF
name1
Symbol 2
symbol
SSE:513100
symbol2
Label 2
string
纳指ETF
name2
Symbol 3
symbol
SZSE:159915
symbol3
Label 3
string
创业板ETF
name3
Symbol 4
symbol
SSE:513520
symbol4
Label 4
string
日经ETF
name4
参与轮动资产数量
int
3
rotationCount
价格精确小数位
int
3
pricePrecision
启用基准均线过滤
bool
false
useMarketFilter
均线防摩擦系数(%)
float
0.0
marketFrictionPct
Show all 39 settings
Setting
Type
Default
Variable
风险过滤直接清仓
bool
true
forceExitOnFilter
强平成交时点
string
次日开盘
forceExitMode
基准符号
symbol
SP:SPX
marketFilterSymbol
基准SMA长度 (天)
int
225
marketFilterLen
基准跌破均线时停用Symbol1
bool
false
exclude1OnDown
基准跌破均线时停用Symbol2
bool
true
exclude2OnDown
基准跌破均线时停用Symbol3
bool
true
exclude3OnDown
基准跌破均线时停用Symbol4
bool
true
exclude4OnDown
动量回顾(周)
int
4
lookbackWeeks
周结束日 (Week Anchor)
string
周四
weekAnchor
换仓时点
string
收盘
rebalanceMode
最少持有周数
int
1
minHoldWeeks
初始净值
float
1
initialCapital
保留无价格自然周
bool
true
preserveEmptyWeeks
补换仓最小工作日间隔
int
4
catchupWorkdayThreshold
Backtest Start
time
timestamp("2014-12-25T00:00:00")
backtestStart
Backtest End
time
timestamp("2099-12-31T23:59:59")
backtestEnd
显示强平标注
bool
true
showForceExitLabel
显示最大回撤标注
bool
true
showMaxDdLabel
启用回撤调试日志
bool
false
enableDdDebug
启用净值调试日志
bool
false
enableEquityDebug
启用浮动净值调试日志
bool
false
enableFloatingEquityDebug
启用仓位变动日志
bool
false
enablePositionLog
启用动量计算日志
bool
false
enableMomentumLog
启用基准过滤日志
bool
false
enableFilterLog
启用Anchor周记录日志
bool
false
enableAnchorRecordLog
启用Anchor数组快照日志
bool
false
enableAnchorStateLog
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 indicator scans a pasted list of symbols for RSI directional momentum and shows matching long and short signals in a table in a separate pane. The user chooses continuous break, continuous retracement, flip break, flip retracement, divergence, or hidden d
This indicator plots the RSI oscillator on the main chart and displays its value distribution in a table positioned at the top right. The script calculates the relative strength index using the input source and length, then plots horizontal lines at 0, 50, and
Market Speedometer plots a 0-100 market speed reading in a separate pane. It measures movement by bar-to-bar change, true range, or a short average of recent bars, then ranks that movement against ATR and a percentile lookback. An EMA smooths the reading, and
KamaFama is an indicator that translates a Freqtrade trading strategy into Pine Script for visualization. It combines Kaufman Adaptive Moving Average (KAMA), MAMA/FAMA calculations derived via Hilbert Transform, Williams %R, and correlation trend filters to ev
Calculates normalized reversal metrics across up to ten Forex currency pairs using user-selected moving average methods, including HarmonicMA, EMA, SMA, or WMA. The indicator identifies overbought, oversold, and mean-crossing conditions using a configurable th
The 8-Factor Composite Screener evaluates equities across fundamental and technical criteria, including valuation ratios, earnings and revenue growth, 12-month return momentum, proximity to 52-week highs, Stage 2 moving average alignment, benchmark relative st