OPEN-SOURCE SCRIPT
تم تحديثه Precision Candle Close Alert [Anti-Lag] for Scalper & Daytrader

As a scalper or day trader, timing is everything. Standard TradingView alerts often fire 2-3 seconds after the candle has closed due to tick-dependency and server lag. If you are trading the 1m or 5m chart, that delay can cost you money.
The Candle Close Alert (CCA) solves this problem. It is designed for absolute precision and includes a built-in "Anti-Lag" feature. This allows you to trigger the alert slightly before the actual close. By the time the push notification or sound reaches your device, the candle is closing at that exact millisecond.
Key Features:
⚡ Anti-Lag Offset: Compensate for server delays by firing the alert a customizable number of seconds (e.g., 2s) before the candle actually closes.
🎯 True Close Only: Uses strict condition matching to ensure the alert NEVER fires randomly in the middle of a candle. It only triggers on the exact target close.
🔢 Custom Alert Limit: Set a maximum number of alerts (e.g., alert me for the next 5 closes, then automatically stop).
🔄 One-Click Reset: Easily reset the alert counter directly from the indicator settings without having to delete and recreate the alert.
⏱️ Multi-Timeframe Support: Select your target timeframe (from 1m up to Monthly) independently of your current chart resolution.
How to set it up correctly:
Add the indicator to your chart. (Note: Your chart timeframe must be equal to or lower than your selected alert timeframe).
Open the indicator settings and set your target timeframe, the max alert count, and the Anti-Lag Offset (2 to 3 seconds is the recommended sweet spot).
Open the TradingView Alert Menu (clock icon) and click "Create Alert".
Condition: Select "Candle Close Alert" -> "Any alert() function call".
Go to the "Notifications" tab, check "Play Sound", and select a specific sound for this alert.
Click "Create".
Note: Because Pine Script triggers on price ticks, the anti-lag feature will fire on the first tick that occurs within your defined pre-close window.
Tags:
#Scalping #DayTrading #Alerts #CandleClose #Precision #Forex #Crypto #Utility
The Candle Close Alert (CCA) solves this problem. It is designed for absolute precision and includes a built-in "Anti-Lag" feature. This allows you to trigger the alert slightly before the actual close. By the time the push notification or sound reaches your device, the candle is closing at that exact millisecond.
Key Features:
⚡ Anti-Lag Offset: Compensate for server delays by firing the alert a customizable number of seconds (e.g., 2s) before the candle actually closes.
🎯 True Close Only: Uses strict condition matching to ensure the alert NEVER fires randomly in the middle of a candle. It only triggers on the exact target close.
🔢 Custom Alert Limit: Set a maximum number of alerts (e.g., alert me for the next 5 closes, then automatically stop).
🔄 One-Click Reset: Easily reset the alert counter directly from the indicator settings without having to delete and recreate the alert.
⏱️ Multi-Timeframe Support: Select your target timeframe (from 1m up to Monthly) independently of your current chart resolution.
How to set it up correctly:
Add the indicator to your chart. (Note: Your chart timeframe must be equal to or lower than your selected alert timeframe).
Open the indicator settings and set your target timeframe, the max alert count, and the Anti-Lag Offset (2 to 3 seconds is the recommended sweet spot).
Open the TradingView Alert Menu (clock icon) and click "Create Alert".
Condition: Select "Candle Close Alert" -> "Any alert() function call".
Go to the "Notifications" tab, check "Play Sound", and select a specific sound for this alert.
Click "Create".
Note: Because Pine Script triggers on price ticks, the anti-lag feature will fire on the first tick that occurs within your defined pre-close window.
Tags:
#Scalping #DayTrading #Alerts #CandleClose #Precision #Forex #Crypto #Utility
ملاحظات الأخبار
v2ملاحظات الأخبار
v3ملاحظات الأخبار
What's New in this Version:🔄 Unlimited Alerts Toggle: You no longer have to restrict your alerts to a specific maximum count. By checking the new "Unlimited Alerts" box in the settings (enabled by default), the indicator will continuously notify you on every target candle close until you manually stop it.
💬 Dynamic Alert Messages: The push notification dynamically adapts to your settings. It will now explicitly tell you if it's running in "(Unlimited)" mode, or it will track your precise count (e.g., "Alert: 3 of 5") if you choose to use the Max Alert Count limit.
How to use it:
If you want the alert to run forever ("set and forget"), simply leave the "Unlimited Alerts" box checked. If you only want to be alerted for a specific number of upcoming closes (e.g., the next 3 candles), uncheck the box and set your desired number in the "Max Alert Count" field below it.
Note: Please remember to delete your old alert in the TradingView alerts manager and create a new one to ensure the new features and variables are applied correctly!
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.