Gap and Weekend Map: Analyzing Gap Fill Behavior Relative to ATR

Gap and Weekend Map: Analyzing Gap Fill Behavior Relative to ATR
Download ALL MT5 indicators (6068)
YouTube Video Thumbnail



Similar MetaTrader Tools

Gap and Weekend Map: Analyzing Gap Fill Behavior Relative to ATR

Info

The Gap and Weekend Map: Analyzing Gap Fill Behavior Relative to ATR is a Indicator for MetaTrader 5 that gap and weekend map: measuring gap fill rate, fill time and gap size relative to atroverviewmany gap indicators simply mark gaps without providing further analysis. Traders, however, are primarily concerned with whether gaps on a specific instrument tend to fill, how quickly this occurs, and if the gap's size influences the probability of it filling.

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 Gap and Weekend Map: Analyzing Gap Fill Behavior Relative to ATR

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

Gap and Weekend Map: Measuring Gap Fill Rate, Fill Time and Gap Size Relative to ATROVERVIEWMany gap indicators simply mark gaps without providing further analysis.

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 Weekend Gap Analysis: Size, Fill Time, and ADR Context - another powerful indicator for MetaTrader 5 traders.

Gap and Weekend Map: Measuring Gap Fill Rate, Fill Time and Gap Size Relative to ATR

Also recommended: Spread Heatmap: Hourly Spread Analysis by Day and Time - similar indicator with strong performance on MetaTrader 5.


OVERVIEW

Many gap indicators simply mark gaps without providing further analysis. Traders, however, are primarily concerned with whether gaps on a specific instrument tend to fill, how quickly this occurs, and if the gap's size influences the probability of it filling. These factors vary significantly between brokers, symbols, and timeframes due to differences in session times, instrument characteristics, and available price history. This indicator quantifies these aspects directly on your chart.

To ensure comparability across different symbols, several definitions are employed:

Gap.
A gap occurs when a bar opens above the previous bar's high (up gap) or below the previous bar's low (down gap). The size of the gap is the distance from the open price to the previous bar's high or low.

Size in ATR.
Gap size is normalized by dividing it by the Average True Range (ATR) of the previous bar. A gap size of 0.5 ATR indicates a gap equal to half of a typical bar's range, making comparisons consistent across indices, stocks, or crypto CFDs. Only gaps of at least InpMinGapAtr are recorded.

Weekend gap.
A gap is classified as a weekend gap if it occurs after a break between two bars exceeding InpWeekendHours in duration. The length of a single bar is not considered a break, meaning consecutive bars on any timeframe from M1 to D1 will not trigger this flag. Extended holiday breaks can also be identified.

Fill level.
Determined by the InpFillMode input. The default setting, FILL_PREV_CLOSE, signifies that the gap is considered filled when the price reaches the previous bar's closing price. Alternative options include the gap edge (the high or low of the previous bar, indicating a partial fill) and the far extreme of the previous bar (representing a complete retracement of that bar's range).

Fill time.
This measures the number of bars required from the gap bar until the price reaches the specified fill level. The gap bar itself is counted as bar 0, meaning a fill time of 0 indicates the gap was filled within the same bar.

Three outcomes.
A gap is considered
filled
if the fill level is reached within InpMaxBars bars. It is
expired
if the level is not reached by the last allowed bar. Gaps that fall within this window but have not yet reached the fill level are considered
open
. Open gaps are excluded from the fill rate calculation to provide a more accurate representation of completed fills.

The indicator employs an incremental calculation method. On each update, only new bars and the currently forming bar are processed. Gaps are evaluated against subsequent bars only, preventing historical rescan on every tick. While a gap can be filled by a forming bar, its expiration status is only finalized after the last allowed bar has closed, ensuring that gap statuses do not change retroactively.

WHAT TO LOOK OUT FOR

Boxes on the main chart.
Each gap is visually represented by a box spanning from the previous bar's high or low to the gap's open price, starting on the gap bar. The box concludes one bar after the bar that determined the gap's status (fill or expiration), or one bar after the last bar if the gap remains open. Gray boxes indicate filled gaps, white boxes denote open gaps, and dotted dark boxes signify gaps not filled within the InpMaxBars limit. Weekend gaps are highlighted with a thicker outline.

Dashed line.
A dashed line indicates the fill level for each gap, drawn over the same duration as the box. For filled gaps, the line extends to the price level where the fill occurred.

Histogram in the indicator window.
A histogram bar is plotted for each gap on the gap bar's timeframe. Up gaps are displayed above zero, and down gaps below zero, with the height representing the gap size in ATR. Bars are capped at InpPlotCapAtr for visual clarity; the precise value is available in the Data Window. Colors correspond to the gap's status: gray for filled, white for open, and dark gray for expired.

Dot above or below a bar.
Indicates a weekend gap.

Dotted levels.
Horizontal dotted lines are displayed at +/- InpBucket1 and +/- InpBucket2 , marking the boundaries of the three gap size categories used in the panel.

Data Window.
Displays the signed, unclipped gap size under

You may also like: Opening Gap Tracker: Daily, Weekend Gaps with Fill Tracking and Alerts - 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_separate_window
#property indicator_buffers 6
#property indicator_plots   4
#property indicator_label1  "Gap size (ATR, clipped)"
#property indicator_type1   DRAW_COLOR_HISTOGRAM
#property indicator_color1  clrGray,clrWhite,clrDimGray

.......

Leave your opinion, ask a question, share some knowledge

⚠ 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.
© ROBOTFX Free educational tools by RobotFX. Use entirely at your own risk; we are not liable for any financial losses incurred.