// asking for inputs for the parameters of the MACD-V indicator fast_len = input.int(title = "MACD Fast Length", defval = 10, minval = 1, group = "Indicator Settings") slow_len = input.int(title = "MACD Slow Length", defval = 30, minval = 1, group = "Indicator Settings") source = input.source(title = "Source for TF", defval = close, group = "Indicator Settings")
signal_len = input.int(title = "Signal Line Smoothing Length", defval = 8, minval = 1, group = "Indicator Settings") atr_len = input.int(title = "ATR Length", defval = 25, minval = 1, tooltip = "Used to gauge volatility to standardize MACD. Keep at the same value as the MACD Slow Length parameter for best results", group = "Indicator Settings") overbought_bounds = input.int(title = "Overbought Bounds", defval = 150, minval = 1, tooltip = "Threshold for MACD Line to cross above to be considered overbought. Original author of MACD-V placed it at 150.") overbought_belly = input.int(title = "Overbought Belly", defval = 45, minval = 1, tooltip = "Threshold for MACD Line to cross above to be considered overbought. Original author of MACD-V placed it at 50.") oversold_belly = input.int(title = "Oversold Belly", defval = -45, maxval = -1, tooltip = "Threshold for MACD Line to cross below to be considered oversold. Original author of MACD-V placed it at -50.") oversold_bounds = input.int(title = "Oversold Bounds", defval = -150, maxval = -1, tooltip = "Threshold for MACD Line to cross below to be considered oversold. Original author of MACD-V placed it at -150.")
// asking for input for the color of the macd and signal lines macd_color = input.color(title = "MACD Line", defval = #2962FF, group = "Color Settings") signal_color = input.color(title = "Signal Line", defval = #ff6f0005, group = "Color Settings")
// plotting horizontal lines for overbought and oversold bounds upper_band = plot(overbought_bounds, title = "Overbought Bounds", color = color.new(color.white,68)) upper_belly = plot(overbought_belly, title = "Overbought Belly", color = color.new(#1b7200, 50)) lower_band = plot(oversold_bounds, title = "Oversold Bounds", color = color.new(color.white,68)) lower_belly = plot(oversold_belly, title = "Oversold Belly", color = color.new(#8d0000, 50))
// filling between the lines and the bounds if overbought or oversold overbought_color = macd > overbought_bounds ? color.new(color.red,30) : na oversold_color = macd < oversold_bounds ? color.new(color.green,30) : na fill(macd_plot, upper_band, color = overbought_color, title = "Overbought Fill") fill(lower_band, macd_plot, color = oversold_color, title = "Oversold Fill")
// extending out the boundaries extended_upper_band = hline(overbought_bounds, title = "Overbought Bounds Extended", color = color.new(#2e2e2e, 68), linestyle = hline.style_solid) extended_lower_band = hline(oversold_bounds, title = "Oversold Bounds Extended", color = color.new(#2e2e2e, 68), linestyle = hline.style_solid)
fill(extended_upper_band, extended_lower_band, color = color.new(color.white, 95), title = "Normal Bounds Background Extended") hline(0, color= color.new(#2e2e2e, 68), linestyle = hline.style_dotted)