Day Filling
Download scriptThis script is designed as a visual trading tool for the MetaTrader 5 platform. Its primary purpose is to provide traders with a clear, visual representation of the highest and lowest price points reached during a specific daily timeframe, making it easier to identify significant support and resistance levels.
Core Functionality
The tool identifies the "Day High" and "Day Low" prices. Instead of just displaying these as static numbers, it creates a visual "filling" effect on your chart. This helps traders see the price boundaries of the current day at a glance without having to manually check historical data.
How the Logic Works
The script operates through the following logical steps:
1. Environment Verification Before performing any calculations, the script checks if it is being used on an appropriate timeframe. It is designed to work on charts smaller than one day (such as 1-minute, 5-minute, or 1-hour charts). If a user attempts to run it on a Daily chart or higher, the script will trigger a notification alert to inform them that the timeframe is incompatible.
2. Data Synchronization The tool continuously monitors the current price action and synchronizes it with the daily data. It looks at the specific "Daily Bar" that corresponds to the time shown on your current chart. By doing this, it ensures that even if you are looking at a very small timeframe (like 1 minute), the visual boundaries remain locked to the daily high/low limits.
3. Dynamic Calculation The script performs a real-time check of the daily price movement:
- It retrieves the opening, closing, high, and low prices for the current day.
- It compares the daily "Open" price against the "Close" price to determine the market trend for that day.
- It then assigns these values to two separate visual buffers (Buffer 1 and Buffer 2).
4. Visual Rendering The final result is a visual "fill" on your screen. Because it uses a filling style, it shades the area between the daily high and low. This creates a shaded zone that clearly defines the trading range for the day. As the day progresses and new highs or lows are reached, these boundaries update automatically to reflect the most recent price action.
5. Intelligent Updates The script is optimized to handle data updates smoothly. It contains logic to ensure that the visual elements do not "stretch" or display incorrectly when transitioning between different days. It clears previous data points correctly so that the transition from one trading day to the next remains clean and accurate on your chart.
ÿþ/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / | D a y F i l l i n g . m q 5 |
/ / | C o p y r i g h t © 2 0 2 1 , V l a d i m i r K a r p u t o v |
/ / | h t t p s : / / w w w . m q l 5 . c o m / r u / m a r k e t / p r o d u c t / 4 3 5 1 6 |
/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
# p r o p e r t y c o p y r i g h t "