OPEN-SOURCE SCRIPT

Smart Money & Volume Analysis with Gann

//version=5
indicator("Smart Money & Volume Analysis with Gann", overlay=true)

// Settings
lengthEMA = 20
volumeThreshold = 10000
gannAngle = 45 // Gann angle in degrees (adjust as needed)

// Exponential Moving Average
ema = ta.ema(close, lengthEMA)

// Volume
plot(volume, title="Volume", style=plot.style_histogram, color=color.blue)

// Horizontal line for volume threshold
hline(volumeThreshold, color=color.orange, linestyle=hline.style_dashed, title="Volume Threshold")

// Gann Fan Lines (requires calculation of pivot points)
// This is a simplified example; more sophisticated pivot point identification might be needed
pivotHigh = ta.highest(high, 10)
pivotLow = ta.lowest(low, 10)

// Calculate Gann Fan lines based on pivot points (simplified example)
gannLine1 = pivotHigh - (pivotHigh - pivotLow) * (bar_index - bar_index[ta.highestbars(high, 10)]) / (bar_index[ta.highestbars(high, 10)])
gannLine2 = pivotLow + (pivotHigh - pivotLow) * (bar_index - bar_index[ta.lowestbars(low, 10)]) / (bar_index[ta.lowestbars(low, 10)])


plot(gannLine1, color=color.purple, title="Gann Line 1")
plot(gannLine2, color=color.purple, title="Gann Line 2")

// Improved Potential Signals
potentialOrderBlock = ta.highest(high, 10)
potentialSmartMoney = close > ema and volume > volumeThreshold and close > gannLine1 // Added Gann Line condition

// Add condition for potential breakouts from order blocks
potentialBreakout = close > potentialOrderBlock and volume > volumeThreshold * 2 // Stronger volume confirmation for breakout

plotshape(potentialOrderBlock, style=shape.labeldown, location=location.abovebar, color=color.red, text="Possible Order Block", size=size.small)
plotshape(potentialSmartMoney, style=shape.labelup, location=location.belowbar, color=color.green, text="Possible Smart Money", size=size.small)
plotshape(potentialBreakout, style=shape.triangleup, location=location.belowbar, color=color.lime, text="Possible Breakout", size=size.small)


// Disclaimer: This script is for educational purposes only and should not be used as a complete trading strategy.
Bands and ChannelsBill Williams IndicatorsBreadth Indicators

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer