OPEN-SOURCE SCRIPT
+25% DMA200

+25% DMA200 highlights daily over-extension by printing a ⚠️ marker on every daily candle where price is more than X% above the Daily 200 DMA (200-period SMA calculated on the Daily timeframe). It also plots the Daily DMA200 line on the chart. Recommended usage in GOLD, GLD, etc.
How it works
Computes DMA200 using Daily data
Measures extension: (Close − DMA200) / DMA200
If extension is above the threshold (default 0.25 = 25%), it places a ⚠️ above that candle (one per qualifying daily candle).
Optional alert triggers only when extension crosses above the threshold (entry into the over-extended zone).
Inputs
DMA Length (Daily): Moving average length (default 200).
Threshold: Over-extension level (0.25 = 25%).
Run ONLY on 1D chart: If enabled, marks/alerts only on Daily charts.
Pad above high: Vertical spacing for the marker above the candle’s high.
Keep last N markers: Limits how many markers are kept to avoid chart clutter.
Note
This is not a buy/sell signal—it’s a risk/extension detector to help identify when price is stretched far above its long-term daily mean.
How it works
Computes DMA200 using Daily data
Measures extension: (Close − DMA200) / DMA200
If extension is above the threshold (default 0.25 = 25%), it places a ⚠️ above that candle (one per qualifying daily candle).
Optional alert triggers only when extension crosses above the threshold (entry into the over-extended zone).
Inputs
DMA Length (Daily): Moving average length (default 200).
Threshold: Over-extension level (0.25 = 25%).
Run ONLY on 1D chart: If enabled, marks/alerts only on Daily charts.
Pad above high: Vertical spacing for the marker above the candle’s high.
Keep last N markers: Limits how many markers are kept to avoid chart clutter.
Note
This is not a buy/sell signal—it’s a risk/extension detector to help identify when price is stretched far above its long-term daily mean.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.