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
XAGUSD Trend Double Pullback Stable 20 Realtime applies trend stability requirements, signal cooldown periods, and ATR-based distance filters to qualify trading entries. Traders can toggle between realtime intrabar triggering and confirmed bar-close execution. The script overlays visual trend backgrounds and draws dynamic entry, stop loss, and take profit risk levels directly on the price chart. When set to realtime mode, signals can trigger intrabar on unconfirmed candles.
Multiple EMA bands for short and medium trend structure
ATR-based entry distance and body size filters
Realtime intrabar or close-confirmed signal evaluation
On-chart visual entry, stop loss, and take profit lines
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Short EMA 1 Top / 动力
int
12
shortEmaTopLen
Short EMA 2 Bottom / 支撑
int
25
shortEmaBotLen
Medium EMA 1 Top / 防守
int
50
mediumEmaTopLen
Medium EMA 2 Bottom / 整体
int
70
mediumEmaBotLen
Baseline / Visual Only
int
199
baselineLen
Trend Stability Bars / 稳定K线数
int
20
trendStabilityBars
Signal Cooldown / 信号冷却
int
10
cooldownBars
Breakout Tolerance Bars / 破位容忍度
int
5
breakoutToleranceBars
Signal Mode / 信号模式
string
Realtime / 实时触发
signalMode
Use alert() Dynamic Message / 动态提醒
bool
true
useDynamicAlert
Show Entry/SL/TP Lines / 显示入场止损止盈线
bool
true
showRiskLines
允许做多
bool
true
enableLong
Show all 21 settings
Setting
Type
Default
Variable
允许做空
bool
true
enableShort
最小实体 ATR倍数
float
0.08
minBodyAtr
距离50EMA最大ATR倍数
float
2.2
maxDistanceAtr
ATR周期
int
14
atrLen
ATR保护止损倍数
float
1.2
slAtr
盈亏比
float
1.8
rr
结构高低点周期
int
8
swingLen
结构止损缓冲ATR
float
0.3
bufferAtr
Show Trend Background
bool
true
showTrendBackground
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 overlays trend-following Supertrend bands on the price chart using Average True Range calculations. It plots trailing stop lines, highlights active trend directions, and prints buy or sell shape labels when price closes across band thresholds. I
The MA Envelope indicator calculates upper and lower channel bands shifted by a user-defined percentage around a baseline moving average. It supports Simple Moving Average, Exponential Moving Average, and Weighted Moving Average calculation types. The script p
Trend Compass 4H plots a multi-EMA ribbon (10/21/50) along with higher-timeframe reference levels on the price chart. It classifies trend phase into six states and calculates a composite weighted trend score. The script detects RSI and MACD divergences, analyz
My Macro Cycle Indicator plots daily and weekly simple and exponential moving averages on the price chart, plus Pi Cycle and Mayer Multiple levels derived from the 200-day average. Optional toggles add support-band fills, a Keltner channel, CME futures gaps, a
This indicator plots a double-smoothed Supertrend baseline on the price chart, combining a Supertrend midline with WMA and EMA smoothing to show trend direction. Direction uses an ATR-scaled baseline slope with hysteresis, while percentile-ranked slope magnitu
This indicator overlays an all-in-one technical analysis toolkit on the price chart. It plots multiple moving averages, including standard EMAs, SMAs, and a Trend Regularity Adaptive Moving Average, alongside Bollinger Bands, Supertrend, Nadaraya-Watson envelo