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)
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.