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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。