This indicator calculates the MACD oscillator from a configurable source with fast and slow lengths, then plots the histogram, MACD line, and signal line in a separate pane.
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
MACD + Divergences [Alorse] detects regular bullish divergences (price lower lows with oscillator higher lows), bearish divergences, and hidden versions using pivot low and high points on the oscillator with user-defined lookback ranges. Main settings control MACD parameters such as lengths, smoothing type, and colors for lines and histogram, plus divergence plotting options and pivot search ranges. The script draws exclusively in a separate pane and signals potential trend reversals via divergences but provides no exit rules or position management.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Source
source
close
src
Fast Length
int
12
fast_length
Slow Length
int
26
slow_length
Signal Smoothing
int
9
signal_length
Oscillator MA Type
string
EMA
sma_source
Signal Line MA Type
string
EMA
sma_signal
MACD Line
color
#2962FF
col_macd
Signal Line
color
#FF6D00
col_signal
Show Signals&MACD Cross
bool
true
showCross
Above Grow
color
#00796b
col_grow_above
Fall
color
#26a69a
col_fall_above
Below Grow
color
#ef5350
col_grow_below
Show all 21 settings
Setting
Type
Default
Variable
Fall
color
#b71c1c
col_fall_below
Pivot Lookback Right
int
5
lbR
Pivot Lookback Left
int
5
lbL
Max of Lookback Range
int
60
rangeUpper
Min of Lookback Range
int
5
rangeLower
Plot Bullish
bool
true
plotBull
Plot Bearish
bool
true
plotBear
Plot Hidden Bullish
bool
false
plotHiddenBull
Plot Hidden Bearish
bool
false
plotHiddenBear
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 calculates momentum setups based on the Relative Strength Index (RSI) and plots in a separate pane. It offers multiple scanning modes such as Continuous Break, Continuous Retracement, Flip Break, Flip Retracement, and both regular and hidden div
This indicator calculates the Relative Strength Index (RSI) across four user-selected timeframes and plots the results in a separate pane. It identifies regular bullish and bearish divergences between price pivot points and the primary timeframe RSI value. Add
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
This indicator plots a standard Relative Strength Index (RSI) in a separate pane alongside customizable overbought and oversold threshold levels with shaded fills. It identifies pivot highs and lows on the oscillator to detect regular and hidden bullish and be
This indicator calculates a 14-period RSI from close and plots it in a separate pane with dotted overbought and dashed oversold lines at 70 and 30. It marks bullish divergence when a five-bar pivot low in price is lower than the price twenty bars earlier while
The script calculates the Relative Strength Index (RSI) alongside customizable overbought and oversold thresholds. It tracks recent high and low values over a user-defined lookback period to detect price and momentum divergence. Bullish and bearish divergences