OPEN-SOURCE SCRIPT
Pump-and-Dump / Volatility Spike Flag

Pump-and-Dump / Volatility Spike Flag flags abnormal single-candle volatility — not the manipulation scheme, but the classic sharp-spike-then-reverse price shape that shows up around news events (frequently seen on MCX crude oil and silver).
HOW IT WORKS
A candle is flagged only when two conditions occur together: its true range (which includes gap-opens) expands well beyond its rolling ATR, AND its volume expands well beyond its rolling average. Flagged spikes are tracked for a short window afterward — if price closes back through that candle's open before the window expires, it is separately flagged as a "Fade," indicating the initial move has started reversing.
HOW TO USE
Use the Spike flag as an early heads-up that a candle is statistically abnormal for current conditions. Use the Fade flag as the more actionable signal — it confirms the spike has already started giving back its move. This is an informational/analytical tool, not a buy or sell signal, and should be combined with your own risk management and market context.
LIMITATIONS
ATR and volume averages are backward-looking, so the first spike after a long quiet period needs a relatively larger move to trigger. This is a single-candle geometry and volume-shape detector — it cannot identify why a move happened (news, order-flow, or otherwise), and it does not predict direction after the fade.
DISCLAIMER
For educational/informational purposes only. Not financial advice. Past performance does not guarantee future results. Trade at your own risk and always use proper risk management.
HOW IT WORKS
A candle is flagged only when two conditions occur together: its true range (which includes gap-opens) expands well beyond its rolling ATR, AND its volume expands well beyond its rolling average. Flagged spikes are tracked for a short window afterward — if price closes back through that candle's open before the window expires, it is separately flagged as a "Fade," indicating the initial move has started reversing.
HOW TO USE
Use the Spike flag as an early heads-up that a candle is statistically abnormal for current conditions. Use the Fade flag as the more actionable signal — it confirms the spike has already started giving back its move. This is an informational/analytical tool, not a buy or sell signal, and should be combined with your own risk management and market context.
LIMITATIONS
ATR and volume averages are backward-looking, so the first spike after a long quiet period needs a relatively larger move to trigger. This is a single-candle geometry and volume-shape detector — it cannot identify why a move happened (news, order-flow, or otherwise), and it does not predict direction after the fade.
DISCLAIMER
For educational/informational purposes only. Not financial advice. Past performance does not guarantee future results. Trade at your own risk and always use proper risk management.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.