PROTECTED SOURCE SCRIPT

Support & Resistance Pro

62
Input Configuration: Allows selecting 3 timeframes (TF1 weak, TF2 medium, TF3 strong), show/hide levels, pivot parameters (left/right bars), max levels per TF, duplicate tolerance, max level age, colors, line styles, transparency, and line extension.
Helper Functions: Defines line styles (solid/thin/thick/dashed), widths, and colors with transparency. Calculates seconds per timeframe for time adjustments.
Array Management: Uses arrays to store resistance/support levels, times, lines, and labels per TF and type (resistance/support).
Duplicate Detection: Checks if a new level is similar (within tolerance %) to existing levels in any TF to avoid repetitions.
Level Addition: Adds detected high/low pivots if not duplicates or old; creates dynamic lines and labels; limits to maxLevels by removing oldest.
Data Request: Uses request.security to get high/low pivots in higher timeframes, adjusting pivot times by subtracting left bars.
Update on Each Bar: Extends lines to the right (infinite or specific bars) and moves labels to the chart's end.
Dashboard (Table): On the last bar, creates a table in the top-right corner showing the most recent levels per TF (type, level, % distance to close, age in bars), with corresponding colors. Only shows one level per type/TF (the last one).
Alerts: Generates alert conditions when price crosses over resistance or under support in TF3 (strong); can be extended to other TFs.

In summary, it plots multi-timeframe support/resistance levels based on pivots, manages them dynamically, displays info in a table, and alerts on touches at strong levels.

Pernyataan Penyangkalan

Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.