// Example of Open Interest and Volume interpretation signals in ProRealTime
// Set parameters to adjust sensitivity
period = 14 // Period for average price and volume calculation
volumeThreshold = 1.5 // Factor to identify unusual volume
// Calculate average volume and price variation
averageVolume = Average[period](Volume)
averagePrice = Average[period](Close)
// Signal for long unwinding or short covering
if (Volume < averageVolume) and (Close < averagePrice) then
longSignal = -1 // Long unwinding signal
r=0
g=255
else
if (Volume < averageVolume) and (Close > averagePrice) then
shortSignal = 1 // Short covering signal
r=255
g=0
endif
endif
// Signal for new longs or short build-up
if (Volume > averageVolume * volumeThreshold) and (Close > averagePrice) then
longSignal = 1 // New longs signal
drawtext("▲",barindex,volume)coloured("green")
r=0
g=255
else
if (Volume > averageVolume * volumeThreshold) and (Close < averagePrice) then
shortSignal = -1 // Short build-up signal
drawtext("▼",barindex,volume)coloured("red")
r=255
g=0
endif
endif
RETURN volume coloured(r,g,0,105)style(histogram), averageVolume style(line,2)coloured("blue"), averageVolume * volumeThreshold style(dottedline,2)coloured("fuchsia")