Loading…

Round Number Levels

Round numbers get watched whether or not anyone draws a line on them, so marking them saves the trader from doing it by eye on every chart. The trap most versions of this indicator fall into is a hardcoded step - "every 50 pips" works for a 5-digit FX major and is meaningless on XAUUSD or an index CFD quoted with two decimals and a four-figure price. This indicator picks its step from the symbol itself: digit count first (distinguishing 5/4-digit FX majors from JPY-style 3/2-digit quotes), then, for anything that is neither, the current price's own magnitude, so a $20 instrument and a $2,000 one both end up with a readable grid instead of sharing the same absolute step. A manual override input exists for the symbols the heuristic still gets wrong. Every level line is anchored to the nearest multiple of the step below price, so the ladder always includes a genuinely round number rather than one offset by wherever price happens to sit at the moment it draws. Major lines - every Nth level - carry a price label; minor lines do not, to keep a wide ladder legible. Notes and limitations - This is a static reference grid, not a signal - it never alerts and carries no trade logic. - The ladder is rebuilt from the current Bid each time it redraws, so all levels can shift together the moment price crosses into a different step bucket - this is expected, not a glitch. - With InpRedrawOnNewBar set to false, objects are recreated on every tick, which is heavier than the default and rarely necessary since round levels do not move fast. - Levels priced at or below zero are silently skipped rather than drawn off-scale.

Indicator · MT4 · v1.0 · Free

About Round Number Levels

Round Number Levels is an indicator for MetaTrader 4. It has 11 settings, such as Levels each side, Manual step and Major every. MQL source code included.

Files in the download: RoundNumberLevels.ex4, RoundNumberLevels.mq4, RoundNumberLevels.txt.

Settings

SettingDefaultWhat it does
Levels each side10Number of levels to draw, each side of price
Manual step0.0Manual step override (0 = auto from digits/price)
Major every5Major line every Nth level (1 = all major)
Minor colorclrSilverMinor line colour
Major colorclrDodgerBlueMajor line colour
Minor styleSTYLE_DOTMinor line style
Major styleSTYLE_SOLIDMajor line style
Minor width1Minor line width
Major width1Major line width
Show labelstrueShow price label on major lines
Redraw on new bartrueRecompute levels once per new bar (false = every tick)

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Gold (XAUUSD) · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria