Which side started the latest trade on a tick chart: a buyer lifting the ask or a seller hitting the bid.
aggressor_side is a series int. Compare it with the constants aggressor.buy and aggressor.sell: a buy means the trade printed at the ask because a buyer took liquidity, a sell means it printed at the bid because a seller did.
Summing the volume of each side over a window gives a rough read of who was more aggressive.
Type
series int
Remarks
- Like ask and bid, it has a value only on the 1-tick timeframe in real time, and is na otherwise.
- On Sidechair: not supported yet; a script that reads aggressor_side stops with the error "aggressor_side" isn't defined.
Example
//@version=6
indicator("Aggressor volume")
signed = aggressor_side == aggressor.buy ? volume : aggressor_side == aggressor.sell ? -volume : 0.0
plot(math.sum(signed, 100), "Net aggressive volume", color.teal, style = plot.style_columns)See also
Not on Sidechair yet