Parabolic SAR Smart Filter [MarkitTick]💡 The Parabolic SAR Smart Filter is a sophisticated trend-following tool designed to enhance the traditional Parabolic Stop and Reverse (SAR) indicator with modern algorithmic filters. While the standard SAR is a staple in technical analysis for identifying trend direction and potential reversal points, it is notorious for producing false signals in sideways or low-volatility markets. This script addresses those limitations by integrating multi-timeframe (MTF) alignment, liquidity sweep detection, and volatility-normalized momentum scoring. By combining these advanced concepts, the indicator provides a high-fidelity visual experience through its "3D Neon" rendering engine, while offering a robust backend for automated trading via JSON-ready webhooks.
● ✨ Originality and Utility
The primary utility of this indicator lies in its ability to separate high-probability trend shifts from noise. Standard indicators often operate in a vacuum, ignoring the context of higher timeframes or the underlying liquidity structure of the market. The Smart Filter breaks this mold by introducing three critical layers of verification:
• Multi-Timeframe Trend Gating
The script allows users to select a higher timeframe (HTF) as a trend filter. A signal is only considered valid if the local trend aligns with the HTF direction. This prevents traders from fighting the "big picture" momentum, which is a common pitfall in trend-following strategies.
• Liquidity Sweep Integration
In modern market environments, institutional "stop hunts" or liquidity sweeps often precede genuine moves. This indicator identifies when a SAR flip occurs immediately after a sweep of local highs or lows, providing an additional layer of confidence that the reversal is backed by real capital movement rather than a minor price fluctuation.
• Neon Decay Visualization
Unlike static indicators, the "3D Neon" engine visualizes the "age" of a trend. As a trend matures, the visual intensity of the SAR dots fades. This creates an intuitive psychological cue for the trader, signaling that a trend may be reaching exhaustion or that the risk/reward ratio for new entries is diminishing.
● 🔬 Methodology and Concepts
The script is built upon several interconnected logical modules that process market data in real-time to generate actionable insights.
• SAR Logic and State Machine
The core engine utilizes a standard Parabolic SAR calculation, but it is encapsulated within a custom "Signal Engine" type. This engine tracks not just the current price, but the entry price, risk distance, and direction flips. This state-persistent approach allows for precise calculations of risk-to-reward ratios immediately upon a trend reversal.
• Momentum Score Calculation
The momentum score is a volatility-normalized metric. It is calculated by dividing the absolute distance between the current close and the SAR value by the Average True Range (ATR). This creates a "Sigma" style score that tells the trader how "extended" the price is relative to its average volatility. A high score suggests strong trend momentum, while a low score indicates a stagnant or consolidating market.
• Liquidity Sweep Logic
The sweep detection module looks back over a user-defined window (Sweep Lookback). It checks if the current low (for a bullish flip) is lower than the previous period's low, or if the current high (for a bearish flip) is higher than the previous period's high. If a SAR flip occurs under these conditions, it is flagged as a "Sweep Signal," suggesting that the market has purged liquidity before reversing.
• Early Warning System
To assist with trade management, the script calculates an "Early Warning" threshold. If the price returns to within 10% of the initial entry risk distance from the SAR dot, the script triggers a visual warning. This helps traders anticipate stops or adjust their trailing logic before a full reversal occurs.
● 🎨 Visual Guide
The chart interface is designed for clarity and rapid data interpretation through color theory and geometric shapes.
• The 3D Neon SAR
The SAR is rendered as a three-layered circle: Core, Inner Glow, and Outer Glow.
Neon Blue represents a Bullish trend, while Neon Orange/Amber represents a Bearish trend.
The transparency of these layers increases as the trend persists (Neon Decay), making the visuals "glow" brightly at the start of a move and fade as it ages.
• Neon Candles
The script includes an optional "Neon Candles" mode. This colors the entire candle body and wick to match the current SAR trend direction.
This provides a cohesive visual experience and reduces the cognitive load required to identify the current market bias.
• Specialized Shapes and Labels
Triangle Up/Down: Small yellow triangles appear on the SAR dots when the "Early Warning" system is active, signaling price proximity to the invalidation point.
Label Up/Down: Bright yellow labels appear below (for buys) or above (for sells) a bar when a "Liquidity Sweep" is detected at the moment of a trend flip.
• Dark-Mode Analytics Dashboard
Located in the top-right corner, the dashboard provides a real-time summary.
Trend State: Displays "BULLISH" or "BEARISH" in high-contrast text.
Entry Trigger: The exact price where the most recent SAR flip occurred.
Target (TP) and Invalidation (SL): Dynamic price levels based on the configured Risk/Reward ratio.
Momentum Bar: A visual power bar (█░) that changes color based on the current momentum score (Green for High, Yellow for Medium, Gray for Low).
MTF Context: Displays "ALIGNED" or "DIVERGED" based on the higher timeframe status.
● 📖 How to Use
Effective utilization of the Smart Filter involves combining the visual signals with the dashboard metrics to form a comprehensive trade thesis.
Identify a Trend Flip: Wait for the Parabolic SAR dots to switch from above the price to below (Bullish) or vice versa (Bearish).
Verify MTF Alignment: Check the dashboard or the MTF Context label. High-probability trades occur when the current timeframe trend matches the Higher Timeframe trend.
Check for Liquidity Sweeps: Look for the yellow "Sweep" labels. A flip that occurs after a liquidity sweep is often more reliable as it indicates a "washout" of weak hands.
Assess Momentum: Before entering, ensure the Momentum Power Bar is at least yellow or green. Low momentum (gray) indicates a lack of conviction in the move.
Set Risk Management: Use the TP and SL levels provided in the dashboard. The Stop Loss is always placed at the SAR level, while the Take Profit is projected based on your preferred Risk/Reward ratio.
Monitor Early Warnings: If the yellow triangles appear on the SAR dots, be prepared for a potential exit or trend shift, as price is encroaching on the SAR invalidation zone.
● ⚙️ Inputs and Settings
The indicator is highly customizable to fit various asset classes and trading styles.
• SAR Logic Group
SAR Start/Increment/Maximum: Controls the sensitivity and "acceleration" of the Parabolic SAR. Lower values make the SAR more trailing and slower, while higher values make it more sensitive to price changes.
Risk/Reward Ratio: Determines the distance of the Take Profit level relative to the distance between the entry price and the SAR stop loss.
ATR Length: Adjusts the window for the volatility calculation used in the Momentum Score.
• Visuals — 3D Neon Group
Neon Up/Down Colors: Allows full customization of the base and glow colors.
Neon Decay Duration: Sets how many bars it takes for the SAR dots to reach their maximum transparency. Longer durations keep the "glow" visible for longer trends.
Enable Bar Coloring: Toggles the neon-colored candle bodies.
• MTF Alignment Group
Higher Timeframe: Select the timeframe used for the trend gate (e.g., if trading on the 15m, you might set this to 1H or 4H).
• Liquidity Sweep Group
Sweep Lookback: The number of preceding bars checked to determine if the reversal occurred after a break of a significant high or low.
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework
The Parabolic SAR Smart Filter is grounded in several quantitative and behavioral finance theories.
• Volatility Normalization (ATR Theory)
The integration of the Average True Range (ATR) to calculate momentum scores is based on the principle of volatility normalization. In financial mathematics, price movement is often "noisy." By dividing the price-to-SAR distance by the ATR, we essentially convert price distance into units of standard volatility. This allows for a more objective comparison of trend strength across different assets regardless of their nominal price or historical volatility.
• Market Microstructure and Liquidity Theory
The liquidity sweep detection logic is an application of Market Microstructure theory, specifically the concept of "Informationless Trades." Large institutional participants often require significant liquidity to enter positions, which is frequently found at levels where retail stop-losses are clustered (just below recent lows or above recent highs). Identifying a "sweep" before a trend reversal aligns the indicator with the concept of "Smart Money" accumulation or distribution.
• Fractal Market Hypothesis (MTF Alignment)
The use of multi-timeframe alignment is supported by the Fractal Market Hypothesis (FMH). FMH suggests that financial markets are fractal in nature and that trends on lower timeframes are nested within larger trends on higher timeframes. By requiring alignment between timeframes, the script seeks to capitalize on the "Self-Similarity" of market trends, increasing the probability that the local move is supported by a larger structural shift.
• Decay Functions and Time-Decay Bias
The Neon Decay visualization applies a linear decay function to the trend's age. This is academically related to the concept of "Trend Maturity Bias," where the probability of a trend continuation decreases (and the variance of price increases) as the trend persists over time. Visualizing this decay provides a non-linear representation of risk that standard technical indicators lack.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. I expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.
Индикатор Pine Script®

