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
214 lines of Pine Script v5 from Tradingview/mfi-divergences-lower.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
MFI Divergences Lower stores recent pivot prices, MFI values, and bar indexes, then checks regular or hidden divergence across a chosen number of dots. Optional filters require the MFI to sit beyond overbought or oversold levels and limit how many bars may separate the dots. Users can change MFI length, source, pivot length, and level lines. It is not a strategy and has no entries, exits, or stop loss.
MFI plot with overbought, oversold, and middle band
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Bull 1
color
color.new(#1ecd25, 0)
bull_color1
Bull 2
color
color.new(#346836, 0)
bull_color2
Bear 1
color
color.new(#e31414, 0)
bear_color1
Bear 2
color
color.new(#6f2d2d, 0)
bear_color2
Number of dots to look at for a signal
int
2
signal_looping
Pivot Length
int
3
pivot_lookback
Regular Div.
bool
true
use_reg_div
Hidden Div.
bool
false
use_hid_div
1. MFI Above/Below
bool
true
use_trade_cond1
mfi_below
int
30
mfi_below
mfi_above
int
70
mfi_above
2. Max Bars between dots
bool
true
use_trade_cond2
Show all 18 settings
Setting
Type
Default
Variable
bn_buy
int
25
bn_buy
bn_sell
int
25
bn_sell
MFI Length
int
14
mfi_length
MFI Source
source
hlc3
mfi_src
OB
int
70
mfi_ob
OS
int
30
mfi_os
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 MACD oscillator from a configurable source with fast and slow lengths, then plots the histogram, MACD line, and signal line in a separate pane. It detects regular bullish divergences (price lower lows with oscillator higher lows),
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