Add strategies/High_Volume_Bars_Strategy.pine

This commit is contained in:
2024-12-05 16:34:56 -08:00
parent 1bf5bd7853
commit 5c0b47b726

View File

@@ -0,0 +1,18 @@
// 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)