Popular results
Position Sizer
Calculate risk-based position size directly in your MetaTrader platform and execute a trade in one click or a press of a button.What Is Forex
Learn what Forex is and how it works from this simple explanation.Supertrend
Download the Supertrend indicator for MT4 and MT5 to detect trend changes based on the price action.Position Size Calculator
Calculate your position size based on risk, stop-loss, account size, and the currencies involved. A simple online calculator for quick results.WRB Hidden Gap
WRB Hidden Gap MetaTrader indicator — detects and marks WRB. WRB is either a Wide Range Bar (a very long bar) or Wide Range Body (a candlestick with very long body). As WRB by themselves do not offer much information, the indicator also detects Hidden Gaps based on the WRB. It also shows filled and unfilled Hidden Gaps differently, so that it is easier to see the current market situation at a single glance. Optional alerts can be used to get signals when the current price first enters an unfilled Hidden Gap, when a new WRB or HG appears, and when a hidden gap gets filled. The indicator is available for both MT4 and MT5.
Input parameters
- Timeframe (default = PERIOD_CURRENT) — a timeframe to use to calculate wide range bars (WRBs) and hidden gaps (HGs). Cannot be lower than the current timeframe.
- UseWholeBars (default = false) — if true, the indicator will search for Wide Range Bars instead of Wide Range Bodies.
- WRB_LookBackBarCount (default = 3) — how many bars to use in WRB comparison. The bigger the value the rarer and wider detected WRB.
- WRB_WingDingsSymbol (default = 115) — a symbol used to mark WRB. A small diamond by default.
- HGcolorNormalBullishUnbreached (default = clrDodgerBlue) — the color for normal unbreached Hidden Gap rectangles, originating from bullish bars.
- HGcolorIntersectionBullishUnbreached (default = clrBlue) — the color for unbreached Hidden Gap rectangles, originating from bullish bars and intersecting a previous Hidden Gap.
- HGcolorNormalBearishUnbreached (default = clrIndianRed) — the color for normal unbreached Hidden Gap rectangles, originating from bearish bars.
- HGcolorIntersectionBearishUnbreached (default = clrRed) — the color for unbreached Hidden Gap rectangles, originating from bearish bars and intersecting a previous Hidden Gap.
- HGcolorNormalBullishBreached (default = clrPowderBlue) — the color for normal breached Hidden Gap rectangles, originating from bullish bars.
- HGcolorIntersectionBullishBreached (default = clrSlateBlue) — the color for breached Hidden Gap rectangles, originating from bullish bars and intersecting a previous Hidden Gap.
- HGcolorNormalBearishBreached (default = clrLightCoral) — the color for normal breached Hidden Gap rectangles, originating from bearish bars.
- HGcolorIntersectionBearishBreached (default = clrSalmon) — the color for breached Hidden Gap rectangles, originating from bearish bars and intersecting a previous Hidden Gap.
- HGstyle (default = STYLE_SOLID) — line style for the Hidden Gap rectangles.
- StartCalculationFromBar (default = 100) — number of bars to look back to mark up the Wide Range Bodies and Hidden Gaps.
- HollowBoxes (default = false) — if true, the rectangles marking the Hidden Gaps will be empty, otherwise — filled.
- AlertBreachesFromBelow (default = true) — if true, alerts will be issued when the current price enters a previously unfilled Hidden Gap territory from below.
- AlertBreachesFromAbove (default = true) — if true, alerts will be issued when the current price enters a previously unfilled Hidden Gap territory from above.
- AlertHG (default = false) — if true, alerts will be issued when a new Hidden Gap appears.
- AlertWRB (default = false) — if true, alerts will be issued when a new WRB appears.
- AlertHGFill (default = false) — if true, alerts will be issued when a Hidden Gap gets filled.
- EnableNativeAlerts (default = false) — if true, a native MetaTrader popup alert will be used when an alert condition is fulfilled.
- EnableEmailAlerts (default = false) — if true, an email message will be sent when an alert condition is fulfilled. Email should be properly configured in MetaTrader via Tools->Options->Email.
- EnablePushAlerts (default = false) — if true, an email message will be sent when an alert condition is fulfilled. Notifications should be properly configured in MetaTrader via Tools->Options->Notifications.
- ObjectPrefix (default = "HG_") — prefix for chart objects for compatibility with other indicators.
Example and strategy
The chart shows an example of Hidden Gap markup on the EUR/USD daily timeframe with default settings. The red diamonds are drawn inside WRB bars. Hidden Gaps are depicted using rectangles of various colors. Unfilled Hidden Gaps are shown with rectangles spanning past the right edge of the chart. Hidden Gap rectangles change color when an unfilled Hidden Gap of another color currently exists and intersects with a new Hidden Gap. The image shows only Wide Range Bodies (UseWholeBars = false). As you can see, there isn't much difference when switching to Wide Range Bars (UseWholeBars = true):
This indicator does not generate any trading signals. It offers information about price action to aid a trader with entry and exit signals generated by some other strategy. WRB bars are nearly meaningless, but only WRB can show a Hidden Gap. A Hidden Gap, in its turn, can be treated as a sort of pivot or support/resistance zone. Hidden Gaps can also be treated as the usual price gaps (weekly, for example).
An entry signal (by some trading system) coinciding with the price entering a Hidden Gap rectangle can be considered confirmed, while the opposite edge of the rectangle can be used as a target level. If your system generates a trade outside the Hidden Gap territory, the latter can be used either as take-profit or as stop-loss.
Download (ver. 1.04, 2024-03-15)
WRB Hidden Gap for MetaTrader 4 in .zip WRB Hidden Gap for MetaTrader 4 in .mq4 WRB Hidden Gap for MetaTrader 5 in .zip WRB Hidden Gap for MetaTrader 5 in .mq5Discussion
Warning! If you do not know how to install this indicator, please read the MetaTrader Indicators Tutorial.
Do you have any suggestions or questions regarding this indicator? You can always discuss WRB Hidden Gap with the other traders and MQL programmers on the indicators forums.
Changelog
1.04 - 2024-03-15
- Added separate alerts for breaching a hidden gap from above and from below.
- Added a new alert signal for the price filling a hidden gap.
- Changed how the indicator reacts to setting the Timeframe input parameter to a value lower than the chart's current timeframe. It will no longer fail to load, but will rather use the current timeframe's data for its calculations.
1.03 - 2023-08-03
- Added support for multi-timeframe (MTF) operation to display higher timeframe wide range bars and hidden gaps on the current timeframe.
- Added new colors to denote hidden gaps originating from bullish and bearish bars, breached and unbreached hidden gaps.
- Added new alert conditions: WRB appears, hidden gap appears.
- Changed default arrow color and width for the WRB display to be more noticeable.
1.02 - 2022-04-09
- Added support for all three types of alerts — native (popup), email, and mobile notifications.
- Added the input parameter for chart object names' prefix.
- Optimized calculation algorithm.