Market Profiles.mq4 — Forex Session Boxes & High-Low Range Indicator for MT4 (Updated 2025)

If you love trading with session structure—Asia, London, and New York—the Market Profiles.mq4 indicator is a clean, lightweight way to shade trading sessions and optionally snap the rectangles to session high/low. Originally attributed to MetaQuotes / KimIV, with styling tweaks by cja, this tool draws colored rectangles across the last N days so you can instantly read where ranges built and where breakouts came from.

What the indicator does

  • Draws separate rectangles per day for defined sessions (Asia, Europe/London, US, plus special overlaps like “London Open–Tokyo Close”, “US Open–London Close”, “News” window).
  • You can choose to snap boxes to the session’s true high/low, or fill the full price height of your sub-window (via HighLow flag).
  • Uses object labels in the indicator sub-window to show session names and times.
  • Lets you set number of days to display (NumberOfDays).
  • Every session has its own Start/Stop time and color, so you can tailor your map to your broker timezone and style.

Key features (at a glance)

  • Session mapping: Asia, Europe (London), US, and custom windows like overlaps & news slots.
  • High/Low mode: When HighLow = true, each session’s rectangle vertically spans that session’s high to low.
  • Lightweight & visual: Only uses rectangles and labels; doesn’t slow down your charts.
  • Daily look-back: Control how many days to mark (NumberOfDays).
  • Custom colors: Set distinct colors for instant visual scan.
JustMarkets

Download the Indicator for MT4

You can download both the ready-to-use EX4 file and the editable MQ4 source code for free below.

How it works (under the hood)

  1. On init, the indicator:
    • Sets the short name Mkt for the separate window.
    • Deletes any prior session rectangles, then creates a bank of rectangles for each session for the last NumberOfDays.
  2. On start, it:
    • Prints a small legend (“ASIA = Green, EUROPE = Red, USA = Blue”).
    • Writes label objects for session names & times in the sub-window.
    • For each of the last NumberOfDays:
      • Calls DrawObjects() per session to position each rectangle between Start and Stop times.
      • Uses iBarShift() to get bar indexes matching the session time window.
      • Calculates the session high and low with Highest / Lowest across the bar range.
      • If HighLow == true, sets rectangle top/bottom to that high/low; else uses a full-height fill.
    • Steps backward using decDateTradeDay() while skipping weekends to get prior trading days.
Market Profiles.mq4

Inputs you can tune

  • NumberOfDays = 10 — How many past days to draw.
  • Start_1 ... Start_7 / Stop_1 ... Stop_7 — Session start/stop times (strings like "08:00").
  • Colour_1 ... Colour_7 — Colors for each session.
  • HighLow = true — If true, rectangles snap to session high/low; if false, rectangles fill the sub-window vertically.

Sessions in this template

  • Colour_1 US, Colour_2 Europe, Colour_3 Asia
  • Colour_4 London Open – Tokyo Close (overlap)
  • Colour_5 US Open – London Close (overlap)
  • Colour_6 Tokyo–Hong Kong open
  • Colour_7 “News” window
    (Two extra sessions 8 and 9 are present but commented out.)

Important code notes (fix these for clean compiling)

  • RGB limits: MQL4 color literals C'R,G,B' must be 0–255. Your snippet has values like C'549,111,0', C'268,0,136', C'438,90,238' which exceed 255 and can cause invalid colors.
    • Suggested replacements:
      • C'549,111,0'C'236,130,0' (orange)
      • C'268,0,136'C'168,0,136' (magenta/purple)
      • C'438,90,238'C'138,90,238' (blue-violet)
  • Object IDs: The code creates many labels (e.g., "MKT", "b0MKT", "MKT1", …). If you load multiple copies on the same chart, IDs will clash. Consider prefixing with the chart ID or indicator handle if you’ll use multiples.
  • Window placement: It draws labels with WindowFind("Mkt"). If you rename the short name, update this reference.
  • Full-height mode: In DrawObjects(), the line if (!HighLow) { p1=0; p2=2*p2; } is a hack. For a clean full-rectangle fill, set a fixed top/bottom using WindowPriceMax() and WindowPriceMin() or draw in the main chart window with price coordinates and OBJPROP_BACK = true.

