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 strategy, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.
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
Banmuxia MACD Divergence identifies pivot highs and pivot lows on the MACD histogram to detect momentum divergences against price action. Historical pivot points and corresponding price levels are stored in dynamic arrays to evaluate continuous divergence patterns. Settings allow users to adjust fast, slow, and signal lengths, MA types, search ranges, and visual toggles. Drawn directly on the main price chart, it evaluates entry signals without default stop-loss or take-profit rules.
MACD histogram divergence detection via pivot highs and lows
Dynamic array tracking for historical pivot positions and price levels
Flexible fast, slow, and signal moving average configurations
ATR-based price lines and customizable chart overlay visuals
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Fast Length
int
13
fast_length
Slow Length
int
34
slow_length
Source
source
close
source
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
Above Grow
color
#26A69A
col_grow_above
Fall
color
#B2DFDB
col_fall_above
Below Grow
color
#FFCDD2
col_grow_below
Fall
color
#FF5252
col_fall_below
Show all 26 settings
Setting
Type
Default
Variable
Show Pivot Points
bool
true
showpivot
Maximum Bars to Search
int
5
max_search_vals
bigger or less than previous pivot
float
0.618
bigger_less_than
Length
int
13
length
Smoothing
string
RMA
smoothing
Multiplier
float
1.5
m
src1
source
high
src1
src2
source
low
src2
Show Price Lines
bool
true
pline
ATR Text Color
color
color.blue
col1
Low Text Color
color
color.teal
col2
High Text Color
color
color.red
col3
Low Line Color
color
color.teal
collong
High Line Color
color
color.red
colshort
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 overlay strategy combines a Cipher B WaveTrend oscillator with two optional moving averages on the price chart. It exposes WaveTrend channel and average lengths, overbought and oversold levels, buy, sell and gold dots, and regular or hidden divergence mar
Divergenced B004 is a Pine Script strategy that plots on the price chart and looks for divergences in the Squeeze Momentum Indicator. It shorts when a green-section squeeze value falls while price rises, and longs when a red-section squeeze value rises while p
This strategy executes long positions by combining a 200-period EMA trend filter, Stochastic RSI oversold crosses, and Williams Alligator retracements, supplemented by RSI divergence detection. It triggers long entries when the price trades above the 200 EMA w
This strategy enters long when the MACD line crosses above its signal line and short when it crosses below. Optional filters require the histogram to exceed a threshold, price to sit on the matching side of a simple moving average, and a simplified three-bar d
This strategy draws on the price chart and manages long and short entries around pivot trendlines. It filters signals with three configurable moving averages, Stochastic RSI, a higher-timeframe Stochastic RSI, and optional RSI divergence. A session window can
This strategy plots a range filter and high and low target bands on the price chart, and colors bars from filter direction. Inputs cover a backtest date window, WaveTrend Cipher B channel and average lengths, overbought and oversold levels, divergence threshol