Absorption Trap Logic

Absorption Trap Logic finds absorption candles: moves that sweep liquidity on one side, trap traders, and then sweep the other side. It builds them from 1-minute data on a sliding window, so you see every absorption of your chosen timeframe, not only the ones that happen to line up with the chart's candle grid. A pullback zigzag of a higher timeframe can be drawn on top.
═════════════════════════════════════════════════════════════════════════
█ CONCEPT
An absorption candle is a candle that takes out both the High and the Low of the candle it is compared with. Typical trap scenario: price first gives traders "hope" in one direction and sweeps the liquidity above (or below), then reverses sharply, sweeps the opposite side, and closes somewhere inside its own range. The traders who joined the first move are now trapped.
On a regular chart you only see such candles when the sweep happens to fit inside one candle of the grid (:00, :15, :30, :45 on a 15m chart). The same move shifted by a few minutes is split between two candles and stays invisible. Absorption Trap Logic removes this dependence on the grid.
═════════════════════════════════════════════════════════════════════════
█ HOW IT WORKS
1 — Sliding window built from 1-minute data
• The window length equals the selected absorption timeframe in minutes (15m = 15 one-minute bars, 1h = 60, etc.).
• Every minute the last N one-minute bars are merged into one candle and compared with the N bars before them.
• An absorption is confirmed when the merged candle breaks both the High and the Low of the reference by at least the minimum number of ticks. Equal highs/lows are not a sweep.
• After a signal, the next candle is built starting from the following minute, so the next possible signal is at least one window length later and is first compared with the absorption candle itself. This prevents clusters of overlapping signals.
2 — Inside bars and the "mother" window
• Optionally, inside windows are skipped (a window whose High and Low stay within the reference, equality included). The comparison is then made with the mother window, the last one that was not inside.
• Long sequences of inside windows (for example after high-impact news) are handled up to a configurable depth in hours.
3 — Color and sweep order
• The outline color shows the direction of the merged candle: bearish, bullish or doji (close of the last minute vs. open of the first minute).
• The order of the sweeps (high first or low first) is detected from the 1-minute bars and included in alerts.
4 — Mitigation
• Midline: 50% level of a confirmed absorption candle.
• Dim after 50% retest: the candle turns to the "mitigated" color when price returns to its midpoint.
• Dim after full overlap / Hide after full overlap: when price has traded both above the High and below the Low of the candle, it is dimmed or removed from the chart.
5 — Pullbacks of a selected timeframe
• A zigzag of swing points of the selected timeframe (default 1h), drawn on any chart with an equal or lower timeframe.
• Higher-timeframe candles are assembled from chart bars, and each swing point is placed on the exact chart bar where the high or low occurred.
• Include inside bars off: inside bars are skipped and the mother bar remains the reference. On: every bar is used and a reversal needs only a break of the previous bar.
• When a higher-timeframe candle breaks both sides, the order of its high and low is taken from the lower-timeframe bars (or from the candle color when this is not available), so the zigzag follows the real sequence of the move.
• The last leg is drawn live: as soon as the current higher-timeframe candle breaks out, the new leg appears and is updated until that candle closes.
═════════════════════════════════════════════════════════════════════════
█ HOW TO USE
1 — Add the indicator to a chart of 1m or higher.
2 — In Absorption #1 and Absorption #2 choose the absorption timeframes (defaults: 15m and 5m). Each one is shown only on charts with the same or a lower timeframe. On a 1m or 5m chart you will see both, on a 15m chart only the 15m one.
3 — Use Debug mode on a 1m chart to see exactly which minutes were captured and which mother window they were compared with.
4 — Enable Show pullbacks and pick the pullback timeframe to see the higher-timeframe structure on your working chart.
5 — Treat an absorption as a location and context tool (where liquidity was taken on both sides and who may be trapped), not as a standalone entry signal.
═════════════════════════════════════════════════════════════════════════
█ SETTINGS
General
• Min sweep, ticks: how far beyond the reference High/Low price must trade to count as a sweep.
• Bars back to calculate: limits the calculation to the last N chart bars for speed.
• Skip inside bars / Mother bar search depth, hours.
• Draw live: draw the absorption as soon as it forms on the unclosed 1m bar.
Style
• Auto / Box / Brackets. Brackets draw only the High and Low lines so they are not confused with candle wicks on higher timeframes.
• Colors for bearish, bullish and doji candles, fill transparency, mitigated color, debug colors.
Absorption #1 / #2
• Enable, timeframe, line style and width, midline, dim/hide options, debug mode.
Pullbacks
• Show, timeframe, include inside bars, color, style, width, number of lines kept.
═════════════════════════════════════════════════════════════════════════
█ ALERTS
Create an alert with the condition Absorption Trap Logic → Any alert() function call.
• Absorption alerts: one alert per absorption candle, sent either instantly (as soon as it forms) or when the 1m bar closes. The message contains the timeframe, direction, sweep order, window time and the swept levels. Each sweep order can be switched off separately.
• Pullback alerts: when the last swing point appears, is redrawn, or moves to a new high/low (at most once per chart bar).
Alerts use the settings that were active when the alert was created. After changing settings, recreate the alert.
═════════════════════════════════════════════════════════════════════════
█ LIMITATIONS
• Live drawing repaints by design. With Draw live enabled, an absorption detected on an unclosed 1m bar may still change size until that minute closes (it does not disappear: once both sides are swept they stay swept). The live pullback leg can be redrawn or cancelled until the higher-timeframe candle closes. Confirmed absorptions and closed pullback legs do not repaint.
• The indicator relies on 1-minute intrabar data. How much history is available depends on your TradingView plan, so on higher chart timeframes absorptions are only shown for the most recent part of the chart.
• Windows are counted in 1-minute bars, not clock time. On instruments with trading breaks a long window can span more than one session.
• If an absorption window lies exactly inside a single chart bar, nothing is drawn on that chart (the candle itself is the absorption). It is visible on lower timeframes.
• TradingView limits the number of boxes and lines per script (500), so the oldest drawings are removed on long histories.
• Seconds-based charts are not supported.
═════════════════════════════════════════════════════════════════════════
█ NOTES
This script is a visual analysis tool. It does not generate buy or sell recommendations, and no part of it guarantees any trading result. Always combine it with your own analysis and risk management.
═════════════════════════════════════════════════════════════════════════
█ CONCEPT
An absorption candle is a candle that takes out both the High and the Low of the candle it is compared with. Typical trap scenario: price first gives traders "hope" in one direction and sweeps the liquidity above (or below), then reverses sharply, sweeps the opposite side, and closes somewhere inside its own range. The traders who joined the first move are now trapped.
On a regular chart you only see such candles when the sweep happens to fit inside one candle of the grid (:00, :15, :30, :45 on a 15m chart). The same move shifted by a few minutes is split between two candles and stays invisible. Absorption Trap Logic removes this dependence on the grid.
═════════════════════════════════════════════════════════════════════════
█ HOW IT WORKS
1 — Sliding window built from 1-minute data
• The window length equals the selected absorption timeframe in minutes (15m = 15 one-minute bars, 1h = 60, etc.).
• Every minute the last N one-minute bars are merged into one candle and compared with the N bars before them.
• An absorption is confirmed when the merged candle breaks both the High and the Low of the reference by at least the minimum number of ticks. Equal highs/lows are not a sweep.
• After a signal, the next candle is built starting from the following minute, so the next possible signal is at least one window length later and is first compared with the absorption candle itself. This prevents clusters of overlapping signals.
2 — Inside bars and the "mother" window
• Optionally, inside windows are skipped (a window whose High and Low stay within the reference, equality included). The comparison is then made with the mother window, the last one that was not inside.
• Long sequences of inside windows (for example after high-impact news) are handled up to a configurable depth in hours.
3 — Color and sweep order
• The outline color shows the direction of the merged candle: bearish, bullish or doji (close of the last minute vs. open of the first minute).
• The order of the sweeps (high first or low first) is detected from the 1-minute bars and included in alerts.
4 — Mitigation
• Midline: 50% level of a confirmed absorption candle.
• Dim after 50% retest: the candle turns to the "mitigated" color when price returns to its midpoint.
• Dim after full overlap / Hide after full overlap: when price has traded both above the High and below the Low of the candle, it is dimmed or removed from the chart.
5 — Pullbacks of a selected timeframe
• A zigzag of swing points of the selected timeframe (default 1h), drawn on any chart with an equal or lower timeframe.
• Higher-timeframe candles are assembled from chart bars, and each swing point is placed on the exact chart bar where the high or low occurred.
• Include inside bars off: inside bars are skipped and the mother bar remains the reference. On: every bar is used and a reversal needs only a break of the previous bar.
• When a higher-timeframe candle breaks both sides, the order of its high and low is taken from the lower-timeframe bars (or from the candle color when this is not available), so the zigzag follows the real sequence of the move.
• The last leg is drawn live: as soon as the current higher-timeframe candle breaks out, the new leg appears and is updated until that candle closes.
═════════════════════════════════════════════════════════════════════════
█ HOW TO USE
1 — Add the indicator to a chart of 1m or higher.
2 — In Absorption #1 and Absorption #2 choose the absorption timeframes (defaults: 15m and 5m). Each one is shown only on charts with the same or a lower timeframe. On a 1m or 5m chart you will see both, on a 15m chart only the 15m one.
3 — Use Debug mode on a 1m chart to see exactly which minutes were captured and which mother window they were compared with.
4 — Enable Show pullbacks and pick the pullback timeframe to see the higher-timeframe structure on your working chart.
5 — Treat an absorption as a location and context tool (where liquidity was taken on both sides and who may be trapped), not as a standalone entry signal.
═════════════════════════════════════════════════════════════════════════
█ SETTINGS
General
• Min sweep, ticks: how far beyond the reference High/Low price must trade to count as a sweep.
• Bars back to calculate: limits the calculation to the last N chart bars for speed.
• Skip inside bars / Mother bar search depth, hours.
• Draw live: draw the absorption as soon as it forms on the unclosed 1m bar.
Style
• Auto / Box / Brackets. Brackets draw only the High and Low lines so they are not confused with candle wicks on higher timeframes.
• Colors for bearish, bullish and doji candles, fill transparency, mitigated color, debug colors.
Absorption #1 / #2
• Enable, timeframe, line style and width, midline, dim/hide options, debug mode.
Pullbacks
• Show, timeframe, include inside bars, color, style, width, number of lines kept.
═════════════════════════════════════════════════════════════════════════
█ ALERTS
Create an alert with the condition Absorption Trap Logic → Any alert() function call.
• Absorption alerts: one alert per absorption candle, sent either instantly (as soon as it forms) or when the 1m bar closes. The message contains the timeframe, direction, sweep order, window time and the swept levels. Each sweep order can be switched off separately.
• Pullback alerts: when the last swing point appears, is redrawn, or moves to a new high/low (at most once per chart bar).
Alerts use the settings that were active when the alert was created. After changing settings, recreate the alert.
═════════════════════════════════════════════════════════════════════════
█ LIMITATIONS
• Live drawing repaints by design. With Draw live enabled, an absorption detected on an unclosed 1m bar may still change size until that minute closes (it does not disappear: once both sides are swept they stay swept). The live pullback leg can be redrawn or cancelled until the higher-timeframe candle closes. Confirmed absorptions and closed pullback legs do not repaint.
• The indicator relies on 1-minute intrabar data. How much history is available depends on your TradingView plan, so on higher chart timeframes absorptions are only shown for the most recent part of the chart.
• Windows are counted in 1-minute bars, not clock time. On instruments with trading breaks a long window can span more than one session.
• If an absorption window lies exactly inside a single chart bar, nothing is drawn on that chart (the candle itself is the absorption). It is visible on lower timeframes.
• TradingView limits the number of boxes and lines per script (500), so the oldest drawings are removed on long histories.
• Seconds-based charts are not supported.
═════════════════════════════════════════════════════════════════════════
█ NOTES
This script is a visual analysis tool. It does not generate buy or sell recommendations, and no part of it guarantees any trading result. Always combine it with your own analysis and risk management.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.