OPEN-SOURCE SCRIPT
EMA Bollinger Bands with FVG Boxes Outside

//version=6
indicator("EMA Bollinger Bands with FVG Boxes Outside", overlay=true)
// Input parameters
length = input.int(50, "EMA Length")
mult = input.float(2.0, "Bollinger Band Multiplier", step=0.1)
fvg_color_up = input.color(color.new(color.green, 80), "FVG Up Box Color")
fvg_color_down = input.color(color.new(color.red, 80), "FVG Down Box Color")
extension_length = input.int(3, "Box Extension Bars to Right", minval=0, maxval=50)
// Calculate EMA and EMA-based Bollinger Bands
ema_val = ta.ema(close, length)
dev = mult * ta.stdev(close, length)
upper_band = ema_val + dev
lower_band = ema_val - dev
// Plot EMA Bollinger Bands
plot(upper_band, "Upper Band", color=color.blue)
plot(ema_val, "EMA", color=color.orange)
plot(lower_band, "Lower Band", color=color.blue)
// Function to detect Fair Value Gaps (FVG)
// Bullish FVG when low of current bar > high of bar 2 bars ago
fvg_up = low > high[2]
// Bearish FVG when high of current bar < low of bar 2 bars ago
fvg_down = high < low[2]
// Check if FVG is outside Bollinger Bands
fvg_up_outside = fvg_up and low > upper_band
fvg_down_outside = fvg_down and high < lower_band
// Draw bullish FVG box, extended to the right by extension_length bars
if (fvg_up_outside)
box.new(left=bar_index[2], top=high[2], right=bar_index + extension_length, bottom=low, bgcolor=fvg_color_up, border_color=fvg_color_up)
// Draw bearish FVG box, extended to the right by extension_length bars
if (fvg_down_outside)
box.new(left=bar_index[2], top=low[2], right=bar_index + extension_length, bottom=high, bgcolor=fvg_color_down, border_color=fvg_color_down)
indicator("EMA Bollinger Bands with FVG Boxes Outside", overlay=true)
// Input parameters
length = input.int(50, "EMA Length")
mult = input.float(2.0, "Bollinger Band Multiplier", step=0.1)
fvg_color_up = input.color(color.new(color.green, 80), "FVG Up Box Color")
fvg_color_down = input.color(color.new(color.red, 80), "FVG Down Box Color")
extension_length = input.int(3, "Box Extension Bars to Right", minval=0, maxval=50)
// Calculate EMA and EMA-based Bollinger Bands
ema_val = ta.ema(close, length)
dev = mult * ta.stdev(close, length)
upper_band = ema_val + dev
lower_band = ema_val - dev
// Plot EMA Bollinger Bands
plot(upper_band, "Upper Band", color=color.blue)
plot(ema_val, "EMA", color=color.orange)
plot(lower_band, "Lower Band", color=color.blue)
// Function to detect Fair Value Gaps (FVG)
// Bullish FVG when low of current bar > high of bar 2 bars ago
fvg_up = low > high[2]
// Bearish FVG when high of current bar < low of bar 2 bars ago
fvg_down = high < low[2]
// Check if FVG is outside Bollinger Bands
fvg_up_outside = fvg_up and low > upper_band
fvg_down_outside = fvg_down and high < lower_band
// Draw bullish FVG box, extended to the right by extension_length bars
if (fvg_up_outside)
box.new(left=bar_index[2], top=high[2], right=bar_index + extension_length, bottom=low, bgcolor=fvg_color_up, border_color=fvg_color_up)
// Draw bearish FVG box, extended to the right by extension_length bars
if (fvg_down_outside)
box.new(left=bar_index[2], top=low[2], right=bar_index + extension_length, bottom=high, bgcolor=fvg_color_down, border_color=fvg_color_down)
סקריפט קוד פתוח
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.
סקריפט קוד פתוח
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.