# TF Liquidity Friction Monitor

This read-only indicator measures when the chart symbol becomes expensive or difficult to transact relative to its own broker history. It combines historical spread cost, tick-volume drought and normalized opening gaps into a 0–100 friction score.

## Interpretation

| State | Rule |
|---|---|
| LIQUID | Score below 40 |
| NORMAL | Score at least 40 |
| THIN | Score at least 70 |
| DISLOCATED | Spread percentile at least 97.5 or gap at least 3× prior median true range |

The score is descriptive, not a direction forecast. Bar 0 and the dashboard state are explicitly preliminary. Closed bars are causal and alerts, when enabled, use confirmed bars only.

## Data and outputs

The 240-bar broker-relative baseline needs at least 60 valid positive spread and volume observations. Spread is converted to basis points before ranking. Volume drought is the inverse percentile of `log(1 + tick volume)`. Gap pressure compares the open/previous-close gap with the median true range of 120 strictly older bars.

Published buffers expose friction score, spread percentile, volume drought, gap ratio, spread cost in basis points and state code. If historical spread or volume is missing, the indicator returns `EMPTY_VALUE` instead of fabricating a liquid state.

## Inputs

- `InpMaxBars`: 300–100,000 bars; default 5,000.
- `InpShowDashboard`: compact preliminary status panel.
- `InpEnableFrictionAlert`: off by default; closed transition into THIN/DISLOCATED only.
- `InpDebugLog`: optional history/data diagnostics.

This is market-context software, not a trade signal, execution guarantee or promise of profit.
