OPEN-SOURCE SCRIPT
Diupdate

TRI - Multi-Timeframe Support and Resistance

224
TRI - MULTI-TIMEFRAME SUPPORT & RESISTANCE v3.0.0

DESCRIPTION:
Advanced multi-timeframe Support & Resistance indicator using ta.pivothigh/ta.pivotlow
to display pivot-based S/R levels from higher timeframes on your current chart.
Features smart pivot positioning, dynamic level merging, and comprehensive alert system.

KEY FEATURES:
  • Multi-timeframe pivot detection using ta.pivothigh/ta.pivotlow on candle body
  • Smart pivot positioning - pivots are placed on the correct candle type (bullish for highs, bearish for lows)
  • Automatic timeframe selection - configure different S/R timeframes for each chart timeframe
  • Dynamic level merging - nearby levels are merged based on ATR tolerance (newer wins)
  • Mitigated level tracking - shows recently broken levels with distinct styling
  • Smart visualization - always shows N closest levels above and below current price
  • Comprehensive alert system with 9 different alert types
  • Significant breakout detection with configurable parameters
  • Memory efficient - automatic cleanup of expired levels


HOW IT WORKS:
The indicator uses ta.pivothigh() and ta.pivotlow() on the selected higher timeframe.
Pivot highs are positioned on bullish candles (using close price).
Pivot lows are positioned on bearish candles (using close price).
If the pivot candle is not the correct type, it searches back up to 5 candles.
Only unbreached levels are displayed as active support/resistance.
When a level is breached, it becomes a "mitigated level" with distinct styling.
Mitigation is checked only after the first candle following the pivot (to avoid false triggers).

LEVEL MERGING:
Nearby levels of the same type are automatically merged based on ATR tolerance.
The newer pivot always wins, replacing older levels within the tolerance range.
Tolerance = HTF ATR × Merge Tolerance setting (default 0.5 ATR).

VISUALIZATION:
The indicator always displays the N closest levels above and below the current price.
Levels are sorted by distance, ensuring the most relevant S/R are always visible.
Active levels show as solid lines, mitigated levels as dashed lines.

ALERT SYSTEM:
  • Breakout (any level) - triggers when any level is broken with coherent candle
  • Breakout Support - triggers when a support level is broken by bearish candle
  • Breakout Resistance - triggers when a resistance level is broken by bullish candle
  • New Pivot (any) - triggers when a new pivot is detected
  • New Pivot Support - triggers when a new support pivot is detected
  • New Pivot Resistance - triggers when a new resistance pivot is detected
  • Significant Breakout (any) - triggers on high-quality breakouts
  • Significant Breakout Support - high-quality support breakout
  • Significant Breakout Resistance - high-quality resistance breakout


SIGNIFICANT BREAKOUT CRITERIA:
A breakout is considered "significant" when:
  • Candle direction is coherent (bearish for support, bullish for resistance)
  • At least X% of the candle body crosses the level (configurable, default 50%)
  • Opposite wick is limited to Y% of candle range (configurable, default 30%)

Example: For a bearish candle breaking support, the upper wick must be small.

TIMEFRAME CONFIGURATION:
Configure different S/R timeframes based on current chart timeframe:
  • 1m-5m charts → Default 4h S/R
  • 15m charts → Default 4h S/R
  • 30m-1h charts → Default 4h S/R
  • 4h charts → Default 4h S/R
  • Daily charts → Default Daily S/R
  • Weekly charts → Default Weekly S/R
  • Monthly charts → Default Monthly S/R

All timeframes are configurable via input settings.

SETTINGS OVERVIEW:
  • Timeframe Configuration - Set S/R timeframe for each chart timeframe
  • Pivot Detection - Max levels, left/right bars, merge tolerance, level extension
  • Mitigation Settings - How long mitigated levels remain visible
  • Visual Settings - Colors, line width, price scale display
  • Significant Breakout - Min body cross %, max opposite wick %
  • Debug - Show pivot detection markers
Catatan Rilis
TRI - MULTI-TIMEFRAME SUPPORT & RESISTANCE v3.1.0

DESCRIPTION:
Advanced multi-timeframe Support & Resistance indicator using ta.pivothigh/ta.pivotlow
to display pivot-based S/R levels from higher timeframes on your current chart.
Features smart pivot positioning, dynamic level merging, retest detection, and comprehensive alert system.

