This indicator calculates and displays a Moving Average Convergence Divergence (MACD) oscillator alongside EMA and SMA signal lines and histograms in a separate pane.
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
184 lines of Pine Script v6 from Indicators/indicators/reversals/rmacd.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
CT Reverse MACD Cross offers reverse signal line calculations and detailed visual styling, including directional dual-coloring for rising and falling segments. Users can configure price source, fast and slow EMA periods, separate EMA or SMA signal line lengths, and histogram scaling.
Configurable fast and slow MACD lengths
Dual EMA and SMA signal line options
EMA and SMA difference histograms
Dynamic dual-color rising and falling line styling
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Price Source
source
close
i_source_price
Fast Period
int
12
i_fast_length
Slow Period
int
26
i_slow_length
Show MACD
bool
true
i_MACDOn
Color Type
string
Dual
i_c_typ_line
Single Color
color
#ff9100
i_c_line
Dual Color (Rising)
color
#26A69A
i_c_line_rise
Dual Color (Falling)
color
#EF5350
i_c_line_fall
Line Width
int
2
i_p_width_line
Show EMA
bool
true
i_ema_on
MA Length
int
9
i_emaLen
Color Type
string
Dual
i_c_typ_ema
Show all 40 settings
Setting
Type
Default
Variable
Single Color
color
#ffffff
i_c_ema
Dual Color (Rising)
color
#005eff
i_c_ema_rise
Dual Color (Falling)
color
#ff9d00
i_c_ema_fall
Line Width
int
2
i_p_width_ema
Show SMA
bool
false
i_sma_on
MA Length
int
9
i_smaLen
Color Type
string
Dual
i_c_typ_sma
Single Color
color
#ffffff
i_c_sma
Dual Color (Rising)
color
#00ff00
i_c_sma_rise
Dual Color (Falling)
color
#ff0000
i_c_sma_fall
Line Width
int
2
i_p_width_sma
Show EMA Histogram
bool
true
i_hist_e_On
Histogram Scaling Factor
int
1
i_hist_e_Fact
Upper Rising
color
#005eff88
i_c_hist_e_Urise
Upper Falling
color
#7babff87
i_c_hist_e_Ufall
Lower Falling
color
#ff9d0085
i_c_hist_e_Lfall
Lower Rising
color
#ffcb7884
i_c_hist_e_Lrise
Show SMA Histogram
bool
false
i_hist_s_On
Histogram Scaling Factor
int
1
i_hist_s_Fact
Upper Rising
color
#00ff0081
i_c_hist_s_Urise
Upper Falling
color
#7fff7f80
i_c_hist_s_Ufall
Lower Falling
color
#ff000080
i_c_hist_s_Lfall
Lower Rising
color
#ff7f7f7f
i_c_hist_s_Lrise
i_midLineOn
bool
true
i_midLineOn
Mid-line
int
0
i_midLine
i_c_midline
color
#909090
i_c_midline
Width
int
1
i_p_width_mli
Decimal Places
int
2
i_dec_places
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.
The Derivative Oscillator calculates a double-exponentially smoothed Relative Strength Index (RSI) and subtracts its Simple Moving Average (SMA) to form the main oscillator line. A secondary signal line is plotted using an SMA of the main oscillator values. Th
This indicator calculates a modified MACD oscillator and signal line alongside a trend EMA filter, plotting the output as a stylized column histogram in a separate pane. Instead of plotting true MACD distance, it quantifies positive and negative histogram mome
This indicator calculates and plots the standard Moving Average Convergence Divergence oscillator in a separate pane. It computes the difference between a fast and slow moving average, derives a signal line through smoothing, and plots a histogram representing
MACD-V is a volatility-normalized momentum indicator based on research by Alex Spiroglou. It calculates the standard MACD histogram and normalizes it by dividing by the Average True Range (ATR). Plotted in a separate pane as a colored histogram, it includes us
Multi-Timeframe Analysis Suite calculates trend direction and momentum conditions across five user-selected timeframes using moving averages, RSI, and Stochastic oscillators. It evaluates moving average slope and oscillator levels to compute trend alignment, m
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