19 lines
928 B
Plaintext
19 lines
928 B
Plaintext
// Description: This script identifies high-volume bars that close up or down as potential indicators of bullish or bearish institutional activity, respectively. It generates buy and sell signals based on these conditions.
|
|
//@version=4
|
|
study("High Volume Bars Strategy", shorttitle="HVBS", overlay=true)
|
|
|
|
// Input parameters
|
|
length = input(14, title="Length")
|
|
multiplier = input(2, title="Multiplier")
|
|
|
|
// Calculate average volume
|
|
averageVolume = sma(volume, length)
|
|
|
|
// Generate signals
|
|
buySignal = crossover(volume, averageVolume * multiplier) and close > open
|
|
sellSignal = crossover(volume, averageVolume * multiplier) and close < open
|
|
|
|
// Plot buy and sell arrows
|
|
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
|
|
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
|