OPEN-SOURCE SCRIPT
Smart Circuit Detector

Here is a detailed, professional, and structured description you can copy and paste directly into your TradingView publication. It highlights the problem the script solves (chart clutter) and clearly explains its features to other traders.
Title: Minimal Circuit Change Detector (5%, 10%, 20% Limits)
Description:
Tracking intraday circuit limits or major percentage milestones can easily turn your chart into a messy, unreadable cluster of repetitive labels. The Minimal Circuit Change Detector is designed to solve exactly that.
This indicator cleanly detects when an asset hits critical daily percentage moves (5%, 10%, and 20%) from the previous day's close. Instead of spamming your chart with a label on every single candle that remains at that limit, it uses a strict state-tracking engine to plot a single, distinct tag only on the exact candle where the circuit limit is newly breached.
🌟 Key Features
Anti-Clutter State Tracking: The script remembers the currently active circuit limit. If a stock rides the 5% limit for 10 consecutive candles, you will only see one label on the very first candle of that move.
Multi-Tier Circuit Detection: Automatically detects and categorizes hits into three major bands:
5% Limit: Drops a Red label from above the bar.
10% Limit: Pushes a Yellow label from below the bar.
20% Limit: Pushes an Orange label from below the bar for extreme moves.
Fractional Noise Tolerance: Markets aren't perfectly precise. The script includes a minor buffer (e.g., triggering a 5% hit between 4.8% and 5.2%) to account for decimal noise and ensure you don't miss a limit hit just because the price was off by a fraction of a cent.
Flawless Previous Close Fetching: Utilizes TradingView's request.security function with lookahead_on specifically targeting historical data (close[1]). This ensures yesterday's exact closing price is grabbed cleanly for intraday calculations without any repainting issues.
🧠 How It Works
The script calculates the maximum percentage move (both high and low) relative to the previous daily close on every single intraday bar. It evaluates these percentages against the built-in thresholds. If a new threshold is hit, it triggers a "state shift" and plots the corresponding visual tag. It will then remain silent until the price either drops out of the limits entirely or advances to the next limit tier (e.g., jumping from 5% to 10%).
🎯 Best Used For:
Volatile Markets: Extremely useful for markets with hard exchange-imposed circuit breakers (like the NSE/BSE in India or crypto assets).
Momentum Traders: Easily visually identify exactly when a stock catches fire and shifts into a new volatility gear.
Clean Charting: Perfect for traders who want critical alerts without sacrificing the visibility of their price action and candlesticks.
Add it to your chart, and never miss a circuit shift again—without the visual spam!
Title: Minimal Circuit Change Detector (5%, 10%, 20% Limits)
Description:
Tracking intraday circuit limits or major percentage milestones can easily turn your chart into a messy, unreadable cluster of repetitive labels. The Minimal Circuit Change Detector is designed to solve exactly that.
This indicator cleanly detects when an asset hits critical daily percentage moves (5%, 10%, and 20%) from the previous day's close. Instead of spamming your chart with a label on every single candle that remains at that limit, it uses a strict state-tracking engine to plot a single, distinct tag only on the exact candle where the circuit limit is newly breached.
🌟 Key Features
Anti-Clutter State Tracking: The script remembers the currently active circuit limit. If a stock rides the 5% limit for 10 consecutive candles, you will only see one label on the very first candle of that move.
Multi-Tier Circuit Detection: Automatically detects and categorizes hits into three major bands:
5% Limit: Drops a Red label from above the bar.
10% Limit: Pushes a Yellow label from below the bar.
20% Limit: Pushes an Orange label from below the bar for extreme moves.
Fractional Noise Tolerance: Markets aren't perfectly precise. The script includes a minor buffer (e.g., triggering a 5% hit between 4.8% and 5.2%) to account for decimal noise and ensure you don't miss a limit hit just because the price was off by a fraction of a cent.
Flawless Previous Close Fetching: Utilizes TradingView's request.security function with lookahead_on specifically targeting historical data (close[1]). This ensures yesterday's exact closing price is grabbed cleanly for intraday calculations without any repainting issues.
🧠 How It Works
The script calculates the maximum percentage move (both high and low) relative to the previous daily close on every single intraday bar. It evaluates these percentages against the built-in thresholds. If a new threshold is hit, it triggers a "state shift" and plots the corresponding visual tag. It will then remain silent until the price either drops out of the limits entirely or advances to the next limit tier (e.g., jumping from 5% to 10%).
🎯 Best Used For:
Volatile Markets: Extremely useful for markets with hard exchange-imposed circuit breakers (like the NSE/BSE in India or crypto assets).
Momentum Traders: Easily visually identify exactly when a stock catches fire and shifts into a new volatility gear.
Clean Charting: Perfect for traders who want critical alerts without sacrificing the visibility of their price action and candlesticks.
Add it to your chart, and never miss a circuit shift again—without the visual spam!
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.