How to install (MT4)

  1. Open MT4 → File → Open Data Folder
  2. Go to MQL4 → Indicators
  3. Paste Market Profiles.mq4 (or compiled .ex4) into the folder
  4. Restart MT4 or right-click Navigator → Refresh
  5. Drag Market Profiles from Navigator → Indicators → Custom onto your chart
  6. Set your Start/Stop times to match broker time; choose colors; set HighLow mode → OK

Practical usage ideas

  • Asia range → London breakout: Mark the Asia box; trade London breakouts beyond the session high/low.
  • Overlap momentum: The US–London overlap (e.g., 15:00–19:00 server time in this preset) often has the highest volume—use that rectangle to concentrate your strategies.
  • News window isolation: Use the “NEWS” session box to avoid whipsaws or to plan fade/continuation plays post-release.
  • Mean reversion: If price expands far beyond a session box and re-enters, watch for reversion back to the box midline or opposite edge.
  • HTF/MTF confluence: Keep H1/H4 boxes for context; execute on M5–M15 with tighter risk.

Pro tips for cleaner charts

  • Use muted fills (e.g., set low opacity colors) so price remains visible.
  • Keep NumberOfDays modest (5–15) to avoid clutter.
  • Align session times to your broker’s server—DST shifts can alter overlaps; update times seasonally if needed.
  • Pair with structure tools: Previous Day High/Low, VWAP, or a session midpoint line for added precision.

Troubleshooting

  • Boxes don’t show: Ensure your chart timeframe has enough history to cover NumberOfDays × sessions; check Start/Stop times are within your broker day.
  • Colors look wrong: Replace any C'R,G,B' values > 255 with valid RGB (0–255).
  • Misaligned session windows: Your broker/server timezone is different—offset Start/Stop by the difference from your intended session time (consider DST).

Conclusion

The Market Profiles.mq4 indicator for MT4 provides a simple yet powerful way to visualize global trading sessions — Asia, London, and New York — directly on your chart. By highlighting these time blocks with colored rectangles, traders can instantly see when volatility shifts, overlaps occur, and where the day’s liquidity builds up. Whether you trade breakouts from the Asian session or momentum during the London–New York overlap, this indicator helps you time your trades with more precision. Adjust session times for your broker’s timezone, choose your favorite colors, and you’ll have a clear, structured view of the market rhythm every day.

FAQ — Market Profiles MT4 Indicator

Does the Market Profiles indicator repaint?

No — the indicator draws static rectangles based on fixed session times. Once a day’s session box is drawn, it remains unchanged unless you alter the Start/Stop times or refresh the chart.

Why are some session boxes misaligned?

Session times are calculated using your broker’s server time. If the boxes appear offset, simply adjust the Start_x and Stop_x inputs to match your preferred time zone or daylight saving schedule.

Can I add more sessions or change colors?

Yes! You can duplicate one of the existing Start_x / Stop_x / Colour_x blocks in the code and assign it a new label or time range. You can also use any RGB color value within the 0–255 range for custom styling.

Does it slow down MT4?

Not at all. The script uses simple rectangle objects — no loops on every tick — making it extremely light even when displaying multiple days of session data.

Can I use it on synthetic indices or gold?

Yes, you can. Just remember that non-forex markets may have different trading hours, so adjust the session times to match the instrument’s activity zones for best visual accuracy.

⚠️ Disclaimer

The Market Profiles.mq4 indicator is provided for educational and analytical purposes only. It does not constitute financial advice or a guaranteed trading system. Past performance of any trading tool or indicator is not indicative of future results. Always test indicators on a demo account before using them with real funds.

Forex and synthetic index trading involve significant risk and may not be suitable for all investors. By downloading or using this indicator, you agree that the developer and website are not responsible for any losses, damages, or decisions made based on its use. Trade responsibly and always apply sound money management.

Download the Indicator for MT4

You can download both the ready-to-use EX4 file and the editable MQ4 source code for free below.

Share your love
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments