liquidity

forge.tafunctionSince Forge API 1
Functionpython
forge.ta.liquidity(high: ArrayLike,low: ArrayLike,close: ArrayLike,confirm_bars: int = 3,margin_atr: float = 0.1,atr_period: int = 10) -> dict[str, np.ndarray]

Equal highs and lows, resting liquidity above swing highs and below swing lows, and sweeps.

Parameters

NameTypeDefault
highArrayLike
lowArrayLike
closeArrayLike
confirm_barsint3
margin_atrfloat0.1
atr_periodint10

Indicator: Liquidity

A swing high is a bar whose high is above every high within confirm_bars bars on each side; it is known that many bars later, and every value is written then. eqh marks a swing high within margin_atr times the average true range (Wilder's, over atr_period bars) of the previous swing high; eql mirrors it. Every swing high leaves buyside liquidity at its price and every swing low sellside liquidity. A bar that trades through a level takes it, and when that bar closes back on the other side it is a sweep (sweep_high or sweep_low). buyside is the nearest level above price still untaken, sellside the nearest below.

Classpython
forge.ta.Liquidity(**inputs: Any) -> None

Equal highs and lows (EQH, EQL), resting liquidity above swing highs and below swing lows, and the sweeps that take it.

Inputs

NameTypeDefaultRange
confirm_barsint31 to 50
margin_atrfloat0.10 to 5
atr_periodint101 to 500

A swing high is a bar whose high is above every high within confirm_bars bars on each side; it is known confirm_bars bars later, and values are written then. Swing lows mirror it.

EQH marks a swing high within margin_atr times the ATR of the previous swing high. The ATR is Wilder's average true range over atr_period bars. EQL mirrors it.

Every swing high leaves buyside liquidity at its price, and every swing low sellside liquidity. When a bar trades above a buyside level it is taken; if the bar closes back below it, that is a sweep (sweep_high). Sellside mirrors it (sweep_low).

buyside is the nearest untaken buyside level above price and sellside the nearest untaken sellside level below it. Forge keeps the fifty newest levels per side. A missing bar starts again.