OPEN-SOURCE SCRIPT
Liquidity Thermometer

This is a universal indicator that assesses market liquidity based on five key market parameters: volume, volatility, candlestick range, body size, and price momentum.
The indicator does not use open interest data and is suitable for all markets, including spot, futures, and Forex.
This indicator normalizes each metric historically and creates a composite index between 0 and 1, where higher values correspond to a stable and calm market environment, and lower values indicate periods of increased risk and potential liquidity stress.
LT generates an integral liquidity index in the range [0; 1] based on five normalized components:
-nVol — normalized volume, reflecting trading density and activity.
-nATR — the volatility component (ATR), inverted, as high volatility is typically associated with declining liquidity.
-nRange — the normalized candlestick range, also inverted to assess the structural narrowness of the price movement.
-nBody — the normalized candlestick body size (|close − open|), inverted to assess the balance of supply and demand.
-nMove — the normalized value of the price impulse movement (|Δclose|), reflecting short-term price spikes.
Each metric is linearly normalized over a sliding window (200 bars) using the formula:
norm(x) = (x − min) / (max − min),
where at max = min, the value is fixed at 0.5 to ensure stability.
The ALT index is calculated as a weighted combination:
ALT = 0.35 nVol + 0.20 (1 − nATR) + 0.20 (1 − nRange) + 0.15 (1 − nBody) + 0.10 (1 − nMove)
The result is further smoothed using EMA(3) to reduce micronoise.
Red Zone (MLI < 0.25) — Risk, Thin Liquidity
When the indicator falls into the red zone, it means the market is extremely volatile:
Characteristics:
Low volume — small trades have a strong impact on the price.
High volatility — candlesticks rise or fall sharply.
Wide candlestick range — the market is "breathing heavily," easily breaking price extremes.
Impulsive movements — small market shocks lead to sharp spikes.
Thin liquidity — few orders in the order book, large orders "eat up" the market.
What this means for a trader:
🔥 High risk of spikes and false breakouts.
⚠ Possible series of liquidations on leverage.
❌ It is not recommended to enter long or short positions without a filter or protection.
✅ Can be used for short scalping strategies if you know the entry point, but very carefully.
Green Zone (MLI > 0.75) — High Liquidity, Safe Zone
When the indicator rises into the green zone, it means the market is stable and balanced:
Characteristics:
High volume — the market is deep, orders are executed without a strong impact on the price.
Low volatility — candlesticks are stable, no sharp spikes.
Narrow candlestick range — price moves calmly.
Weak impulse movements — no sharp surges.
Sufficient liquidity — the market can handle large orders.
What this means for a trader:
✅ Safe zone for opening positions.
🔄 Easier to set stop-loss and take-profit orders.
💡 You can trade both up and down, the risk of sharp movements is minimal.
⚡ Under these conditions, there is a lower risk of spikes and accidental liquidations.
It does not predict price movements or guarantee results. It is an analytical tool intended for additional research into market structure.
https://www.tradingview.com/x/YKaGYv3K/
The indicator does not use open interest data and is suitable for all markets, including spot, futures, and Forex.
This indicator normalizes each metric historically and creates a composite index between 0 and 1, where higher values correspond to a stable and calm market environment, and lower values indicate periods of increased risk and potential liquidity stress.
LT generates an integral liquidity index in the range [0; 1] based on five normalized components:
-nVol — normalized volume, reflecting trading density and activity.
-nATR — the volatility component (ATR), inverted, as high volatility is typically associated with declining liquidity.
-nRange — the normalized candlestick range, also inverted to assess the structural narrowness of the price movement.
-nBody — the normalized candlestick body size (|close − open|), inverted to assess the balance of supply and demand.
-nMove — the normalized value of the price impulse movement (|Δclose|), reflecting short-term price spikes.
Each metric is linearly normalized over a sliding window (200 bars) using the formula:
norm(x) = (x − min) / (max − min),
where at max = min, the value is fixed at 0.5 to ensure stability.
The ALT index is calculated as a weighted combination:
ALT = 0.35 nVol + 0.20 (1 − nATR) + 0.20 (1 − nRange) + 0.15 (1 − nBody) + 0.10 (1 − nMove)
The result is further smoothed using EMA(3) to reduce micronoise.
Red Zone (MLI < 0.25) — Risk, Thin Liquidity
When the indicator falls into the red zone, it means the market is extremely volatile:
Characteristics:
Low volume — small trades have a strong impact on the price.
High volatility — candlesticks rise or fall sharply.
Wide candlestick range — the market is "breathing heavily," easily breaking price extremes.
Impulsive movements — small market shocks lead to sharp spikes.
Thin liquidity — few orders in the order book, large orders "eat up" the market.
What this means for a trader:
🔥 High risk of spikes and false breakouts.
⚠ Possible series of liquidations on leverage.
❌ It is not recommended to enter long or short positions without a filter or protection.
✅ Can be used for short scalping strategies if you know the entry point, but very carefully.
Green Zone (MLI > 0.75) — High Liquidity, Safe Zone
When the indicator rises into the green zone, it means the market is stable and balanced:
Characteristics:
High volume — the market is deep, orders are executed without a strong impact on the price.
Low volatility — candlesticks are stable, no sharp spikes.
Narrow candlestick range — price moves calmly.
Weak impulse movements — no sharp surges.
Sufficient liquidity — the market can handle large orders.
What this means for a trader:
✅ Safe zone for opening positions.
🔄 Easier to set stop-loss and take-profit orders.
💡 You can trade both up and down, the risk of sharp movements is minimal.
⚡ Under these conditions, there is a lower risk of spikes and accidental liquidations.
It does not predict price movements or guarantee results. It is an analytical tool intended for additional research into market structure.
https://www.tradingview.com/x/YKaGYv3K/
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội Quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội Quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.