Smart Money Indicator
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © hiren147

//@version=5
indicator("Smart Money Indicator", overlay = true)

// Input for the length of the volume moving average
length = input.int(20, title = "Volume MA Length")

// Calculate the volume moving average
smaVolume = ta.sma(volume, length)

// Plot a line on the chart when the current volume is significantly above the moving average
plotshape(series = volume > smaVolume * 1.5, title = "Smart Money", location = location.belowbar, color = color.green, style = shape.triangleup, size = size.small)

// Plot a line on the chart when the current volume is significantly below the moving average
plotshape(series = volume < smaVolume * 0.5, title = "Dumb Money", location = location.abovebar, color = color.red, style = shape.triangledown, size = size.small)

