Strategy · Pine Script v5 · On the chart

Banmuxia MACD Divergence

by wynnforthework

This strategy calculates a customizable MACD oscillator and histogram using either simple or exponential moving averages.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code237
Settings26inputs
LicenceNone stated
Last update1 year ago7 Oct 2025

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 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.

Details

Published by

wynnforthework on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Oscillators & momentum, Divergence, Moving averages

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy enters trades without a stop loss

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Fast Lengthint13fast_length
Slow Lengthint34slow_length
Sourcesourceclosesource
Signal Smoothingint9signal_length
Oscillator MA TypestringEMAsma_source
Signal Line MA TypestringEMAsma_signal
MACD Line  color#2962FFcol_macd
Signal Line  color#FF6D00col_signal
Above   Growcolor#26A69Acol_grow_above
Fallcolor#B2DFDBcol_fall_above
Below Growcolor#FFCDD2col_grow_below
Fallcolor#FF5252col_fall_below
Show all 26 settings
SettingTypeDefaultVariable
Show Pivot Pointsbooltrueshowpivot
Maximum Bars to Searchint5max_search_vals
bigger or less than previous pivotfloat0.618bigger_less_than
Lengthint13length
SmoothingstringRMAsmoothing
Multiplierfloat1.5m
src1sourcehighsrc1
src2sourcelowsrc2
Show Price Linesbooltruepline
ATR Text Colorcolorcolor.bluecol1
Low Text Colorcolorcolor.tealcol2
High Text Colorcolorcolor.redcol3
Low Line Colorcolorcolor.tealcollong
High Line Colorcolorcolor.redcolshort
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.

Similar Pine Scripts

24 stars

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

Strategy v5 Oscillators & momentumMoving averages
Updated 4 years ago · MPL-2.0 GitHub repository of Cipher B + EMAs Strategy

Divergenced B004

by ruckard
13 stars

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

Strategy v5 DivergenceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Divergenced B004

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

Strategy v4 TrendOscillators & momentum
Updated 3 years ago · Apache-2.0 GitHub repository of 200 EMA + Alligator + Stochastic Long Strategy

MACD_Crossover_STEPFUN

by eltonaguiar
4 stars

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

Strategy v5 Oscillators & momentumMoving averages
Updated today · None stated GitHub repository of MACD_Crossover_STEPFUN

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

Strategy v5 TrendOscillators & momentum Repaints
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines with Divergence Scanner Strategy

MML Multi Indikator Script

by theupslidedown
2 stars

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

Strategy v4 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of MML Multi Indikator Script

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers