SCAN (LAST BAR): VMA + MACD + TTM OrangeScreener will identify stocks that price has crossed the VMA and the MACD has crossed the moving average in a positive direction as well as currently have a squeeze ocurringPine Script®指标由smiley1963提供1
SCAN: VMA + MACD + TTM OrangeThis is a screener for identifying stocks that have met the following criteria. Price has crossed VMA. The MACD has crossed over MA in a positive direction and the TTM indicator is indicating a squeezePine Script®指标由smiley1963提供0
Stop Getting Whipsawed. Meet Fimathe Elite V40 (State Machine LoThe trader's biggest enemy isn't the market—it's indecision and market noise. "Should I enter now?", "The price pulled back, should I exit or hold?". To solve this, I developed Fimathe Elite V40. This is not just a simple indicator; it is a complete Trade Management System based on the renowned Fimathe technique (Reference Channels & Neutral Zones), but armored with institutional-grade algorithms to filter out fake signals. 💡 WHY IS THIS SCRIPT DIFFERENT? Most indicators repaint or spam "Sell" signals the moment a candle turns red, even during a healthy bullish pullback. Fimathe Elite V40 solves this using a sophisticated State Machine Engine. 1. The "State Machine" Technology (No Noise): The script has "memory". It knows if you are already positioned. Silence: If you are in a trade, it ignores minor fluctuations. It will NOT spam new signals during a consolidation. Action: It only alerts you in two specific scenarios: Profit Expansion (Level Breakout) or True Reversal (Close against the Stop Loss). 2. Smart Trend Detection (Linear Regression): Instead of guessing the trend, the script calculates the mathematical slope of the last X bars using Linear Regression. If the slope is positive = It creates Bullish Channels (Reference Channel on Top). If the slope is negative = It creates Bearish Channels (Reference Channel on Bottom). This prevents you from trading against the mathematical flow of the market. 3. Visual Trade Management: Active Stop Loss (Orange Line): A visual floor/ceiling that trails the price. If the price does not close beyond this line, you stay in the trade, ignoring emotional wicks. Active Target (Green Line): Shows exactly where the next expansion level is. Full Grid: Automatically projects Level 1, 2, and 3 for roadmap planning. 🚀 HOW TO TRADE: Wait for the Map: Let the script draw the CR (Reference Channel) and NZ (Neutral Zone) automatically (it skips the volatile opening minutes). The Signal: Wait for the "BUY (Breakout)" or "SELL (Breakout)" label. This signal appears on the close of the breakout candle. The Entry: Enter on the violation of that candle's high/low. The Ride: Follow the Orange Line. As the price conquers new levels, the Stop Loss automatically moves up (Trailing Stop) to lock in profits. 🛡️ Risk Management: This tool is designed to force discipline. It visually shows you that a pullback is not a reversal, keeping you in the trend longer and getting you out immediately when the structure actually breaks.Pine Script®指标由valeriosilva1提供26
Weighted NIFTY 5D Directional BreadthOverview This indicator measures market participation quality within the NIFTY index by tracking how many heavily-weighted stocks are contributing to index direction over a rolling 5-day period. Instead of counting simple up/down closes, it evaluates directional momentum × index weight, making it far more reliable for identifying narrow leadership, distribution, and late-stage rallies. Why this indicator matters Indexes can continue making higher highs even when only a few large stocks are doing the lifting. This tool reveals what price alone hides: Whether participation is broad or narrowing When index highs are being driven by fewer contributors Early warnings of fragility before corrections How it works Each selected NIFTY stock is assigned a weight approximating index influence The indicator checks whether each stock is up or down versus its 5-day close Directional signals are weighted and aggregated The result is a single breadth line reflecting true contribution strength Positive values → weighted participation is supportive Negative values → weighted drag beneath the index How to interpret Index Higher High + Indicator Lower High → Narrow leadership, distribution risk Indicator turns down before price → Early loss of momentum Sustained positive readings → Healthy, broad participation Sustained negative readings → Market weakness beneath the surface This is not a buy/sell signal, but a context and risk-assessment tool. Best use cases Identifying late-stage rallies Confirming or rejecting breakouts Risk management for index trades Combining with price structure or momentum indicators Notes Designed for Daily and higher timeframes Uses non-repainting logic Best used alongside price action and structure Disclaimer This indicator is intended for educational and analytical purposes only. It does not provide financial advice or trade recommendations.Pine Script®指标由ImpulseBull提供3
LongToken SMC: No-BE Edition + Pro Stats v3LongToken SMC: 3TP No-BE Edition + Pro Stats v3 is a high-end trading indicator built on the Smart Money Concept (SMC), focusing on market structure, liquidity, and the behavior of large money flows. The indicator automatically identifies high-probability trading setups and clearly displays Entry – Stop Loss – 3 Take Profits, optimized for the No Break-Even (No-BE) strategy to avoid premature breakouts due to market noise. Key Features 📌 Standard SMC Entry: Based on institutional price structure and cash flow 🎯 3 Fixed Take Profits: Targeting liquidity zones & price imbalances (IMB/FVG) 🛑 No Break-Even: Keeps orders logically in place, avoiding unnecessary stop-loss sweeps ⚖️ Optimal Risk Management: Reasonable R:R, enhancing long-term profit expectations 🔍 Clean and Easy-to-Read Interface: Focuses on Price Action, avoiding distractions Suitable for Price Action & SMC Traders Traders who want clear order entry and disciplined order management Traders who prioritize accuracy and consistency over placing many orders Traders who follow structure – hold orders based on cash flow – profit is a consequence.Pine Script®指标由Thotrader6868提供1
Adaptive EMA (Momentum Entry & Crash Protection)This script is the result of extensive backtesting to find the perfect balance between capturing high-volume momentum and protecting capital during market crashes. It is not just a standard EMA crossover; it is a fine-tuned trend-following system designed for maximum profit margins. 🚀 KEY OPTIMIZATIONS: 1. Adaptive Logic (Auto-Switching): The script automatically detects your timeframe and applies the most effective parameters: • Intraday (≤ 4H): Uses EMA 9 & 21. This classic setup is perfect for filtering noise in short-term trading. • Swing/Long-Term (> 4H): Uses EMA 7 & 14. *CRITICAL UPDATE:* After testing, the 7/14 combination proved to offer higher profit margins than the traditional 7/21. It reacts faster to major trend reversals, allowing you to lock in profits sooner before a dump. 2. Professional Visuals: • Fast Line (Gold - 1px): Represents the immediate momentum. • Slow Line (Deep Blue - 2px): Represents the baseline trend. • Glow Effect: A subtle white border ensures the lines remain visible even on dark charts. • Clean Chart Policy: Gradient background signals are included but *disabled by default* to keep your workspace clutter-free. You can enable them in the settings if you prefer visual zones. 💎 HOW TO TRADE: • Entry (Pump): When the Gold line crosses ABOVE the Blue line. This indicates a surge in volume and upward momentum. • Exit (Protection): When the Gold line crosses BELOW the Blue line. This is your signal to exit and protect your gains before the price collapses. No manual configuration is needed. Just add it to your chart, and it adapts instantly.Pine Script®指标由andrewnguyen93提供已更新 1
Adaptive EMA (Momentum Entry & Crash Protection)This script is the result of extensive backtesting to find the perfect balance between capturing high-volume momentum and protecting capital during market crashes. It is not just a standard EMA crossover; it is a fine-tuned trend-following system designed for maximum profit margins. 🚀 KEY OPTIMIZATIONS: 1. Adaptive Logic (Auto-Switching): The script automatically detects your timeframe and applies the most effective parameters: • Intraday (≤ 4H): Uses EMA 9 & 21. This classic setup is perfect for filtering noise in short-term trading. • Swing/Long-Term (> 4H): Uses EMA 7 & 14. *CRITICAL UPDATE:* After testing, the 7/14 combination proved to offer higher profit margins than the traditional 7/21. It reacts faster to major trend reversals, allowing you to lock in profits sooner before a dump. 2. Professional Visuals: • Fast Line (Gold - 1px): Represents the immediate momentum. • Slow Line (Deep Blue - 2px): Represents the baseline trend. • Glow Effect: A subtle white border ensures the lines remain visible even on dark charts. • Clean Chart Policy: Gradient background signals are included but *disabled by default* to keep your workspace clutter-free. You can enable them in the settings if you prefer visual zones. 💎 HOW TO TRADE: • Entry (Pump): When the Gold line crosses ABOVE the Blue line. This indicates a surge in volume and upward momentum. • Exit (Protection): When the Gold line crosses BELOW the Blue line. This is your signal to exit and protect your gains before the price collapses. No manual configuration is needed. Just add it to your chart, and it adapts instantly.Pine Script®指标由andrewnguyen93提供6
Index Relative Strenght + VixCompara fortaleza y debilidad entre los principales indices, sus sectores y la tendencia del VIX. Pine Script®指标由vidaestudiantil0103提供5
Quantum Ribbon Pro - BacktesterQuantum Ribbon Pro - Backtester Official backtesting tool for the Quantum Ribbon Pro indicator. Test the indicator's performance with historical data across any market and timeframe. 📋 What Is This? A backtesting tool designed to validate Quantum Ribbon Pro signals through historical analysis. Use it to: Test signals on historical data Evaluate risk management settings Assess signal quality across different markets Test entry/exit strategies before live trading ⚙️ Features Signal Generation - Trending signals with EMA + momentum confirmation - Ribbon Bounce signals for pullback entries - Signal Sensitivity control (1-10) - Signal Cooldown system - Confidence scoring (1-8 scale) Signal Filters - TP RSI Confirmation (all 5 ribbon pairs must align) - Higher Timeframe Filter (15min to Weekly) - S/R Auto-Detection (only trade at key levels) - Quantum Range Filter (avoid choppy markets) - Trading Hours Filter (restrict to specific sessions) - Weekend alerts toggle S/R Auto-Detection - Automatic Support/Resistance detection via pivot points - Longs only near support, shorts only near resistance - Adjustable strength: Weak/Normal/Strong - Customizable touch zone (0.1-5.0%) - Optional visual zones display Exit Management - Ribbon Flip Exit (exits when ribbon flips against position) - Adjustable flip sensitivity (1-5) - Automatic position closure on reversal Stop Loss Methods - ATR-based (adapts to volatility) - Fixed percentage (0.5-10%) - Swing points (recent highs/lows with buffer) - Adjustable distance: Tight/Normal/Wide Take Profit System - Single target: 1.5R / 2R / 3R - Partial Take-Profits (enabled by default): - TP1: 50% @ 1.5R - TP2: 30% @ 2R - Final: 20% @ 2.5R - Break-even stop (triggered after TP1, TP2, or custom R:R) Risk Management - Position sizing - Realistic commissions - Slippage modeling - Max drawdown tracking - Win rate & profit factor metrics Alerts - Entry alerts (Long/Short) - Entry @ S/R alerts (when S/R filter active) - TP1/TP2 hit alerts - Break-even move alerts - Message formats: Simple/Detailed/JSON/Custom - Template system with placeholders ({{ticker}}, {{entry}}, {{stop}}, {{tp}}, {{direction}}, {{confidence}}, {{atr}}, {{rr}}) - Webhook-ready JSON format Customization - Ribbon settings (custom EMA ranges and pair widths) - Alert message templates - Session-based trading hours - Weekend trading control 🚀 Quick Start Add the backtester to your chart with price action Default Settings Signal Settings: - Signal Sensitivity: 5 - S/R Auto-Detection: Optional - Ribbon Flip Exit: Optional Risk Management: - Stop Method: ATR - Stop Distance: Normal (2.0x ATR) - Take Profit: 2R Partial Take-Profits: Enabled - TP1: 50% @ 1.5R - TP2: 30% @ 2R - Final: 20% @ 2.5R Review Results Check win rate, profit factor, and max drawdown in the strategy report 💡 Usage Notes Testing Approach: Start with default settings Test on your market/timeframe Adjust based on results Validate across multiple time periods ⚠️ Important Past performance doesn't guarantee future results. Validate on multiple markets and timeframes. Use proper position sizing.Pine Script®策略由TrendlineProject提供18
Ker 2021 EMA/SMA這個腳本主要是EMA/SMA的基礎 加上可調動範圍 數字可以調動 但是因為我不是coding人員 所以有些欄位編排不正確 但是使用上沒有什麼問題 如果你有coding的能力 可以聯絡我 幫我補正 謝謝 This script is mainly based on EMA/SMA, with adjustable ranges and parameters. The values can be modified freely. Since I’m not a programmer, some of the field formatting may not be perfectly structured. However, it works fine in actual use. If you have coding experience and would like to help improve or clean up the code, feel free to contact me. Thank you.Pine Script®指标由Icykerker提供14
SWEEP HTF CANDLE - BY LIONLEE - 0792281999// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org // © CandelaCharts //@version=6 indicator("CandelaCharts - HTF Sweeps", shorttitle = "CandelaCharts - HTF Sweeps", overlay = true, max_lines_count = 500, max_labels_count = 500, max_boxes_count = 500, max_bars_back = 500, max_polylines_count = 100) // # ========================================================================= # // # | Colors | // # ========================================================================= # //#region // # Core -------------------------------------------------------------------- # colors_white = color.white colors_black = color.black colors_purple = color.purple colors_red = color.red colors_gray = color.gray colors_blue = color.blue colors_orange = color.orange colors_green = color.green color_transparent = #ffffff00 //#endregion // # ========================================================================= # // # | End | // # ========================================================================= # // # ========================================================================= # // # | Inputs | // # ========================================================================= # //#region // # General ----------------------------------------------------------------- # general_font = input.string("Monospace", "Text ", options = , inline = "1.0", group = "General") general_text = input.string("Tiny", "", options = , inline = "1.0", group = "General") general_brand_show = input.bool(false, "Hide Brand", group = "General") htf_sweeps_tf_1_show = input.bool(true, "HTF I ", inline = "1.0", group = "Timeframes") htf_sweeps_tf_1_tf = input.timeframe("15", "", inline = "1.0", group = "Timeframes") htf_sweeps_tf_1_number = input.int(10, "", inline = "1.0", group = "Timeframes", minval = 1, maxval = 60) htf_sweeps_tf_1_map = input.bool(false, "M", inline = "1.0", group = "Timeframes", tooltip = "Map this HTF to LTF") htf_sweeps_tf_2_show = input.bool(true, "HTF II ", inline = "2.0", group = "Timeframes") htf_sweeps_tf_2_tf = input.timeframe("60", "", inline = "2.0", group = "Timeframes") htf_sweeps_tf_2_number = input.int(8, "", inline = "2.0", group = "Timeframes", minval = 1, maxval = 60) htf_sweeps_tf_2_map = input.bool(true, "M", inline = "2.0", group = "Timeframes") htf_sweeps_tf_3_show = input.bool(true, "HTF III ", inline = "3.0", group = "Timeframes") htf_sweeps_tf_3_tf = input.timeframe("240", "", inline = "3.0", group = "Timeframes") htf_sweeps_tf_3_number = input.int(6, "", inline = "3.0", group = "Timeframes", minval = 1, maxval = 60) htf_sweeps_tf_3_map = input.bool(false, "M", inline = "3.0", group = "Timeframes") htf_sweeps_tf_4_show = input.bool(true, "HTF IV ", inline = "4.0", group = "Timeframes") htf_sweeps_tf_4_tf = input.timeframe("1D", "", inline = "4.0", group = "Timeframes") htf_sweeps_tf_4_number = input.int(4, "", inline = "4.0", group = "Timeframes", minval = 1, maxval = 60) htf_sweeps_tf_4_map = input.bool(false, "M", inline = "4.0", group = "Timeframes") htf_sweeps_tf_5_show = input.bool(true, "HTF V ", inline = "5.0", group = "Timeframes") htf_sweeps_tf_5_tf = input.timeframe("1W", "", inline = "5.0", group = "Timeframes") htf_sweeps_tf_5_number = input.int(2, "", inline = "5.0", group = "Timeframes", minval = 1, maxval = 60) htf_sweeps_tf_5_map = input.bool(false, "M", inline = "5.0", group = "Timeframes") htf_sweeps_tf_6_show = input.bool(false, "HTF VI ", inline = "6.0", group = "Timeframes") htf_sweeps_tf_6_tf = input.timeframe("1M", "", inline = "6.0", group = "Timeframes") htf_sweeps_tf_6_number = input.int(1, "", inline = "6.0", group = "Timeframes", minval = 1, maxval = 60) htf_sweeps_tf_6_map = input.bool(false, "M", inline = "6.0", group = "Timeframes") htf_sweeps_bull_color = input.color(colors_green, "Coloring ", inline = "1.0", group = "HTF") htf_sweeps_bear_color = input.color(colors_black, "", inline = "1.0", group = "HTF") htf_sweeps_wick_border_color = input.color(colors_black, "", inline = "1.0", group = "HTF") htf_sweeps_offset = input.int(10, "Offset ", minval = 1, inline = "2.0", group = "HTF", tooltip = "The distance from the current chart candles.") htf_sweeps_space = input.int(1, "Space ", minval = 1, inline = "3.0", maxval = 4, group = "HTF", tooltip = "Space between candles") htf_sweeps_margin = input.int(10, "Margin ", minval = 1, inline = "4.0", group = "HTF", tooltip = "The distance between HTF group candles.") htf_sweeps_candle_width = input.string("Small", "Size ", inline = "5.0", group = "HTF", options = , tooltip = "Candle size") htf_sweeps_label_show = input.bool(true, "Labels ", inline = "6.0", group = "HTF") htf_sweeps_label_size = input.string("Large", "", inline = "6.0", group = "HTF", options = ) htf_sweeps_label_position = input.string("Top", "", inline = "6.0", group = "HTF", options = , tooltip = " - Size of the label - Position of the label - Text color of the label") htf_sweeps_label_color = input.color(colors_black, "", inline = "6.0", group = "HTF") // htf_sweeps_bias_show = input.bool(true, "Bias ", inline = "6.0", group = "HTF") // htf_sweeps_bias_bull_color = input.color(colors_green, "", inline = "6.0", group = "HTF") // htf_sweeps_bias_bear_color = input.color(colors_red, "", inline = "6.0", group = "HTF") // htf_sweeps_time_show = input.bool(true, "Time ", inline = "7.0", group = "HTF") // htf_sweeps_time_color = input.color(colors_gray, "", inline = "7.0", group = "HTF") htf_sweeps_ltf_trace_h_l_show = input.bool(true, "H/L Line ", inline = "1.0", group="LTF") htf_sweeps_ltf_trace_h_l_style = input.string('····', '', options = , inline = "1.0", group="LTF") htf_sweeps_ltf_trace_h_l_width = input.int(1, '', inline = "1.0", minval = 0, maxval = 4, group="LTF") htf_sweeps_ltf_trace_h_l_color = input.color(color.new(colors_gray, 50), "", inline = "1.0", group="LTF") htf_sweeps_ltf_trace_o_c_line_show = input.bool(true, "O/C Line ", inline = "2.0", group = "LTF") htf_sweeps_ltf_trace_o_c_line_style = input.string('⎯⎯⎯', "", options = , inline = "2.0", group = "LTF") htf_sweeps_ltf_trace_o_c_line_width = input.int(1, '', inline = "2.0", minval = 0, maxval = 4, group = "LTF") htf_sweeps_ltf_trace_o_c_line_color = input.color(color.new(colors_gray, 50), "", inline = "2.0", group = "LTF") htf_sweeps_sweep_show = input.bool(true, "Sweep ", inline = "1.0", group = "Sweep") htf_sweeps_sweep_ltf_show = input.bool(true, "LTF ", inline = "1.0", group = "Sweep") htf_sweeps_sweep_htf_show = input.bool(true, "HTF", inline = "1.0", group = "Sweep", tooltip = "Show sweeps. - Show sweeps on LTF. - Show sweeps on HTF.") htf_sweeps_sweep_line_style = input.string('⎯⎯⎯', " ", options = , inline = "1.1", group = "Sweep") htf_sweeps_sweep_line_width = input.int(1, '', inline = "1.1", group = "Sweep") htf_sweeps_sweep_line_color = input.color(colors_black, "", inline = "1.1", group = "Sweep") htf_sweeps_i_sweep_show = input.bool(false, "I-sweep ", inline = "2.0", group = "Sweep") htf_sweeps_i_sweep_ltf_show = input.bool(true, "LTF ", inline = "2.0", group = "Sweep") htf_sweeps_i_sweep_htf_show = input.bool(true, "HTF", inline = "2.0", group = "Sweep", tooltip = "Show invalidated sweeps. - Show invalidated sweeps on LTF. - Show invalidated sweeps on HTF.") htf_sweeps_i_sweep_line_style = input.string('----', " ", options = , inline = "2.1", group = "Sweep") htf_sweeps_i_sweep_line_width = input.int(1, '', inline = "2.1", group = "Sweep") htf_sweeps_i_sweep_line_color = input.color(colors_gray, "", inline = "2.1", group = "Sweep") htf_sweeps_real_time_sweep_show = input.bool(false, "Real-time", inline = "3.0", group = "Sweep", tooltip = "Control visibility of Real-time Sweeps on LTF and HTF") // htf_sweeps_dashboard_info_show = input.bool(true, "Panel ", inline = "1.0", group = "Dashboard") // htf_sweeps_dashboard_info_position = input.string("Bottom Center", "", options = , inline = "1.0", group = "Dashboard", tooltip = "The dashboard will display only the HTF that is mapped to LTF") htf_sweeps_alerts_sweep_formation = input.bool(false, "Sweep Formation", inline = "1.0", group = "Alerts") htf_sweeps_alerts_sweep_invalidation = input.bool(false, "Sweep Invalidation", inline = "2.0", group = "Alerts") //#endregion // # ========================================================================= # // # | End | // # ========================================================================= # // # ========================================================================= # // # | UDTs | // # ========================================================================= # //#region type UDT_Store line bin_ln box bin_box label bin_lbl polyline bin_polyline type UDT_Sweep string tf int x1 float y int x2 bool bull // sweep is invalidated bool invalidated = false // id of htf candle, that invalidated sweep int invalidated_on // if sweep is invalidated on candle that forms a sweep, then sweep will be removed bool removed = false // mark sweep as formed after last candle that forms a sweep is closed and sweep was not invalidated bool formed = false type UDT_HTF_Candle int num int index string tf // real coordinates of HTF candle float o float c float h float l int o_idx int c_idx int h_idx int l_idx int ot int ct // position of HTF candle on chart int candle_left int candle_rigth float candle_top float candle_bottom int wick_x int shift bool is_closed array htf_sweeps array ltf_sweeps bool bull bool bull_sweep bool bear_sweep //#endregion // # ========================================================================= # // # | End | // # ========================================================================= # // # ========================================================================= # // # | Bin | // # ========================================================================= # //#region var UDT_Store bin = UDT_Store.new( bin_ln = array.new() , bin_box = array.new() , bin_lbl = array.new() , bin_polyline = array.new() ) method clean_bin(UDT_Store store) => for obj in store.bin_ln obj.delete() for obj in store.bin_box obj.delete() for obj in store.bin_lbl obj.delete() for obj in store.bin_polyline obj.delete() store.bin_ln.clear() store.bin_box.clear() store.bin_lbl.clear() store.bin_polyline.clear() //#endregion // # ========================================================================= # // # | End | // # ========================================================================= # // # ========================================================================= # // # | Functions | // # ========================================================================= # //#region method text_size(string size) => out = switch size "Tiny" => size.tiny "Small" => size.small "Normal" => size.normal "Large" => size.large "Huge" => size.huge "Auto" => size.auto out method line_style(string style) => out = switch style '⎯⎯⎯' => line.style_solid '----' => line.style_dashed '····' => line.style_dotted method font_style(string font) => out = switch font 'Default' => font.family_default 'Monospace' => font.family_monospace method candle_size(string size) => out = switch size 'Tiny' => 2 'Small' => 4 'Medium' => 6 'Large' => 8 'Huge' => 10 out method tf_label(string tf) => tfl = tf if tfl == '' tfl := timeframe.period out = switch tfl '1' => '1m' '2' => '2m' '3' => '3m' '5' => '5m' '10' => '10m' '15' => '15m' '20' => '20m' '30' => '30m' '45' => '45m' '60' => '1H' '90' => '90m' '120' => '2H' '180' => '3H' '240' => '4H' '480' => '8H' '540' => '9H' '720' => '12H' => tfl out const string default_tz = "America/New_York" var string htf_sweeps_tz = default_tz get_short_dayofweek(int d) => switch d dayofweek.monday => 'MON' dayofweek.tuesday => 'TUE' dayofweek.wednesday => 'WED' dayofweek.thursday => 'THU' dayofweek.friday => 'FRI' dayofweek.saturday => 'SAT' dayofweek.sunday => 'SUN' => '' get_week_of_month(int t) => y = year(t) m = month(t) d = dayofmonth(t) // Timestamp of first day of the same month firstDay = timestamp(y, m, 1, 0, 0) // Day of month index starting from 0 → (0–30) dayIndex = d - 1 // Week index starting from 0 → (0–4) weekIndex = int(dayIndex / 7) // Week number starting from 1 → (1–5) str.tostring(weekIndex + 1) get_short_month(int t) => var string months = array.from( "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC") m = month(t) m >= 1 and m <= array.size(months) ? array.get(months, m - 1) : "" method candle_time_label(UDT_HTF_Candle candle) => string lbl = "" if timeframe.in_seconds(candle.tf) >= timeframe.in_seconds("12M") lbl := str.format_time(candle.ot, "yyyy", htf_sweeps_tz) else if timeframe.in_seconds(candle.tf) >= timeframe.in_seconds("1M") lbl := get_short_month(candle.ot) else if timeframe.in_seconds(candle.tf) >= timeframe.in_seconds("1W") lbl := get_week_of_month(candle.ot) else if timeframe.in_seconds(candle.tf) >= timeframe.in_seconds("1D") // Get date components in the selected timezone y = year(candle.ot, htf_sweeps_tz) m = month(candle.ot, htf_sweeps_tz) d = dayofmonth(candle.ot, htf_sweeps_tz) // Create timestamp at noon for that date in the selected timezone (using noon to avoid timezone edge cases) date_ts = timestamp(htf_sweeps_tz, y, m, d, 12, 0, 0) // Add 1 day to account for timezone offset date_ts := date_ts + 86400000 // Get day of week for that date lbl := get_short_dayofweek(dayofweek(date_ts, htf_sweeps_tz)) else lbl := str.format_time(candle.ot, "HH:mm", htf_sweeps_tz) lbl // Returns formatted remaining time until current HTF candle close. // Format: " HH:MM:SS" get_htf_remaining_time(int from, string tf, string ses, string tz) => ct = time_close(tf, ses, na(tz) ? "" : tz) if na(ct) or na(from) "" else // Remaining time in ms (clamped to 0 so it never goes negative) remaining_ms = math.max(ct - from, 0) // Total whole seconds remaining remaining_sec = int(remaining_ms / 1000) // Unit constants (seconds) sec_per_min = 60 sec_per_hour = 60 * sec_per_min sec_per_day = 24 * sec_per_hour sec_per_month = 30 * sec_per_day sec_per_year = 365 * sec_per_day // Break down into Y / M / D / H / M / S (all ints) years = int(remaining_sec / sec_per_year) rem_after_years = remaining_sec % sec_per_year months = int(rem_after_years / sec_per_month) rem_after_months = rem_after_years % sec_per_month days = int(rem_after_months / sec_per_day) rem_after_days = rem_after_months % sec_per_day hours = int(rem_after_days / sec_per_hour) rem_after_hours = rem_after_days % sec_per_hour minutes = int(rem_after_hours / sec_per_min) seconds = rem_after_hours % sec_per_min // Only show non-zero units year_str = years > 0 ? str.format("{0}Y ", str.tostring(years, "#")) : "" month_str = months > 0 ? str.format("{0}M ", str.tostring(months, "#")) : "" day_str = days > 0 ? str.format("{0}D ", str.tostring(days, "#")) : "" time_str = str.format("{0}:{1}:{2}", str.tostring(hours, "00"), str.tostring(minutes, "00"), str.tostring(seconds, "00")) year_str + month_str + day_str + time_str //#endregion // # ========================================================================= # // # | End | // # ========================================================================= # // # ========================================================================= # // # | Variables | // # ========================================================================= # //#region var ltf = timeframe.period var htf_1_candles = array.new() var htf_2_candles = array.new() var htf_3_candles = array.new() var htf_4_candles = array.new() var htf_5_candles = array.new() var htf_6_candles = array.new() var htf_candle_width = candle_size(htf_sweeps_candle_width) //#endregion // # ========================================================================= # // # | End | // # ========================================================================= # // # ========================================================================= # // # | Alert Methods | // # ========================================================================= # //#region method enable_sweep_formed_alert(UDT_Sweep sweep) => if not na(sweep) and htf_sweeps_alerts_sweep_formation if not sweep.invalidated if sweep.bull alert(str.format("Bullish HTF Sweep ({0}) formed on {1}. Price level {2, number, currency}", tf_label(sweep.tf), syminfo.ticker, sweep.y)) else alert(str.format("Bearish HTF Sweep ({0}) formed on {1}. Price level {2, number, currency}", tf_label(sweep.tf), syminfo.ticker, sweep.y)) sweep method enable_sweep_invalidated_alert(UDT_Sweep sweep) => if not na(sweep) and htf_sweeps_alerts_sweep_invalidation if not sweep.invalidated if sweep.bull alert(str.format("Bullish HTF Sweep ({0}) invalidated on {1}. Price level {2, number, currency}", tf_label(sweep.tf), syminfo.ticker, sweep.y)) else alert(str.format("Bearish HTF Sweep ({0}) invalidated on {1}. Price level {2, number, currency}", tf_label(sweep.tf), syminfo.ticker, sweep.y)) sweep //#endregion // # ========================================================================= # // # | End | // # ========================================================================= # // # ========================================================================= # // # | HTF Sweeps | // # ========================================================================= # //#region method session_begins(string tf, string ses, string tz) => ta.change(time(tf, ses, na(tz) ? "" : tz))!= 0 method in_session(string tf, string ses, string tz) => t = time(tf, ses, na(tz) ? "" : tz) ct = time_close(tf, ses, na(tz) ? "" : tz) not na(t) and not na(ct) method position_ltf_sweeps(array htf_candles) => count = htf_candles.size() if count == 1 candle = htf_candles.get(0) for in candle.ltf_sweeps sweep.x2 := candle.c_idx if count >= 2 candle = htf_candles.get(1) next_candle = htf_candles.get(0) for in candle.ltf_sweeps sweep.x2 := next_candle.c_idx htf_candles method position_htf_sweeps(array htf_candles, int buffer) => count = htf_candles.size() if count > 1 c_last = htf_candles.get(0) for in htf_candles for in candle.htf_sweeps sweep.x2 := c_last.candle_rigth + buffer sweep.x1 := candle.wick_x htf_candles method invalidate_sweep(UDT_Sweep sweep, UDT_HTF_Candle c2) => c2_bull = c2.bull // if body of next candle cross sweep invalidated = not na(sweep.y) and (sweep.bull ? (c2_bull ? sweep.y < c2.c : sweep.y < c2.o) : (c2_bull ? sweep.y > c2.o : sweep.y > c2.c)) invalidated method invalidate_sweeps(array htf_candles) => count = htf_candles.size() if count > 1 for i = count - 1 to 1 c1 = htf_candles.get(i) for in c1.ltf_sweeps if not sweep.removed and na(sweep.invalidated_on) for k = i - 1 to 0 c2 = htf_candles.get(k) htf_sweep = c1.htf_sweeps.get(j) invalidated = sweep.invalidate_sweep(c2) // invalidation by candle of sweep if sweep.x2 <= c2.c_idx and sweep.x2 > c2.o_idx if not c2.is_closed if not sweep.invalidated and htf_sweeps_real_time_sweep_show sweep.enable_sweep_invalidated_alert() sweep.invalidated := invalidated htf_sweep.invalidated := sweep.invalidated else if invalidated and na(sweep.invalidated_on) sweep.invalidated_on := invalidated ? c2.o_idx : na htf_sweep.invalidated_on := sweep.invalidated_on break else if na(sweep.invalidated_on) // invalidation by the next candle if not c2.is_closed if not sweep.invalidated and htf_sweeps_real_time_sweep_show sweep.enable_sweep_invalidated_alert() sweep.invalidated := invalidated htf_sweep.invalidated := sweep.invalidated else if invalidated if not sweep.invalidated sweep.enable_sweep_invalidated_alert() sweep.invalidated := invalidated sweep.invalidated_on := invalidated ? c2.o_idx : na htf_sweep.invalidated := sweep.invalidated htf_sweep.invalidated_on := sweep.invalidated_on break // filter removed sweeps c2 = htf_candles.get(i - 1) if not sweep.formed and not sweep.removed if c2.is_closed htf_sweep = c1.htf_sweeps.get(j) if sweep.invalidated and not na(sweep.invalidated_on) // if sweep is invalidated on candle that forms a sweep, then sweep will be removed if not sweep.formed sweep.removed := true htf_sweep.removed := true else // mark sweep as formed after last candle that forms a sweep is closed and sweep was not invalidated if not sweep.formed sweep.formed := true htf_sweep.formed := true htf_candles detect_sweep(UDT_HTF_Candle c1, UDT_HTF_Candle c2) => c1_bull = c1.bull c2_bull = c2.bull bull_sweep_in_range = c2_bull ? (c1_bull ? (c2.c < c1.h) : (c2.c < c1.h)) : (c1_bull ? (c2.o < c1.h) : (c2.o < c1.h)) is_bull_sweep = c2.h > c1.h and bull_sweep_in_range bear_sweep_in_range = c2_bull ? (c1_bull ? (c2.o > c1.l) : (c2.o > c1.l)) : (c1_bull ? (c2.c > c1.l) : (c2.c > c1.l)) is_bear_sweep = c2.l < c1.l and bear_sweep_in_range if is_bull_sweep if not c1.bull_sweep htf_sweep = UDT_Sweep.new(x1=c1.h_idx, x2=c2.c_idx, y=c1.h, bull=true, tf=c1.tf) ltf_sweep = UDT_Sweep.new(x1=c1.h_idx, x2=c2.c_idx, y=c1.h, bull=true, tf=c1.tf) c1.htf_sweeps.push(htf_sweep) c1.ltf_sweeps.push(ltf_sweep) c1.bull_sweep := true ltf_sweep.enable_sweep_formed_alert() else if is_bear_sweep if not c1.bear_sweep htf_sweep = UDT_Sweep.new(x1=c1.l_idx, x2=c2.c_idx, y=c1.l, bull=false, tf=c1.tf) ltf_sweep = UDT_Sweep.new(x1=c1.l_idx, x2=c2.c_idx, y=c1.l, bull=false, tf=c1.tf) c1.htf_sweeps.push(htf_sweep) c1.ltf_sweeps.push(ltf_sweep) c1.bear_sweep := true ltf_sweep.enable_sweep_formed_alert() method detect_sweeps(array htf_candles) => count = htf_candles.size() if count > 1 size = math.min(4, count - 1) for i = size to 1 c1 = htf_candles.get(i) c2 = htf_candles.get(i - 1) if not c2.is_closed and c1.htf_sweeps.size() <= 2 detect_sweep(c1, c2) htf_candles.position_ltf_sweeps() htf_candles.invalidate_sweeps() htf_candles method draw_sweep(UDT_Sweep sweep, bool ltf) => if sweep.invalidated if htf_sweeps_i_sweep_show if ltf and htf_sweeps_i_sweep_ltf_show or not ltf and htf_sweeps_i_sweep_htf_show if htf_sweeps_real_time_sweep_show ? true : not sweep.removed and not na(sweep.invalidated_on) bin.bin_ln.push(line.new(x1=sweep.x1, y1=sweep.y, x2=sweep.x2, y2=sweep.y, xloc = xloc.bar_index, color = htf_sweeps_i_sweep_line_color, style = line_style(htf_sweeps_i_sweep_line_style), width = htf_sweeps_i_sweep_line_width)) else if htf_sweeps_sweep_show if ltf and htf_sweeps_sweep_ltf_show or not ltf and htf_sweeps_sweep_htf_show bin.bin_ln.push(line.new(x1=sweep.x1, y1=sweep.y, x2=sweep.x2, y2=sweep.y, xloc = xloc.bar_index, color = htf_sweeps_sweep_line_color, style = line_style(htf_sweeps_sweep_line_style), width = htf_sweeps_sweep_line_width)) sweep is_bullish_candle(float c, float o, float h, float l) => if c == o math.abs(o - h) < math.abs(o - l) else c > o method add_htf_candle(array htf_candles, UDT_HTF_Candle candle, int total_candles_number)=> if not na(candle) if htf_candles.size() >= total_candles_number htf_candles.pop() htf_candles.unshift(candle) htf_candles method detect_htf_candle(array htf_candles, string tf, string ltf) => UDT_HTF_Candle htf_candle = na if session_begins(tf, "", na) or htf_candles.size()==0 UDT_HTF_Candle candle = UDT_HTF_Candle.new(tf = tf, htf_sweeps = array.new(), ltf_sweeps = array.new()) candle.o := open candle.c := close candle.h := high candle.l := low candle.o_idx := bar_index candle.c_idx := bar_index candle.h_idx := bar_index candle.l_idx := bar_index candle.ot := time candle.bull := is_bullish_candle(candle.c, candle.o, candle.h, candle.l) if htf_candles.size() > 0 last_candle = htf_candles.get(0) last_candle.is_closed := true last_candle.ct := time htf_candle := candle else if in_session(tf, "", na) and htf_candles.size()>0 candle = htf_candles.first() candle.c := close candle.c_idx := bar_index + 1 candle.ct := time if high > candle.h candle.h := high candle.h_idx := bar_index if low < candle.l candle.l := low candle.l_idx := bar_index candle.bull := is_bullish_candle(candle.c, candle.o, candle.h, candle.l) htf_candle get_htf_candle_shift(int candle_index, int offset, int buffer, int width, int candles_amount)=> offset + (width + buffer) * (candles_amount - candle_index - 1) method position_htf_candle(UDT_HTF_Candle candle, int candle_index, int offset, int buffer, int width, int candles_amount) => candle.shift := get_htf_candle_shift(candle_index, offset, buffer, width, candles_amount) candle.candle_left := last_bar_index + candle.shift candle.candle_rigth := candle.candle_left + width candle.candle_top := math.max(candle.o, candle.c) candle.candle_bottom := math.min(candle.o, candle.c) candle.wick_x := candle.candle_left + width/2 candle method position_htf_candles(array htf_candles, int shift) => candles_amount = htf_candles.size() for in htf_candles candle.position_htf_candle(index, shift, htf_sweeps_space, htf_candle_width, candles_amount) method draw_htf_candle(UDT_HTF_Candle candle) => candle_color = candle.bull ? htf_sweeps_bull_color : htf_sweeps_bear_color bin.bin_box.push(box.new(left=candle.candle_left, top=candle.candle_top, right=candle.candle_rigth, bottom=candle.candle_bottom, border_color = htf_sweeps_wick_border_color, border_width = 1, bgcolor = candle_color)) bin.bin_ln.push(line.new(x1=candle.wick_x, y1=candle.h, x2=candle.wick_x, y2=candle.candle_top, color = htf_sweeps_wick_border_color)) bin.bin_ln.push(line.new(x1=candle.wick_x, y1=candle.candle_bottom, x2=candle.wick_x, y2=candle.l, color = htf_sweeps_wick_border_color)) candle method draw_htf_label(array htf_candles, string tf) => float y_top = na float y_bottom = na int x_min = na int x_max = na for in htf_candles switch htf_sweeps_label_position "Both" => y_top := na(y_top) ? candle.h : math.max(y_top, candle.h) y_bottom := na(y_bottom) ? candle.l : math.min(y_bottom, candle.l) "Top" => y_top := na(y_top) ? candle.h : math.max(y_top, candle.h) "Bottom" => y_bottom := na(y_bottom) ? candle.l : math.min(y_bottom, candle.l) x_min := na(x_min) ? candle.wick_x : math.min(x_min, candle.wick_x) x_max := na(x_max) ? candle.wick_x : math.max(x_max, candle.wick_x) // time label for HTF candle txt = candle.candle_time_label() bin.bin_lbl.push(label.new(x = candle.wick_x, y = candle.l, text = txt, tooltip = str.format("HTF candle open {0}", str.format_time(candle.ot, "yyyy-MM-dd HH:mm Z", htf_sweeps_tz)), xloc=xloc.bar_index, color=color_transparent, style = label.style_label_up, textcolor = htf_sweeps_label_color, size=text_size("Tiny"), text_font_family=font_style(general_font))) x = math.round(math.avg(x_min, x_max)) txt = tf_label(tf) remaining_ms = get_htf_remaining_time(timenow, tf, "", na) if not na(y_top) bin.bin_lbl.push(label.new(x = x, y = y_top, text = txt, tooltip = str.format("HTF {0}", txt), xloc=xloc.bar_index, color=color_transparent, style=label.style_label_down, textcolor=htf_sweeps_label_color, size=text_size(htf_sweeps_label_size), text_font_family=font_style(general_font))) bin.bin_lbl.push(label.new(x = x, y = y_top, text = remaining_ms, tooltip = str.format("Time remaining until active HTF candle close {0}", remaining_ms), xloc=xloc.bar_index, color=color_transparent, style=label.style_label_down, textcolor=htf_sweeps_label_color, size=text_size("Tiny"), text_font_family=font_style(general_font))) if not na(y_bottom) bin.bin_lbl.push(label.new(x = x, y = y_bottom, text = txt, tooltip = str.format("HTF {0}", txt), xloc=xloc.bar_index, color=color_transparent, style=label.style_label_up, textcolor=htf_sweeps_label_color, size=text_size(htf_sweeps_label_size), text_font_family=font_style(general_font))) // if htf_sweeps_bias_show and htf_candles.size() > 1 // c1 = htf_candles.get(0) // c2 = htf_candles.get(1) // bullish = c1.h > c2.h and c1.l > c2.l // bearish = c1.h < c2.h and c1.l < c2.l // bin.bin_lbl.push(label.new(x = x, y = na(y_top) ? y_bottom : y_top, text = " ", xloc=xloc.bar_index, color = bullish ? htf_sweeps_bias_bull_color : htf_sweeps_bias_bear_color, style = bullish ? label.style_arrowup : label.style_arrowdown, size = size.normal)) htf_candles method draw_ltf_open_close_line(UDT_HTF_Candle candle) => y1 = math.min(candle.o, candle.c) y2 = math.max(candle.c, candle.o) bin.bin_ln.push(line.new(x1=candle.ot, y1=y1, x2=candle.ot, y2=y2, xloc = xloc.bar_time, extend = extend.both, color = htf_sweeps_ltf_trace_o_c_line_color, style = line_style(htf_sweeps_ltf_trace_o_c_line_style), width = htf_sweeps_ltf_trace_o_c_line_width)) candle method draw_ltf_high_line(UDT_HTF_Candle candle) => bin.bin_ln.push(line.new(x1=candle.ot, y1=candle.h, x2=candle.ct, y2=candle.h, xloc = xloc.bar_time, extend = extend.none, color = htf_sweeps_ltf_trace_h_l_color, style = line_style(htf_sweeps_ltf_trace_h_l_style), width = htf_sweeps_ltf_trace_h_l_width)) candle method draw_ltf_low_line(UDT_HTF_Candle candle) => bin.bin_ln.push(line.new(x1=candle.ot, y1=candle.l, x2=candle.ct, y2=candle.l, xloc = xloc.bar_time, extend = extend.none, color = htf_sweeps_ltf_trace_h_l_color, style = line_style(htf_sweeps_ltf_trace_h_l_style), width = htf_sweeps_ltf_trace_h_l_width)) candle method plot_ltf(array htf_candles) => for in htf_candles if htf_sweeps_ltf_trace_o_c_line_show candle.draw_ltf_open_close_line() if htf_sweeps_ltf_trace_h_l_show candle.draw_ltf_high_line() candle.draw_ltf_low_line() for in candle.ltf_sweeps ltf_sweep.draw_sweep(true) htf_candles method plot_htf(array htf_candles, string tf, bool ltf_map) => htf_candles.position_htf_sweeps(htf_sweeps_space) for in htf_candles candle.draw_htf_candle() for in candle.htf_sweeps htf_sweep.draw_sweep(false) if htf_sweeps_label_show htf_candles.draw_htf_label(tf) if ltf_map htf_candles.plot_ltf() htf_candles //#endregion // # ========================================================================= # // # | End | // # ========================================================================= # // # ========================================================================= # // # | Plotting | // # ========================================================================= # //#region bin.clean_bin() var tf_1_show = htf_sweeps_tf_1_show and timeframe.in_seconds(timeframe.period) < timeframe.in_seconds(htf_sweeps_tf_1_tf) var tf_2_show = htf_sweeps_tf_2_show and timeframe.in_seconds(timeframe.period) < timeframe.in_seconds(htf_sweeps_tf_2_tf) var tf_3_show = htf_sweeps_tf_3_show and timeframe.in_seconds(timeframe.period) < timeframe.in_seconds(htf_sweeps_tf_3_tf) var tf_4_show = htf_sweeps_tf_4_show and timeframe.in_seconds(timeframe.period) < timeframe.in_seconds(htf_sweeps_tf_4_tf) var tf_5_show = htf_sweeps_tf_5_show and timeframe.in_seconds(timeframe.period) < timeframe.in_seconds(htf_sweeps_tf_5_tf) var tf_6_show = htf_sweeps_tf_6_show and timeframe.in_seconds(timeframe.period) < timeframe.in_seconds(htf_sweeps_tf_6_tf) if tf_1_show htf_1_candle = htf_1_candles.detect_htf_candle(htf_sweeps_tf_1_tf, ltf) htf_1_candles.add_htf_candle(htf_1_candle, htf_sweeps_tf_1_number) htf_1_candles.detect_sweeps() if tf_2_show htf_2_candle = htf_2_candles.detect_htf_candle(htf_sweeps_tf_2_tf, ltf) htf_2_candles.add_htf_candle(htf_2_candle, htf_sweeps_tf_2_number) htf_2_candles.detect_sweeps() if tf_3_show htf_3_candle = htf_3_candles.detect_htf_candle(htf_sweeps_tf_3_tf, ltf) htf_3_candles.add_htf_candle(htf_3_candle, htf_sweeps_tf_3_number) htf_3_candles.detect_sweeps() if tf_4_show htf_4_candle = htf_4_candles.detect_htf_candle(htf_sweeps_tf_4_tf, ltf) htf_4_candles.add_htf_candle(htf_4_candle, htf_sweeps_tf_4_number) htf_4_candles.detect_sweeps() if tf_5_show htf_5_candle = htf_5_candles.detect_htf_candle(htf_sweeps_tf_5_tf, ltf) htf_5_candles.add_htf_candle(htf_5_candle, htf_sweeps_tf_5_number) htf_5_candles.detect_sweeps() if tf_6_show htf_6_candle = htf_6_candles.detect_htf_candle(htf_sweeps_tf_6_tf, ltf) htf_6_candles.add_htf_candle(htf_6_candle, htf_sweeps_tf_6_number) htf_6_candles.detect_sweeps() if barstate.islast offset = htf_sweeps_offset if tf_1_show htf_1_candles.position_htf_candles(offset) htf_1_candles.plot_htf(htf_sweeps_tf_1_tf, htf_sweeps_tf_1_map) offset += get_htf_candle_shift(0, htf_sweeps_margin, htf_sweeps_space, htf_candle_width, htf_sweeps_tf_1_number) if tf_2_show htf_2_candles.position_htf_candles(offset) htf_2_candles.plot_htf(htf_sweeps_tf_2_tf, htf_sweeps_tf_2_map) offset += get_htf_candle_shift(0, htf_sweeps_margin, htf_sweeps_space, htf_candle_width, htf_sweeps_tf_2_number) if tf_3_show htf_3_candles.position_htf_candles(offset) htf_3_candles.plot_htf(htf_sweeps_tf_3_tf, htf_sweeps_tf_3_map) offset += get_htf_candle_shift(0, htf_sweeps_margin, htf_sweeps_space, htf_candle_width, htf_sweeps_tf_3_number) if tf_4_show htf_4_candles.position_htf_candles(offset) htf_4_candles.plot_htf(htf_sweeps_tf_4_tf, htf_sweeps_tf_4_map) offset += get_htf_candle_shift(0, htf_sweeps_margin, htf_sweeps_space, htf_candle_width, htf_sweeps_tf_4_number) if tf_5_show htf_5_candles.position_htf_candles(offset) htf_5_candles.plot_htf(htf_sweeps_tf_5_tf, htf_sweeps_tf_5_map) offset += get_htf_candle_shift(0, htf_sweeps_margin, htf_sweeps_space, htf_candle_width, htf_sweeps_tf_5_number) if tf_6_show htf_6_candles.position_htf_candles(offset) htf_6_candles.plot_htf(htf_sweeps_tf_6_tf, htf_sweeps_tf_6_map) //#endregion // # ========================================================================= # // # | End | // # ========================================================================= # // # ========================================================================= # // # | Brand | // # ========================================================================= # //#region if barstate.isfirst and general_brand_show == false var table brand = table.new(position.bottom_right, 1, 1, bgcolor = chart.bg_color) table.cell(brand, 0, 0, "© CandelaCharts", text_color = colors_gray, text_halign = text.align_center, text_size = text_size(general_text), text_font_family = font_style(general_font)) //#endregion // # ========================================================================= # // # | End | // # ========================================================================= # Pine Script®指标由EnercSamwiltonua提供7
RICH SCANNER PRO this scanner for rich club only not for everyone. Rich Scanner is an intelligent market scanning and analysis system, designed to help traders identify the highest-probability trading opportunities with speed and precision. It relies on advanced analytical algorithms that automatically filter the market to deliver clear, data-driven signals — with no randomness or guesswork. 🚀 What does Rich Scanner offer? 🔍 Real-time market scanning to detect strong opportunities 🎯 Precise entry and exit signals with built-in risk filtering ⏱️ Support for multiple timeframes and different trading styles 📊 Suitable for Scalping, Intraday, and Swing Trading 🧠 Reduced noise and confusion, turning analysis into clear decisions 💎 Why Rich Scanner? Because it doesn’t just display data — it transforms data into executable opportunities, giving you a clearer market perspective and helping you trade with confidence and discipline. Rich Scanner — Trade Smarter, Decide Clearer, Achieve Stronger Results. 📈✨ Pine Script®指标由PolaOfMillion提供已更新 5
EMA Envelope and deviationEMA Envelope with Deviation is a trend-following indicator that plots an Exponential Moving Average (EMA) with dynamic upper and lower bands based on a user-defined deviation. The bands can be calculated either as a fixed percentage distance from the EMA or using statistical standard deviation, allowing traders to visualize volatility and potential overbought or oversold zones. It is commonly used to identify breakout strength, pullback entries, and mean-reversion opportunities. The indicator is fully customizable, supports different price sources, and can optionally display crossover signals when price interacts with the envelope boundaries.Pine Script®指标由danavillanueva提供3
Multi-Layer Density Zones (Trend, Horizontal, Parabolic)**Title:** Multi-Layer Density Zones (Trend, Horizontal, Parabolic) **Summary:** This advanced indicator visualizes market structure by identifying "Price Density Zones" across three different geometries simultaneously. Unlike standard Support/Resistance indicators, it calculates where price action has historically clustered relative to a baseline, using statistical distribution (Quantile) logic. **Key Features:** * **3 Distinct Layers:** 1. **Trend Layer (Oblique):** Automatically detects trend channels using Linear Regression or classic Start-End points. Ideal for identifying dynamic support/resistance in trending markets. 2. **Horizontal Layer:** Scans for classic static price levels where price has spent the most time. 3. **Parabolic Layer (Matrix-Based):** Uses advanced **Matrix Mathematics** to solve Polynomial Regression (up to degree 4). It fits curves ("U" or "S" shapes) to price action, capturing non-linear market cycles. * **Quantile vs. Linear Mode:** * *Quantile (Density Focused):* Zones are spaced based on data density. Areas with high price activity become narrower and more defined. * *Linear:* Creates equally spaced parallel channels. * **Interactive History:** You can select specific starting dates directly from the chart to analyze specific market phases. * **Dynamic Visualization:** Uses gradient shading (`linefill`) to highlight zones; denser areas can be made more visible while sparse areas remain transparent. **How to Use:** Use the **Parabolic Layer** to catch market reversals where linear trends fail. Use the **Trend Layer** for channel trading and the **Horizontal Layer** for key breakout levels.Pine Script®指标由BoG4CH提供已更新 5
Pro Intraday Reaction Levels🔥 Pro Intraday Reaction Levels Maps yesterday’s range into today’s highest-probability intraday reaction zones. Pro Intraday Reaction Levels is a professional market structure tool built for intraday traders who want clear context, smarter trade location, and high-probability reaction areas — without clutter. Instead of plotting simple previous day lines, this indicator visualizes the entire prior day range and builds adaptive reaction zones where price is statistically more likely to stall, reject, or reverse. It helps you stop trading blindly into extremes — and start trading with structure. 🧭 What It Shows on Your Chart 📦 Previous Day Range Box Clearly displays yesterday’s full high–low range so you instantly know whether price is: • Trading inside value • Testing extremes • Breaking into expansion 🔥 Adaptive Reaction Zones Dynamic zones around the previous day high and low where intraday reactions commonly occur. These zones automatically adjust to volatility (ATR): Higher volatility → tighter zones Lower volatility → wider zones This keeps levels relevant in both quiet and fast markets. ⚖ Range Midpoint (Optional) Marks the equilibrium level of the prior day — a common decision area for intraday traders. ⏹ Previous Day Close (Optional) Displays a key reference level often respected as support/resistance or bias confirmation. 🧠 Why Traders Love It Markets frequently react at previous day extremes due to liquidity, trapped traders, and institutional positioning. This tool helps you: ✔ Spot potential reversal zones ✔ Identify breakout acceptance vs rejection ✔ Frame intraday bias using higher timeframe structure ✔ Avoid entering trades directly into reaction areas It’s not just levels — it’s location and context. ⚙ Smart Features 🔹 Automatic Volatility Adjustment Reaction zones scale dynamically using ATR so they stay meaningful in all conditions. 🔹 Session Mode Choose how levels are projected: • RTH Only – Focus on regular trading hours • All Sessions – Use full 24-hour structure 🔹 Theme-Adaptive Visuals Clean, Contrast, and Minimal themes automatically adjust colors for both dark and light charts. 🔹 Customizable Opacity & Colors Fine-tune visibility without cluttering your chart. 🎯 Who This Is For Ideal for traders who use: • Intraday price action • Futures and index trading • Forex day trading • Crypto intraday trading • Support & resistance strategies • Liquidity and reaction-based setups Works on any market where previous day structure influences intraday behavior. 💡 How Many Traders Use It Common approaches include: • Looking for reversal patterns inside reaction zones • Managing trades near PDH/PDL instead of chasing breakouts • Combining zones with volume, order flow, or candlestick signals • Using the midpoint and PDC as bias confirmation levelsPine Script®指标由jochacko11提供24
Ozgur TELEK Elite ScalperBreakout Strategy: If the price breaks above the Red Resistance line with a high-volume candle and the “BUY” signal lights up at the same time, this is the trade with the highest success rate. Support Reversal: If the price touches the Green Support line and bounces upward while the “BUY” signal is lit, you can enter the trade with a very short stop distance (just below the support). False Signal Filter: If the “BUY” signal is lit but the price is just below the Red Resistance line, do not enter without waiting for the breakout. It may reverse from the resistance. Translated with DeepL.com (free version)Pine Script®指标由berlin041025提供已更新 6
nasser kurdi nasser kurdi full lllllllllllllllllllllllllllllllllllllllllllllllllPine Script®指标由nasserkurdi9提供7
Accumulation & Distribution Days HistogramWHAT IT TRACKS: • Distribution Days (Selling Pressure): Price closes down >0.2% on higher volume than previous day • Accumulation Days (Buying Pressure): Price closes up >0.2% on higher volume than previous day HOW IT WORKS: The histogram displays a rolling count of distribution and accumulation days within your chosen lookback period (default: 20 bars). Green bars show accumulation days above the zero line, while red bars show distribution days below the zero line. A white line plots the net difference (accumulation minus distribution) to show the overall balance. SETTINGS: • Lookback Period: Number of bars to count (default: 20) • Price Threshold: Minimum % move required (default: 0.2%) • Colors: Fully customizable histogram colors USAGE: Use this to gauge the balance between buying and selling pressure. When accumulation exceeds distribution, it suggests bullish pressure. When distribution exceeds accumulation, it suggests bearish pressure. The indicator can also serve as a market health filter: • 0-3 Distribution Days: Bullish market condition - healthy for long positions • 4-5 Distribution Days: Cautious - monitor for potential trend change • 6+ Distribution Days: Bearish signal - institutional selling intensifying Other potential uses to explore: • Divergence analysis: Price making new highs while distribution days cluster • Sector rotation: Compare distribution/accumulation across different sectors • Entry timing: Wait for accumulation to exceed distribution before entering • Risk management: Reduce position size as distribution days increase Experiment with different lookback periods and thresholds to match your trading timeframe and style. If you discover effective ways to use this indicator, please share in the comments below - your insights could help others, enjoy.Pine Script®指标由illest200提供5
Moving Average Exponential//@version=6 indicator(title="Moving Average Exponential", shorttitle="EMA", overlay=true, timeframe="", timeframe_gaps=true) len = input.int(9, minval=1, title="Length") src = input(close, title="Source") offset = input.int(title="Offset", defval=0, minval=-500, maxval=500, display = display.data_window) out = ta.ema(src, len) plot(out, title="EMA", color=color.blue, offset=offset) // Smoothing MA inputs GRP = "Smoothing" TT_BB = "Only applies when 'SMA + Bollinger Bands' is selected. Determines the distance between the SMA and the bands." maTypeInput = input.string("None", "Type", options = , group = GRP, display = display.data_window) var isBB = maTypeInput == "SMA + Bollinger Bands" maLengthInput = input.int(14, "Length", group = GRP, display = display.data_window, active = maTypeInput != "None") bbMultInput = input.float(2.0, "BB StdDev", minval = 0.001, maxval = 50, step = 0.5, tooltip = TT_BB, group = GRP, display = display.data_window, active = isBB) var enableMA = maTypeInput != "None" // Smoothing MA Calculation ma(source, length, MAtype) => switch MAtype "SMA" => ta.sma(source, length) "SMA + Bollinger Bands" => ta.sma(source, length) "EMA" => ta.ema(source, length) "SMMA (RMA)" => ta.rma(source, length) "WMA" => ta.wma(source, length) "VWMA" => ta.vwma(source, length) // Smoothing MA plots smoothingMA = enableMA ? ma(out, maLengthInput, maTypeInput) : na smoothingStDev = isBB ? ta.stdev(out, maLengthInput) * bbMultInput : na plot(smoothingMA, "EMA-based MA", color=color.yellow, display = enableMA ? display.all : display.none, editable = enableMA) bbUpperBand = plot(smoothingMA + smoothingStDev, title = "Upper Bollinger Band", color=color.green, display = isBB ? display.all : display.none, editable = isBB) bbLowerBand = plot(smoothingMA - smoothingStDev, title = "Lower Bollinger Band", color=color.green, display = isBB ? display.all : display.none, editable = isBB) fill(bbUpperBand, bbLowerBand, color= isBB ? color.new(color.green, 90) : na, title="Bollinger Bands Background Fill", display = isBB ? display.all : display.none, editable = isBB) Pine Script®指标由serkandanki提供1112
Top-secret Golden Mentor (Jorge's Algo)Description: INTRODUCTION The Top-secret Golden Mentor is an institutional trading system engineered for surgical precision on Gold (XAUUSD) and other volatile assets. This indicator goes beyond simple entry signals; it automatically filters market traps (fakeouts) by aligning every volume anomaly with the macro market structure. The main objective is simple: Stop trading against the trend and pinpoint exactly where institutions have injected capital. KEY FEATURES 1. X-Ray Candles (True Volume Pressure) Move beyond traditional Japanese candlesticks. This indicator "undresses" the price action: Grey Border: Represents the price range. Color Fill (Green/Red): Reveals who actually won the internal volume battle (Delta). Benefit: You can spot candles that look bullish on the outside but are "hollow" (empty of buyers) on the inside. 2. Smart Trend Filter (The Trap Detector) The core upgrade of V18. The system analyzes market structure in real-time. If a BUY signal appears during a BEARISH structure, the system instantly marks it with a Grey "X". Signal with "X" = MARKET TRAP (Absorption). This prevents you from entering fake pullbacks that are about to be absorbed by the main trend. 3. Sniper Signals & Institutional Gaps (FVG) When the system detects a massive volume injection: It plots a Volume Dot (Alert). It automatically projects the 50% Retracement Line of the candle body (Institutional Equilibrium). It draws a Subtle Box (Gap/FVG) marking the price inefficiency where institutions often return to mitigate. 4. Dynamic Structure Panel A visual dashboard in the top corner that instantly displays the current timeframe bias (BULLISH or BEARISH), removing subjective guesswork. HOW TO USE THIS STRATEGY Check the Panel: Is the bias BULLISH or BEARISH? Wait for the Signal: Look for the Volume Dot. Filter the Trap: If the dot has a Grey "X" on top: DO NOT TRADE. It is a counter-trend trap. If the dot has NO "X" and lines are drawn: VALID SIGNAL. Execution: Place your Limit Order at the dotted 50% line or inside the Institutional Gap Box. RECOMMENDED SETTINGS Assets: Optimized for XAUUSD (Gold), but works on Forex and Futures. Timeframes: Highly effective on 1H for direction and 5m for sniper entries. DISCLAIMER This indicator is a technical analysis assistance tool based on Smart Money Concepts (SMC). It does not guarantee future profits. Always use proper risk management.Pine Script®指标由JorgeG255提供65
Core IC 2.0 ## 📌 NIFTY Weekly Option Seller — Core Regime & Risk Framework This indicator is designed for **systematic weekly option selling on NIFTY**, focused on **Iron Condors (IC), Put Credit Spreads (PCS), and Call Credit Spreads (CCS)**. It is **not a scalping tool** and **not a signal generator**. Instead, it provides a **structured decision framework** to help option sellers decide: * *What structure to deploy* (IC / PCS / CCS) * *How aggressive to be* (position size & distance) * *When to adjust* (defend / harvest / regime change) --- ## 🔍 What the Indicator Does ### 1️⃣ Market Regime Detection The script continuously evaluates the market and classifies it into one of three regimes: * **IC (Range / Mixed)** – neutral, mean-reverting conditions * **PCS (Trend Up)** – bullish trend continuation * **CCS (Trend Down)** – bearish trend continuation Regime selection is based on: * EMA structure * ADX (trend strength) * VWAP positioning * Higher timeframe (daily) trend alignment --- ### 2️⃣ Independent Conviction Scores The indicator computes **three independent scores (0–5)**: ``` IC / PCS / CCS ``` These scores represent **conviction strength**, not trade signals. * Higher score = stronger suitability for that structure * All three scores are always visible for transparency Only **one active score** (based on the current regime) is used for: * Position sizing * Strike distance suggestions * Risk management logic --- ### 3️⃣ Risk-First Position Guidance Based on the active score, the indicator suggests: * **Position Size** (100% / 50% / 25%) * **Short strike distance** (ATR-based, dynamic) * **Defend / Harvest conditions** * **Regime change alerts** This helps traders remain **consistent and disciplined**, especially during volatile weeks. --- ### 4️⃣ Visual Decision Panel A compact panel displays all key information at a glance: * Regime (IC / PCS / CCS) * ATR & ADX * Suggested size * Suggested short distance * IC / PCS / CCS scores * Key reference levels (H3 / L3, VWAP) No guesswork, no over-trading. --- ## 🕒 Recommended Usage * **Best timeframe:** 1H or 4H * **Ideal style:** End-of-day or limited-check traders * **Designed for:** Weekly option sellers (not intraday scalpers) Adjustments are intended to be made **at fixed checkpoints**, not every candle. --- ## ⚠️ Important Notes * This is **not financial advice** * The indicator does **not place trades** * Works best when combined with: * Defined stop-loss rules * Fixed risk-reward discipline * Proper position sizing --- ## 🎯 Who This Is For ✔ Rule-based option sellers ✔ Traders focused on consistency over excitement ✔ Professionals who value structure and risk control ❌ Not for discretionary scalpers ❌ Not for beginners without options knowledge Pine Script®指标由distinctSeahor20287提供6
HLC Higher in all Time FrameUsing Script You Get Early Indication For Seling Or BuyingPine Script®指标由jayinstrument提供8