Aegis Parabolic Pro - Dual Timeframe Trend Alignment SystemWhat the indicator does
-This indicator overlays two independent Parabolic SAR calculations on your chart, each sourced from a separate user-configurable higher timeframe. The first, called the Macro layer, acts as a structural trend filter. The second, called the Micro layer, generates the actual entry-signal circles visible on your chart. A Macro EMA is also plotted from the same higher timeframe, providing a dynamic structural reference within the trend context.
-The core logic is an alignment system: the Micro entry circles are only colored and visible when both the Macro and Micro SAR layers simultaneously agree on direction. When both are bullish, the circles turn green. When both are bearish, they turn red. When the two layers disagree, the Micro circles disappear entirely. This forces discipline -- entries are only highlighted at moments of multi-timeframe structural agreement.
-Each SAR is not the raw classic Parabolic SAR value. An ATR-based offset is applied to each result, shifting the SAR band further from price by a user-defined multiplier of the 14-period Average True Range. This widened band reduces false reversals in volatile conditions while preserving the directional accuracy of the classic algorithm.
How it works
-The Parabolic SAR algorithm tracks an acceleration factor (AF) that starts at a low value and increases each time a new extreme price is set in the current trend direction, up to a configurable maximum. The stop-and-reverse point moves progressively closer to price as momentum builds. When price closes on the wrong side of the SAR level, the trend flips and the AF resets. This produces the characteristic curved trailing stop-and-reverse mechanism that Welles Wilder originally designed in 1978.
-In this indicator the standard formula is extended in two ways. First, all calculations run inside request.security() on higher timeframe datasets -- the SAR is computed entirely on the Macro or Micro timeframe bars before the result is mapped back to your chart. This means the SAR is not computing against the noise of your execution-timeframe candles; it reflects the momentum structure of a higher timeframe. Second, the ATR offset shifts the SAR level further from price: a bullish SAR value is reduced by (ATR14 * multiplier) and a bearish SAR value is increased by the same amount. This creates a buffer zone that absorbs intrabar volatility spikes without triggering false trend flips.
-The directional state of each layer is simply whether the current close sits above or below the Aegis-adjusted SAR level. If close > adjusted SAR, the layer is bullish. If close < adjusted SAR, the layer is bearish. The alignment condition is met when both layers share the same directional state.
-On repainting: all three request.security() calls use exclusively barmerge.lookahead_off. The "Wait for Bar Confirmation" toggle controls whether the SAR and EMA calculations reference the last fully closed bar of their respective timeframe (bar index offset 1) or the current in-progress bar close (offset 0). The offset value is derived from a simple input.bool -- a compile-time constant, not a runtime series -- making it safe to use as a bar offset inside the security context. When the toggle is on, signals never change retroactively. Zero repainting.
What makes it original
-Standard Parabolic SAR is calculated on your current chart timeframe. It reacts to every candle. Applied to a 5-minute or 15-minute chart, the SAR flips constantly and has poor signal quality. This indicator eliminates that problem entirely by computing the SAR on a higher timeframe and projecting it onto your execution chart -- you see the clean momentum structure of a 4-hour or daily SAR while trading on a lower timeframe.
-The ATR multiplier is a second layer of noise filtering on top of the timeframe filter. The raw SAR level is already smoother due to the HTF sourcing; the ATR band makes it further resistant to the kind of intrabar spike that causes classic SAR to generate premature reversals on volatile instruments like crypto or small-cap equities.
-The dual-layer alignment architecture is the primary original contribution. Rather than using a single SAR and filtering it with a separate trend indicator, both the trend filter and the entry signal use the same core algorithm (Parabolic SAR) at different timeframe scales. This produces structural consistency: both layers speak the same language. When they agree, you know both the macro structural momentum and the intermediate-term momentum point in the same direction. The color logic makes this alignment visually immediate -- green circles mean both layers agree up, red circles mean both layers agree down, no circles mean they disagree.
-The color system is fully customizable. The Macro SAR has separate bullish and bearish color inputs (default white/black). The background tint has its own independent bull and bear color inputs, also defaulting to white and black but adjustable without affecting the SAR circles. This means you can set the Macro SAR bullish circles to white while using a custom teal or blue for the bullish background wash -- two independent color systems that can match or contrast as you prefer.
-The built-in trade style reference table provides pre-configured AF and EMA settings for four common trading profiles. This is a practical utility that saves significant manual experimentation and makes the indicator immediately useful to traders unfamiliar with SAR parameter tuning. The table is hidden by default and can be enabled from the Display settings group.
How to use it
-Set your chart to your execution timeframe. Set the Micro timeframe to approximately four to six times your chart timeframe. Set the Macro timeframe to a major structural reference -- Daily is the standard default. The Micro timeframe generates your directional bias confirmation; the Macro timeframe is the filter that qualifies whether that bias is worth acting on.
-Wait for the Micro circles to color. When both layers align and green circles appear below price, that is the bullish entry zone for the current Micro timeframe cycle. When red circles appear above price, that is the bearish entry zone. Use your standard entry trigger (price action, volume, or momentum) to time the actual entry within that zone.
-The Macro EMA provides an additional structural reference. In a bullish alignment, entries taken while price is above the Macro EMA carry higher structural quality than those taken below it.
-For the Macro SAR circles: the bullish color (default white, fully adjustable) appears below price in an uptrend. The bearish color (default black, fully adjustable) appears above price in a downtrend. The background tint independently reinforces these states using its own configurable bull and bear colors -- both are independent from the SAR circle colors. A standard approach is to take only green Micro circles when the background shows the bullish tint, and only red Micro circles when the background shows the bearish tint.
-Alerts: the Bullish Full Alignment and Bearish Full Alignment alerts are the primary signals -- set them to fire on bar close with the confirmation toggle enabled. The four individual layer alerts (Macro and Micro turning bull or bear separately) are secondary warnings, disabled by default to avoid alert fatigue.
Settings
-Wait for Bar Confirmation: When on, all calculations reference the last fully closed bar of each respective timeframe. Prevents signals from changing while a bar is still forming. Strongly recommended for all live alert use.
-Macro Timeframe: The higher timeframe for the structural trend filter. Default Daily. For equity day traders this is appropriate. For crypto swing traders, Weekly is a stronger macro anchor.
-Macro Start AF / Increment AF / Max AF: The three acceleration factor parameters for the Macro Parabolic SAR. Lower values across all three produce a more stable, slower-turning macro filter. The reference table provides preset values for each trading style.
-Macro ATR Multiplier: How far the ATR-based offset shifts the Macro SAR from its raw value. Default 1.5. Raise to 2.0-2.5 for highly volatile markets. Lower to 1.0-1.2 for steadier instruments.
-Micro Timeframe: The intermediate timeframe for entry signals. Default 4H. For 15-minute chart traders, 1H or 4H works well. For 1-hour chart traders, Daily is more appropriate as the Micro layer.
-Micro Start AF / Increment AF / Max AF: Higher start and increment values produce faster, more responsive entry signals. Lower values produce fewer, higher-quality signals.
-Micro ATR Multiplier: Default 1.0. Raise to reduce noise in choppy conditions.
-EMA Length: Period of the Macro EMA. Default 21 on the Daily timeframe tracks the short-term institutional moving average. Common alternatives: 50 for intermediate macro structure, 200 for long-term primary trend.
-Macro SAR Bullish Color: Color of the large Macro SAR circles when the macro trend is bullish. Default white. Independently adjustable from the background bull tint.
-Macro SAR Bearish Color: Color of the large Macro SAR circles when the macro trend is bearish. Default black. Independently adjustable from the background bear tint. Useful when using a light chart theme or a non-standard color scheme.
-Micro SAR Aligned Bullish Color / Bearish Color: Colors of the Micro entry circles during full alignment. These only appear when both layers agree.
-Show Trade Style Table: Hidden by default. Enable to display the parameter reference table in the top-right corner of the chart. The table has a white background with gray headers, purple AF and timeframe values, and dark red EMA values.
-Show Background Tint: The background wash is driven by the Macro SAR state. The bull and bear tint colors are fully independent from the Macro SAR circle colors -- changing one does not affect the other.
-Background Bull Color: Color of the background tint during a bullish Macro SAR state. Default white. Fully independent from the Macro SAR Bullish Color input.
-Background Bear Color: Color of the background tint during a bearish Macro SAR state. Default black. Fully independent from the Macro SAR Bearish Color input.
-Background Tint Transparency: Default 92. Range 85-98 covers subtle-to-visible tinting. Applies equally to both bull and bear background colors.
Markets and timeframes
-Works on all markets: equities, indices, crypto, forex, and commodities. The ATR offset makes it particularly useful on high-volatility instruments where classic Parabolic SAR is prone to excessive whipsaw.
-For intraday scalpers using 1-minute to 5-minute charts: use the Scalping preset from the reference table. Micro timeframe 15-minute, Macro timeframe 1-hour. Best suited to liquid, high-volume instruments during active market sessions where momentum is directional.
-For day traders on 15-minute to 30-minute charts: use the Day Trade preset. Micro 4H, Macro Daily. This is the default configuration and covers the widest range of instruments and market conditions.
-For swing traders holding positions for days to weeks: use the Swing preset. Micro Daily, Macro Weekly. The alignment requirement produces significantly fewer but structurally higher-quality signals.
-For long-term position traders monitoring macro turning points: use the Long Term preset. The indicator becomes a broad structural regime-change detector rather than an entry-timing tool at this scale.
Disclaimer
-Past indicator performance does not guarantee future results. This tool is for informational and educational purposes only and does not constitute financial advice or a trading recommendation. All trading involves risk. Suitable for all markets and all timeframes. Always apply appropriate position sizing, stop-loss management, and risk-reward assessment independent of any indicator signal.
Indicador Pine Script®






















