Liquidity

liquiditysmart_moneyForge API 1

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

Outputs

NameTypeRequiredDescription
eqhvalueOptionalcolor theme.down, shape circle, shift -3, style marker, where above_bar
eqlvalueOptionalcolor theme.up, shape circle, shift -3, style marker, where below_bar
sweep_higheventOptionalcolor theme.down, shape triangle_down, style marker, where above_bar
sweep_loweventOptionalcolor theme.up, shape triangle_up, style marker, where below_bar
buysidevalueOptionalcolor theme.down, dash dash, style step, width 1
sellsidevalueOptionalcolor theme.up, dash dash, style step, width 1
Warm-up
2 * confirm_bars bars (6 at the defaults)
Repaints
Yes
Parity
None

Formula

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.