The Detrending Net Distance Ratio indicator computes the difference between current close and close prices at ten different lookback periods ranging from seven to three hundred sixty bars.
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
Detrending Net Distance Ratio sums the positive differences to create a net value and sums their absolute values to create an abs value, then divides net by abs to produce the Net_Distance_Ratio. This ratio is plotted as a single line in a separate pane, colored red, with horizontal reference lines drawn at zero, zero point five, one, negative zero point five, and negative one. The primary settings modify the period lengths applied to the detrending calculation. The indicator provides a ratio-based measure for price distance analysis but issues no buy or sell signals.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
p_7
int
7
p_7
p_14
int
14
p_14
p_30
int
30
p_30
p_50
int
50
p_50
p_90
int
90
p_90
p_180
int
180
p_180
p_200
int
200
p_200
p_250
int
250
p_250
p_300
int
300
p_300
p_360
int
360
p_360
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 detects contrarian inflection points and potential market reversals by combining sentiment, volume, and price action metrics directly on the price chart. It evaluates overbought and oversold conditions with the RSI and Stochastic oscillators, hi
This indicator plots a TTM Squeeze momentum oscillator and a MACD line in a separate pane. It builds the squeeze oscillator from a linear regression of price against a high-low and simple moving average midpoint, and colors the area by slope and sign. Circles
This indicator calculates standardized z-scores of price data across four different lookback periods (6, 14, 26, and 100). Standardizing data subtracts the moving average from the price and divides by the standard deviation. It applies a Double Exponential Mov
The Bubbles Indicator measures volatility squeezes and expansion bursts using Bollinger Bands combined with a sinusoid oscillator and RSI divergence. It processes price data through scaled Bollinger Bands to highlight volatility changes while confirming trend
The Mean Squared Error indicator calculates the mean of squared differences between a source series and its EMA, averaged via a rolling buffer acting as SMA. This error metric plots as a filled red area on a separate pane, while the EMA overlays as a yellow li
The TTM Squeeze Divergence indicator plots a classic TTM Squeeze momentum oscillator in a separate pane alongside Bollinger Bands and Keltner Channels squeeze status dots on the zero line. It detects regular and hidden bullish and bearish divergences between p