Pro Trading Art - Insider Entry with alert
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © protradingart

//@version=5
indicator("Pro Trading Art - Insider Entry with alert", "PTA - Insider Entry", format=format.volume)
// You can decide your own number.
goldenNumber = input(1.618, title="Golden Number")
volumeSMALen = input.int(defval=21, title="SMA Length", minval=4)
ma = input.bool(false, "Volume MA")
volumeSMA = ta.sma(volume, volumeSMALen)

goldenVolume = goldenNumber*volumeSMA

insiderColor = input.color(color.lime, "Insider Color")
baseColor = input.color(color.red, "Base Color")

bgColor = volume > goldenVolume ? insiderColor : baseColor

plot(volume, style=plot.style_histogram, color=bgColor)
plot(ma?volumeSMA:na, color=color.lime)


// Alert Section

if volume > goldenVolume
    alert("Insider Intry in: "+str.tostring(syminfo.ticker))


