PROTECTED SOURCE SCRIPT
Cập nhật Double Purge Theory (DPT)

The purpose of this script is to identify the Double Purge Theory-MMXM i.e. the run on liquidity on both the sell-side and the buy-side liquidity.
The simple use case behind this script is to provide additional entry confluence for your trade setups and more efficient stop loss placement on any given timeframe.
DPT in itself is a price signature that generally occurs before price makes impulsive move in the direction of the higher time frame narrative. It is not to be used as a standalone indicator for building narrative/framing bias.
How to use this script ?
1) Wait for the indicator to display the BLUE CANDLE highlight (DPT candle) that indicates the double purge has occurred. [the color is set to blue by default , you can change it by going into the settings tab]
2) The DPT should occur at/after price has tapped into a key level and is within the ICT killzones.
3) Position to frame your trade setup once you get a candle with a body close below / above the DPT candle , depending on your bias and stop loss placement at DPT candle high/low or after the body closure as mentioned in step 2.
For example :
https://www.tradingview.com/x/mqPFuDQ9/
https://www.tradingview.com/x/GqMZfv7O/
The simple use case behind this script is to provide additional entry confluence for your trade setups and more efficient stop loss placement on any given timeframe.
DPT in itself is a price signature that generally occurs before price makes impulsive move in the direction of the higher time frame narrative. It is not to be used as a standalone indicator for building narrative/framing bias.
How to use this script ?
1) Wait for the indicator to display the BLUE CANDLE highlight (DPT candle) that indicates the double purge has occurred. [the color is set to blue by default , you can change it by going into the settings tab]
2) The DPT should occur at/after price has tapped into a key level and is within the ICT killzones.
3) Position to frame your trade setup once you get a candle with a body close below / above the DPT candle , depending on your bias and stop loss placement at DPT candle high/low or after the body closure as mentioned in step 2.
For example :
https://www.tradingview.com/x/mqPFuDQ9/
https://www.tradingview.com/x/GqMZfv7O/
Phát hành các Ghi chú
What is new in DPT V2 update : 1) Added alerts for DPT, now you can set alerts to go off whenever DPT occurs :
Go to TradingView and open your chart.
Click on the "Alerts" icon (🔔) in the top panel.
Click "Create Alert".
In the Condition dropdown, select the DPT indicator.
Choose "Any alert function call".
Select alert frequency (e.g., once per bar).
Set your preferred notification method (popup, email, webhook, etc.).
Click Create.
2) Bias selection :
This will let users select the sweep they want to filter , if a user selects bullish bias , only bullish sweeps will be shown and if user selects bearish bias then, only bearish sweep shall be shown.
You still have the option to view both.
Phát hành các Ghi chú
1) Added time filter to only detect and show DPTs during the time range user specifies. 2) The sweeps logic has been changed to show only the sweep of DPT candle based on stats.
Phát hành các Ghi chú
Time Filtering : i) Optional time-based filtering (EST time zone).
ii) Two customizable time slots.
iii) Default slots: 2-5 AM & 8-11 AM EST (can be disabled to capture 24/7 sweeps).
Visual Elements
i) Blue candles (color set by default) = DPT pattern detected
ii) Colored lines = Sweep levels (customizable length, color, style, thickness).
iii) Probability labels = Shows success rate at each sweep.
iv) Statistics table = Real-time performance metrics.
Probability Labels
🟢 Green = >51% success rate (high probability)
🟠 Orange = 40-51% success rate (medium)
🔴 Red = <40% success rate (low probability)
Only shows after minimum sample size reached.
Updates in real-time with historical data.
Statistics Table
Displays:
Bullish sweep success rate
Bearish sweep success rate
Overall success rate
Sample size (total sweeps analyzed)
Color-coded percentages (Green/Orange/Red)
Fully customizable position, size, colors, transparency
Show/hide probability labels
Size options (Tiny/Small/Normal/Large)
Minimum sample size threshold (default: 10)
Auto color-coding based on performance
Time Filter
Phát hành các Ghi chú
Fixed bug which was breaking stats when time filter was on but slot 1 was disabled. Phát hành các Ghi chú
Removed Stats tableSweeps will retain probability labels
Added alerts for when
i) DPT candle is detected
ii) Sweep of DPT candle
Phát hành các Ghi chú
Added more information to probability labels Phát hành các Ghi chú
Removed probability and stats since it was not providing meaningful edgePhát hành các Ghi chú
Bug fixesMã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể tự do sử dụng tập lệnh mà không có bất kỳ hạn chế nào – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể tự do sử dụng tập lệnh mà không có bất kỳ hạn chế nào – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.