Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // © NKactive
- //@version=5
- indicator("MACD Indicator NK v1.0", overlay=true)
- // ****************************************************************************************************************************************************************
- macdFast = input.int(defval = 12, title="macdFast")
- macdSlow = input.int(defval = 26, title="macdSlow")
- sigLen = input.int(defval = 9, title="macdSig")
- [macdFastPlot, macdSlowPlot, sigLenPlot] = ta.macd(close, macdFast, macdSlow, sigLen)
- plot(macdFastPlot, color = color.fuchsia, linewidth = 2)
- plot(macdSlowPlot, color = color.lime, linewidth = 2)
- plot(sigLenPlot, color = color.blue, linewidth = 2)
- buySignal = ta.crossover(sigLenPlot, macdFastPlot) // blue over pink
- sellSignal = ta.crossunder(sigLenPlot, macdFastPlot) // blue under pink
- // buySignal = ta.crossover(sigLenPlot, macdFastPlot) or ta.crossover(sigLenPlot, macdSlowPlot) // blue over green or pink
- // sellSignal = ta.crossunder(sigLenPlot, macdFastPlot) or ta.crossunder(sigLenPlot, macdSlowPlot)// blue under green or pink
- plotshape(buySignal ? close : na, title="Buy", style=shape.triangleup, color=color.green, location=location.belowbar, size = size.small)
- plotshape(sellSignal ? close : na, title="Sell", style=shape.triangledown, color=color.red, size = size.small)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement