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 อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน