Volume MA * Fibo levels
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Khayrulloh

//@version=5
indicator(title="Volume MA * Fibo levels", shorttitle="Vol MA * Fibo", format=format.volume, timeframe="", timeframe_gaps=true)
Length = input(title = "Length MA", defval = 40)
Perc1 = input(title = "#1 percent", defval = 100)
Perc2 = input(title = "#2 percent", defval = 61.8)
Perc3 = input(title = "#3 percent", defval = -38.2)
Perc4 = input(title = "#4 percent", defval = -50)

ShowMA = input(true)
MA = ta.sma(volume, Length)
plot(volume, color = color.new(color.silver, 61.8), style = plot.style_columns, title = "Volume")
plot(ShowMA ? MA : na, style=plot.style_line, linewidth = 2, color=color.new(color.orange, 32.8), title="Volume MA")

ma1 = MA * (100 + Perc1) / 100
ma2 = MA * (100 + Perc2) / 100
ma3 = MA * (100 + Perc3) / 100
ma4 = MA * (100 + Perc4) / 100

vol_ma1 = plot(ShowMA ? ma1 : na, title = "#1", color = color.new(color.green, 32.8), linewidth = 1)
vol_ma2 = plot(ShowMA ? ma2 : na, title = "#2", color = color.new(color.green, 32.8), linewidth = 1)
vol_ma3 = plot(ShowMA ? ma3 : na, title = "#3", color = color.new(color.red, 32.8), linewidth = 1)
vol_ma4 = plot(ShowMA ? ma4 : na, title = "#4", color = color.new(color.red, 32.8), linewidth = 1)
