BB - MFI/RSI [Modified from LazyBear]

1503 1 664
Here is the modification from BB-MFI/RSI from LazyBear. I add the period for the BB as told by John Bollinger in his book.

Base on his book, he suggest to try :

9p RSI with 40p BB and Stdv 2.0
14p RSI with 50p BB and Stdv 2.1
10p MFI with 40p BB and Stdv 2.0

The idea is to compare the short period in indicator with Long period of BB.
Remove from Favorite Scripts Add to Favorite Scripts
// @author LazyBear
// RSI/MFI with Bollinger Bands. Dynamic Oversold/Overbought levels, yayy!
// I add the BB period setting as told by John Bollinger's Book. 
study(title = "BB% of MFI/RSI [Modified from LazyBear]", shorttitle="BB%MFI/RSI[LB]")
source = hlc3
length = input(14, minval=1), mult = input(2.0, minval=0.001, maxval=50), bblength = input(50, minval=1, title="BB Period")
DrawRSI_f=input(true, title="Draw RSI?", type=bool)
DrawMFI_f=input(false, title="Draw MFI?", type=bool)
HighlightBreaches=input(true, title="Highlight Oversold/Overbought?", type=bool)

DrawMFI = (not DrawMFI_f) and (not DrawRSI_f) ? true : DrawMFI_f
DrawRSI = (DrawMFI_f and DrawRSI_f) ? false : DrawRSI_f
// RSI
rsi_s = DrawRSI ? rsi(source, length) : na
plot(DrawRSI ? rsi_s : na, color=maroon, linewidth=2)

// MFI
upper_s = DrawMFI ? sum(volume * (change(source) <= 0 ? 0 : source), length) : na
lower_s = DrawMFI ? sum(volume * (change(source) >= 0 ? 0 : source), length) : na
mf = DrawMFI ? rsi(upper_s, lower_s) : na
plot(DrawMFI ? mf : na, color=green, linewidth=2)

// Draw BB on indices
bb_s = DrawRSI ? rsi_s : DrawMFI ? mf : na
basis = sma(bb_s, length)
dev = mult * stdev(bb_s, bblength)
upper = basis + dev
lower = basis - dev
plot(basis, color=red)
p1 = plot(upper, color=blue)
p2 = plot(lower, color=blue)
fill(p1,p2, blue)

b_color = (bb_s > upper) ? red : (bb_s < lower) ? green : na
bgcolor(HighlightBreaches ? b_color : na)
How can I use it ?
+2 Reply
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out