OPEN-SOURCE SCRIPT
VWAP SAR Magnitude Filter [Gabremoku]

VWAP SAR Magnitude Filter [Gabremoku]
Short description
A state-based long-only trend filter that combines VWAP context with Parabolic SAR structure. It uses VWAP as the main trend and invalidation line, while SAR confirms directional pressure and helps visualize momentum expansion or compression.
Descrizione completa
VWAP SAR Magnitude Filter is a long-only overlay designed to turn two familiar tools, VWAP and Parabolic SAR, into a cleaner operational framework rather than a simple indicator mashup.
The script uses VWAP as the primary market context and invalidation line. When price is above VWAP, the market is treated as having bullish intraday or swing context. When price falls back below VWAP, that context weakens and the script can trigger an exit.
Parabolic SAR is not used here as the primary exit engine. Instead, it acts as a structural confirmation tool. A valid long setup requires price to be above VWAP while SAR remains below the candle, which helps align directional bias and price structure. This reduces the number of signals that would appear if VWAP or SAR were used independently.
The script also includes an Auto mode engine. In Auto mode, lower intraday timeframes are handled with faster behavior, while higher timeframes are treated as swing conditions with additional filters. This makes the indicator adapt its sensitivity without requiring constant manual switching.
In Swing mode, the script becomes more selective by requiring:
persistence of the long condition for a minimum number of bars,
a minimum distance between price and SAR,
confirmed exit behavior below VWAP,
a longer cooldown after exits.
This approach is intended to reduce noise and avoid frequent re-entries during unstable or sideways phases. The indicator is therefore more focused on readable continuation structure than on generating many raw signals.
How it works
Long context: Price above VWAP.
Long confirmation: Parabolic SAR below the candle.
Long entry: The bullish context and structural confirmation align.
Exit logic: Main exit occurs on VWAP fallback; in Swing mode the fallback can require confirmation across multiple bars.
Mode engine: Auto selects Intraday or Swing behavior depending on the chart timeframe.
Visual features
VWAP line as the main reference level.
SAR line and glow for directional structure.
Magnitude fill between price and SAR to visualize pressure expansion and compression.
Optional bar coloring.
Dashboard with State, Mode, Regime, Flow, Distance %, SAR Side, and Exit Logic.
How to use it
This indicator works best when price is developing directional structure away from VWAP. In strong trends, it can help frame cleaner long continuation behavior. In choppy or sideways markets around VWAP, noise is naturally higher because the market lacks clear directional context.
A practical way to use it is:
monitor whether price is holding above VWAP,
wait until SAR is also positioned below price,
use the dashboard to confirm the current regime and state,
treat VWAP fallback as the main warning that the active long structure may be weakening.
Limitations
This indicator is not meant to eliminate all noise, especially in lateral environments where price oscillates around VWAP. In those conditions, repeated context shifts are part of market behavior, so no VWAP-based trend tool can remove all false transitions. The script is designed to reduce that noise, not to make it disappear completely.
It is also a context and structure tool, not a complete trading system. Users should still evaluate market conditions, liquidity, session behavior, and personal risk management before making decisions.
Short description
A state-based long-only trend filter that combines VWAP context with Parabolic SAR structure. It uses VWAP as the main trend and invalidation line, while SAR confirms directional pressure and helps visualize momentum expansion or compression.
Descrizione completa
VWAP SAR Magnitude Filter is a long-only overlay designed to turn two familiar tools, VWAP and Parabolic SAR, into a cleaner operational framework rather than a simple indicator mashup.
The script uses VWAP as the primary market context and invalidation line. When price is above VWAP, the market is treated as having bullish intraday or swing context. When price falls back below VWAP, that context weakens and the script can trigger an exit.
Parabolic SAR is not used here as the primary exit engine. Instead, it acts as a structural confirmation tool. A valid long setup requires price to be above VWAP while SAR remains below the candle, which helps align directional bias and price structure. This reduces the number of signals that would appear if VWAP or SAR were used independently.
The script also includes an Auto mode engine. In Auto mode, lower intraday timeframes are handled with faster behavior, while higher timeframes are treated as swing conditions with additional filters. This makes the indicator adapt its sensitivity without requiring constant manual switching.
In Swing mode, the script becomes more selective by requiring:
persistence of the long condition for a minimum number of bars,
a minimum distance between price and SAR,
confirmed exit behavior below VWAP,
a longer cooldown after exits.
This approach is intended to reduce noise and avoid frequent re-entries during unstable or sideways phases. The indicator is therefore more focused on readable continuation structure than on generating many raw signals.
How it works
Long context: Price above VWAP.
Long confirmation: Parabolic SAR below the candle.
Long entry: The bullish context and structural confirmation align.
Exit logic: Main exit occurs on VWAP fallback; in Swing mode the fallback can require confirmation across multiple bars.
Mode engine: Auto selects Intraday or Swing behavior depending on the chart timeframe.
Visual features
VWAP line as the main reference level.
SAR line and glow for directional structure.
Magnitude fill between price and SAR to visualize pressure expansion and compression.
Optional bar coloring.
Dashboard with State, Mode, Regime, Flow, Distance %, SAR Side, and Exit Logic.
How to use it
This indicator works best when price is developing directional structure away from VWAP. In strong trends, it can help frame cleaner long continuation behavior. In choppy or sideways markets around VWAP, noise is naturally higher because the market lacks clear directional context.
A practical way to use it is:
monitor whether price is holding above VWAP,
wait until SAR is also positioned below price,
use the dashboard to confirm the current regime and state,
treat VWAP fallback as the main warning that the active long structure may be weakening.
Limitations
This indicator is not meant to eliminate all noise, especially in lateral environments where price oscillates around VWAP. In those conditions, repeated context shifts are part of market behavior, so no VWAP-based trend tool can remove all false transitions. The script is designed to reduce that noise, not to make it disappear completely.
It is also a context and structure tool, not a complete trading system. Users should still evaluate market conditions, liquidity, session behavior, and personal risk management before making decisions.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.