short covering
// Short Covering Detector (OI + VWAP + Volume)
// Combines price crossing above VWAP, volume spike, and decreasing Open Interest
// in an up move—classic short covering setup.
// Disclaimer: For educational use only.
indicator("Short Covering OI-VWAP-Volume", overlay=true)
// Inputs
src = input.source(close, title="Source")
volFactor = input.float(1.5, title="Volume Spike Factor")
oiFactor = input.float(0.0, title="Minimum OI Decrease (>=)", tooltip="Detect OI decrease (negative or zero change)")
vwapLen = input.int(1, title="VWAP Length (bars)", tooltip="Adjust if using anchored VWAP")
cooldownBars = input.int(10, title="Cooldown Bars Between Signals", tooltip="Spacing between signals")
volSpike = volume > ta.sma(volume, 20) * volFactor
// VWAP of current bar (built-in)
vwap = vwapLen
priceAboveVWAP = src > vwap
// Open Interest logic (bar-by-bar change)
oiChange = oi - oi[1]
oiDecrease = oiChange <= oiFactor
// Combined raw signal
rawSignal = priceAboveVWAP and volSpike and oiDecrease
// Cooldown logic
static int barsSinceSignal = cooldownBars + 1
barsSinceSignal := barsSinceSignal + 1
shortCover = rawSignal and barsSinceSignal > cooldownBars
if shortCover{
barsSinceSignal := 0
}
// Plotting
plotshape(series=shortCover,location=location.belowbar, shape=shape.arrowup, color=color.orange, text="SC" )
barcolor(shortCover ? color.orange : na)
// Alerts
alertcondition(shortCover, title="Short Covering (OI-VWAP-Vol)", message="Short covering indication via OI ↓ + VWAP breach + Volume ↑")
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by GoCharting. Read more in the Terms of Use.
Comments (1)
Loading comments…