KEY FEATURES:
  • Multi-timeframe pivot detection using ta.pivothigh/ta.pivotlow on candle body
  • Smart pivot positioning - pivots are placed on the correct candle type (bullish for highs, bearish for lows)
  • Automatic timeframe selection - configure different S/R timeframes for each chart timeframe
  • Dynamic level merging - nearby levels are merged based on ATR tolerance (newer wins)
  • Mitigated level tracking - shows recently broken levels with distinct styling
  • Smart visualization - always shows N closest levels above and below current price
  • Retest detection - identifies bounces off S/R levels with configurable parameters
  • Comprehensive alert system with 12 different alert types
  • Significant breakout detection with configurable parameters
  • Memory efficient - automatic cleanup of expired levels


HOW IT WORKS:
The indicator uses ta.pivothigh() and ta.pivotlow() on the selected higher timeframe.
Pivot highs are positioned on bullish candles (using close price).
Pivot lows are positioned on bearish candles (using close price).
If the pivot candle is not the correct type, it searches back up to 5 candles.
Only unbreached levels are displayed as active support/resistance.
When a level is breached, it becomes a "mitigated level" with distinct styling.
Mitigation is checked only after the first candle following the pivot (to avoid false triggers).

LEVEL MERGING:
Nearby levels of the same type are automatically merged based on ATR tolerance.
The newer pivot always wins, replacing older levels within the tolerance range.
Tolerance = HTF ATR × Merge Tolerance setting (default 0.5 ATR).

VISUALIZATION:
The indicator always displays the N closest levels above and below the current price.
Levels are sorted by distance, ensuring the most relevant S/R are always visible.
Active levels show as solid lines, mitigated levels as dashed lines.

RETEST DETECTION:
Detects when price tests a S/R level and bounces back. Two patterns are recognized:
  • Pattern 1: Single candle with long wick touching level and body moving away
  • Pattern 2: Previous candle touches level, current candle is reaction candle

Parameters:
  • ATR Tolerance - How close price must be to level (default 0.3 ATR)
  • Min Wick % - Minimum wick size to confirm rejection (default 30%)

Support retest: bullish bounce (long lower wick or bullish follow-through)
Resistance retest: bearish rejection (long upper wick or bearish follow-through)

ALERT SYSTEM:
  • Breakout (any level) - triggers when any level is broken with coherent candle
  • Breakout Support - triggers when a support level is broken by bearish candle
  • Breakout Resistance - triggers when a resistance level is broken by bullish candle
  • New Pivot (any) - triggers when a new pivot is detected
  • New Pivot Support - triggers when a new support pivot is detected
  • New Pivot Resistance - triggers when a new resistance pivot is detected
  • Significant Breakout (any) - triggers on high-quality breakouts
  • Significant Breakout Support - high-quality support breakout
  • Significant Breakout Resistance - high-quality resistance breakout
  • Retest (any) - triggers when any level is retested
  • Retest Support - triggers when support is retested with bullish bounce
  • Retest Resistance - triggers when resistance is retested with bearish rejection


SIGNIFICANT BREAKOUT CRITERIA:
A breakout is considered "significant" when:
  • Candle direction is coherent (bearish for support, bullish for resistance)
  • At least X% of the candle body crosses the level (configurable, default 50%)
  • Opposite wick is limited to Y% of candle range (configurable, default 30%)

Example: For a bearish candle breaking support, the upper wick must be small.

TIMEFRAME CONFIGURATION:
Configure different S/R timeframes based on current chart timeframe:
  • 1m-5m charts → Default 4h S/R
  • 15m charts → Default 4h S/R
  • 30m-1h charts → Default 4h S/R
  • 4h charts → Default 4h S/R
  • Daily charts → Default Daily S/R
  • Weekly charts → Default Weekly S/R
  • Monthly charts → Default Monthly S/R

All timeframes are configurable via input settings.

SETTINGS OVERVIEW:
  • Timeframe Configuration - Set S/R timeframe for each chart timeframe
  • Pivot Detection - Max levels, left/right bars, merge tolerance, level extension
  • Mitigation Settings - How long mitigated levels remain visible
  • Visual Settings - Colors, line width, price scale display
  • Significant Breakout - Min body cross %, max opposite wick %
  • Retest Detection - ATR tolerance, min wick %
  • Debug - Show pivot/retest detection markers

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.