OPEN-SOURCE SCRIPT
Apex Trend & Liquidity Master V2.1

The Apex Trend & Liquidity Master is a hybrid trading system designed to align traders with the dominant market trend while identifying key structural price levels. Unlike simple moving average crossovers or standalone support/resistance tools, this script integrates a volatility-adaptive "Trend Cloud" with a "Smart Liquidity" engine.
This integration allows the script to offer unique filtering capabilities, such as hiding counter-trend liquidity zones to reduce chart noise and focus on high-probability continuations.
How It Works
Adaptive Trend Cloud The backbone of the system is the Trend Cloud, calculated using a Hull Moving Average (HMA) base with ATR bands. The cloud expands and contracts based on market volatility.
Green Cloud: Bullish Regime. The market is trending up; look for long opportunities.
Red Cloud: Bearish Regime. The market is trending down; look for short opportunities.
Smart Liquidity Zones (with Integration) The script automatically detects Pivot Highs and Lows to draw Supply (Resistance) and Demand (Support) zones. These zones persist until price breaks through them (mitigation).
Integration Feature: A "Filter Zones by Trend" option is included in the settings. When enabled, this feature connects the Trend Cloud to the Liquidity Engine:
It will only display Demand zones when the Trend Cloud is Bullish.
It will only display Supply zones when the Trend Cloud is Bearish.
Note on Lag: Zones are based on pivots (default lookback: 10). A zone appears on the chart 10 bars after the pivot forms. These are historical structural levels.
Signal Filters Buy and Sell labels are generated when the Trend Cloud changes color, but they are filtered to ensure quality:
Volume Filter: Signals only appear if the current volume is higher than the 20-period average.
RSI Filter: Prevents buying when RSI is overbought (>70) or selling when oversold (<30).
Live HUD An on-chart dashboard provides real-time data on:
Trend Bias: Direction of the cloud.
Momentum: RSI strength (Weak/Neutral/Strong).
Volume: High vs. Low activity.
Usage Guide
Identify the Trend: Use the background fill color to determine if you should be looking for longs (Green) or shorts (Red).
Wait for Structure: Look for price to pull back into a "Smart Liquidity" zone. For example, in a Green Trend, wait for price to touch a Green Demand box.
Confirm with Momentum: Check the Dashboard. Ideally, you want to see "Strong" momentum aligning with your trade direction.
Settings: If the chart is too cluttered, enable "Filter Zones by Trend" in the settings menu to hide counter-trend boxes.
Credits & Attribution This script combines original integration logic with adapted open-source concepts:
Smart Liquidity Logic: The method for generating Supply/Demand boxes via Pivot Highs/Lows and array management is adapted from open-source logic commonly used in Smart Money Concepts (SMC) indicators, notably popularized by LuxAlgo and the broader Pine community.
Trend Logic: The volatility cloud utilizes standard Hull Moving Average (HMA) and ATR formulas.
Disclaimer This indicator is provided for educational and informational purposes only. It does not constitute financial advice. Past performance of pivot levels or trend signals does not guarantee future results.
This integration allows the script to offer unique filtering capabilities, such as hiding counter-trend liquidity zones to reduce chart noise and focus on high-probability continuations.
How It Works
Adaptive Trend Cloud The backbone of the system is the Trend Cloud, calculated using a Hull Moving Average (HMA) base with ATR bands. The cloud expands and contracts based on market volatility.
Green Cloud: Bullish Regime. The market is trending up; look for long opportunities.
Red Cloud: Bearish Regime. The market is trending down; look for short opportunities.
Smart Liquidity Zones (with Integration) The script automatically detects Pivot Highs and Lows to draw Supply (Resistance) and Demand (Support) zones. These zones persist until price breaks through them (mitigation).
Integration Feature: A "Filter Zones by Trend" option is included in the settings. When enabled, this feature connects the Trend Cloud to the Liquidity Engine:
It will only display Demand zones when the Trend Cloud is Bullish.
It will only display Supply zones when the Trend Cloud is Bearish.
Note on Lag: Zones are based on pivots (default lookback: 10). A zone appears on the chart 10 bars after the pivot forms. These are historical structural levels.
Signal Filters Buy and Sell labels are generated when the Trend Cloud changes color, but they are filtered to ensure quality:
Volume Filter: Signals only appear if the current volume is higher than the 20-period average.
RSI Filter: Prevents buying when RSI is overbought (>70) or selling when oversold (<30).
Live HUD An on-chart dashboard provides real-time data on:
Trend Bias: Direction of the cloud.
Momentum: RSI strength (Weak/Neutral/Strong).
Volume: High vs. Low activity.
Usage Guide
Identify the Trend: Use the background fill color to determine if you should be looking for longs (Green) or shorts (Red).
Wait for Structure: Look for price to pull back into a "Smart Liquidity" zone. For example, in a Green Trend, wait for price to touch a Green Demand box.
Confirm with Momentum: Check the Dashboard. Ideally, you want to see "Strong" momentum aligning with your trade direction.
Settings: If the chart is too cluttered, enable "Filter Zones by Trend" in the settings menu to hide counter-trend boxes.
Credits & Attribution This script combines original integration logic with adapted open-source concepts:
Smart Liquidity Logic: The method for generating Supply/Demand boxes via Pivot Highs/Lows and array management is adapted from open-source logic commonly used in Smart Money Concepts (SMC) indicators, notably popularized by LuxAlgo and the broader Pine community.
Trend Logic: The volatility cloud utilizes standard Hull Moving Average (HMA) and ATR formulas.
Disclaimer This indicator is provided for educational and informational purposes only. It does not constitute financial advice. Past performance of pivot levels or trend signals does not guarantee future results.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.