Loading…

Murrey Math Lines

Murrey Math levels divide a recent trading range into eighths and treat those eighths as proportional support and resistance - the 0/8 and 8/8 lines as the "ultimate" support and resistance of the range, 4/8 as the major average line price tends to gravitate back to, and -1/8 and 9/8 as the extreme lines that mark a genuine breakout of the range rather than a routine test of it. This implementation uses the equal-eighths construction: it takes the highest high and lowest low over a rolling lookback, divides that range into eight equal intervals, and extends one interval below and above for the -1/8 and 9/8 frame lines. It deliberately does not use Gann's original price-scaled rounding table from the source book, which snaps the octave size to a fixed geometric ladder keyed to the instrument's price magnitude (designed for 1920s-era US equities, not a five-digit FX quote). The equal-eighths version is what nearly every MetaTrader port of this indicator actually uses, and it is what makes the labels useful as proportional bands on any symbol without a rounding table tuned to a different market. This is stated plainly rather than claiming an exact replica of the original book formula. The range only recalculates once a new bar completes, using the highest high and lowest low of the InpPeriod bars before the current one. Excluding the still-forming current bar means the grid does not shift several times a minute on a busy tick feed - it moves once, when a bar actually closes. Notes and limitations - This is the equal-eighths construction, not Gann's original price-scaled rounding table - see the full description for why that is the correct choice for a general-purpose FX/CFD indicator. - The grid recalculates once per completed bar, so intrabar price action on the current bar can move outside a level before the grid itself updates on the next close. - Level lines are drawn across the whole chart width (OBJ_HLINE); they are not clipped to the lookback window, so they extend both into history and into the future beyond the range that produced them. - Object names are prefixed and removed cleanly in OnDeinit.

Indicator · MT4 · v1.0 · Free

About Murrey Math Lines

Murrey Math Lines is an indicator for MetaTrader 4. It has 7 settings, such as Period, Extreme color and Major color. MQL source code included.

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

Settings

SettingDefaultWhat it does
Period64Rolling lookback bars used for the high/low range
Extreme colorclrCrimsonColour of the 0/8 and 8/8 ultimate support/resistance lines
Major colorclrDodgerBlueColour of the 4/8 major average (trigger) line
Minor colorclrSlateGrayColour of the remaining eighth lines
Frame colorclrGoldenrodColour of the -1/8 and 9/8 extreme frame lines
Line styleSTYLE_SOLIDLine style for the minor lines
Line width1Line width for the minor lines

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: Grid · Breakout · Support & Resistance · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria