PDH PDL Sweep Levels Indicator
Info
The PDH PDL Sweep Levels Indicator is a Indicator for MetaTrader 5 that previous day high and low (pdh, pdl) sweep levels on gold (xauusd) this indicator identifies and visualizes key trading levels on gold (xauusd), specifically the previous day's high and low (pdh, pdl), previous week's high and low (pwh, pwl), and the current day's and week's open prices. It highlights instances where price 'sweeps' these levels.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Indicator works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Indicators folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use PDH PDL Sweep Levels Indicator
1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.
2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.
3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.
4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.
Frequently Asked Questions
Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."
Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).
Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.
What this tool does
Previous Day High and Low (PDH, PDL) Sweep Levels on Gold (XAUUSD) This indicator identifies and visualizes key trading levels on Gold (XAUUSD), specifically the previous day's high and low (PDH, PDL), previous week's high and low (PWH, PWL), and the current day's and week's open prices.
Typical Use Case
This Indicator excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Indicator works on MetaTrader 5. Place the file in the MQL5/Indicators folder and restart the terminal.
Description & Settings
Related: Gold Level Map for XAUUSD: Key Levels and Trading Context - another powerful indicator for MetaTrader 5 traders.
Previous Day High and Low (PDH, PDL) Sweep Levels on Gold (XAUUSD)Also recommended: Gold Session Liquidity Free MT5 - XAUUSD Sessions, Sweeps, and Risk Planner - similar indicator with strong performance on MetaTrader 5.
This indicator identifies and visualizes key trading levels on Gold (XAUUSD), specifically the previous day's high and low (PDH, PDL), previous week's high and low (PWH, PWL), and the current day's and week's open prices.
It highlights instances where price 'sweeps' these levels. A sweep is defined as a candle whose wick extends beyond a level, followed by a close back within that level.
A green arrow is displayed when the price pokes through a low and closes above it, indicating a sweep of the low.
A red arrow is displayed when the price pokes through a high and closes below it, indicating a sweep of the high.
Important Note: A sweep signifies that stop losses have likely been triggered, but it is not a standalone entry signal. Price may continue in the direction of the sweep. It should be used in conjunction with your own trading strategy and confirmation.
Indicator Settings
- Previous Day High and Low: Toggle On/Off (Default: On)
- Previous Week High and Low: Toggle On/Off (Default: On)
- Today's Open and This Week's Open: Toggle On/Off (Default: On)
- Bars the lines extend to the right: Default 10
- Colors for day, week, and opens: Customizable
- Text labels with price: Customizable
- Mark sweeps of day levels: Toggle On/Off (Default: On)
- Mark sweeps of week levels: Toggle On/Off (Default: On)
- Minimum poke beyond the level (in points): Default 0. Increase this value to disregard minor wicks.
Alerts
- Popup, push, and sound alerts: All Off by default. Alerts trigger once on the candle that just closed.
Requirements
- Supported Symbols: Any symbol
- Supported Timeframes: Any timeframe below Daily (D1)
- Data Source: Day and week levels are derived from the broker's server data (D1 and W1 history). The indicator will populate levels once the necessary historical data is loaded.
- Object Handling: Lines and labels are standard chart objects. Arrows are generated using two indicator buffers. The indicator does not execute trades.
- Push Notifications: Requires your MetaQuotes ID to be configured in the terminal options.
Usage and Customization
Experiment with this indicator on symbols like XAUUSD, XAGUSD, EURUSD, GBPUSD, US30, or NAS100. Compare the frequency of PDH or PDL sweeps during the London or New York sessions on M5 and M15 timeframes.
For Expert Advisors (EAs), indicator data can be accessed via iCustom. Buffers 0 to 3 provide PDH, PDL, PWH, and PWL values for each bar. Buffer 4 indicates a low sweep, and Buffer 5 indicates a high sweep. This indicator serves as a natural trigger for strategies incorporating Smart Money Concepts; consider waiting for a sweep followed by a change of character.
About the Code
This is an open-source indicator. Feel free to use, adapt, or build upon it. Questions, suggestions, and test results are welcomed in the comments section.
Changelog
v1.0 (2026-11-20): Initial release.
You may also like: Previous Day and Week Levels with Round Numbers - excellent alternative for indicator users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version "1.00"
#property description "This code is educational. Feel free to use, modify and upgrade as you wish. Visit ROBOTFX.ORG for professional trading tools"
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_plots 6
#property indicator_label1 "Previous day high"
#property indicator_type1 DRAW_NONE
#property indicator_label2 "Previous day low"
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.