// 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)
진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.