Add strategies/High_Volume_Bars_Strategy.pine
This commit is contained in:
18
strategies/High_Volume_Bars_Strategy.pine
Normal file
18
strategies/High_Volume_Bars_Strategy.pine
Normal 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)
|
||||||
Reference in New Issue
Block a user