Market Profile
Market Profile
MetaTrader indicator — is a classic Market Profile implementation that can show the price density
over time, outlining the most important price levels, value area, and control value of a given trading
session. This indicator can be attached to timeframes between M1 and D1 and will show the Market
Profile for daily, weekly, monthly, or even intraday sessions. Lower timeframes offer higher precision.
Higher timeframes are recommended for better visibility. It is also possible to use a free-draw
rectangle session to create a custom market profile on any timeframe. Six different color schemes
are available to draw the profile's blocks. Drawing profiles as a plain color histogram is also possible.
Alternatively, you may choose to color the profile based on bullish/bearish bars. This indicator is
based on bare price action and does not use any standard indicators. It is available for MetaTrader 4,
MetaTrader 5, and cTrader platforms.
A system of alerts is available for prices crossing the levels of Value Area high and low, Median, and
Single Print zones.
Input parameters
Main
Session (default = Daily) — trading session for market profile: Daily, Weekly, Monthly, Intraday,
and Rectangle. For a rectangle session to get calculated, a rectangle chart object with the
name starting with MPR should be added to the chart. Pressing 'r' on the keyboard will add a
properly named rectangle object automatically.
StartFromDate (default = __DATE__) — if StartFromCurrentSession is false, then the indicator
will start drawing profiles from this date. It draws to the past. For example, if you set it
2018-01-20 and SessionsToCount is 2, then it will draw the profiles for 2018-01-20 and
2018-01-19.
StartFromCurrentSession (default = true) — if true, then the indicator starts drawing from
today, else — from the date given in StartFromDate.
SessionsToCount (default = 2) — for how many trading sessions to draw the market profiles.
SeamlessScrollingMode (default = false) — if true, the StartFromDate and
StartFromCurrentSession parameters are ignored; the sessions are calculated and displayed
starting from the current chart position's rightmost bar. This allows scrolling back in time
indefinitely to view past sessions.
EnableDevelopingPOC (default = false) — if true, multiple horizontal lines will be drawn to
depict how the Point of Control developed through the session.
ValueAreaPercentage (default = 70) — a percentage share of the session's TPOs to include in
the Value Area.
Performance
PointMultiplier (default = 0) — the higher it is, the wider are the profile's price boxes and the
fewer are the chart objects. You can use it to reduce the indicator's load on CPU. When the
value is zero, an adaptive multiplier is used — the indicator attempts to calculate the optimal
value automatically.
ThrottleRedraw (default = 0) — a delay in seconds that will be applied before each redraw of
the profiles. You can use it to reduce the indicator's load on CPU.
DisableHistogram (default = false) — if true, no market profile histogram is drawn, but Value
Area and Median are still marked. This makes indicator work extremely fast, but is less useful
for thorough market analysis.
Alerts
AlertNative (default = false) — if true, the indicator will issue the platform's native pop-up alert
when some alert conditions are met.
AlertEmail (default = false) — if true, MetaTrader's email alerts will be sent when some alert
conditions are met. Email should be properly configured in MetaTrader via
Tools->Options->Email
AlertPush (default = false) — if true, MetaTrader's push notification alerts will be sent to your
mobile device when some alert conditions are met. Notifications should be properly configured
in MetaTrader via Tools->Options->Notifications. This alert type is not available in the cTrader
version of the indicator.
AlertArrows (default = false) — if true, MetaTrader will draw arrows on the chart when some
alert conditions are met.
AlertCheckBar (default = Current) — controls the bar to check the alert conditions on. Current
— the indicator will check the current unfinished bar; expect a lot of alerts. Previous — the
indicator will check the previous (closed) bar; alerts will be delayed but more concise.
AlertForValueArea (default = false) — if true, alerts will be issued whenever a Value Area ray
(high or low) is crossed by the price.
AlertForMedian (default = false) — if true, alerts will be issued whenever a Median ray is
crossed by the price.
AlertForSinglePrint (default = false) — if true, alerts will be issued whenever a Single Print ray
is crossed by the price.
AlertOnPriceBreak (default = false) — if true, alerts will be issued when the price breaks any of
the trigger levels but then returns back behind it.
AlertOnBarClose (default = false) — if true, alerts will be issued when the bar opens on one
side the trigger level and closes on the other side of it.
AlertOnGapCross (default = false) — if true, alerts will be issued when the trigger level appears
inside a price gap between the last two bars.
AlertArrowCodePB (default = 108) — arrow code for price break alert arrows.
AlertArrowCodeCC (default = 110) — arrow code for candle close alert arrows.
AlertArrowCodeGC (default = 117) — arrow code for gap crossover alert arrows.
Intraday sessions
EnableIntradaySessionN (default = true) — if true and Session is set to Intraday, then the
indicator will attempt to draw the intraday market profile #N on the chart.
IntradaySessionNStartTime (default = "HH:MM") — start time in HH:MM format for the
intraday session #N.
IntradaySessionNEndTime (default = "HH:MM") — end time in HH:MM format for the intraday
session #N.
IntradaySessionNColorScheme (default = Blue_to_Red) — color scheme for the intraday
session #N.
Miscellaneous
SaturdaySunday (default = Normal sessions) — how to treat Saturday and Sunday sessions:
Normal sessions — Saturday and Sunday will be treated as normal sessions with their
own daily and intraday sessions.
Ignore Saturday and Sunday — Saturday and Sunday candlesticks will be ignored.
Append Saturday and Sunday — Saturday candlesticks will be appended to the Friday
session; Sunday candlesticks will be appended to the Monday session.
DisableAlertsOnWrongTimeframes (default = false) — if true, no pop-up alerts will appear on
using Market Profile with wrong timeframe/session combination.
ProminentMedianPercentage (default = 101) — percentage of TPOs out of all possible that
should occur inside a median for it to be considered prominent (PPOC). For example, if you set
it to 50%, a median will be marked as prominent if it contains at least 24 TPOs in a daily
session on M30 timeframe. If it is set to 101, no prominent median is possible.
Examples
Daily sessions
The chart screenshot shows market profiles calculated and displayed for two daily Forex trading
sessions. The timeframe is M30 and the right-hand daily session is still in progress. The earliest
prices are blue and the latest prices are red. The medians and the value areas are marked with the
white lines and display the most important price areas. Traders tend to return to those areas if the
volume of the breakout movement is not too high. High-volume breakout out of these areas signifies
a real breakout. You can read more about Market Profile in this short e-book: Book on Market Profile.
Bullish/bearish coloring
The example below demonstrates how the Market Profile can be colored according to the direction of
each bar in the session rather than its age. This is done when ColorBullBear is set to true.
Rectangle sessions
This example demonstrates how the indicator can display a market profile based on the rectangle
chart objects freely drawn by a trader. For this to work, a rectangle object's name has to start with
MPR and the Session input parameter has to be set to Rectangle. You can press 'r' on your keyboard
to add such a rectangle to the chart automatically.
Right-to-left display
Market Profile indicator can also draw histogram from right to left. Unlike the traditional left-to-right
display, it can be helpful to focus on the current trading session, without obscuring its chart. You can
see how this works on the chart screenshot below.
cTrader
Market Profile indicator is also available as a free cTrader indicator. It is very similar to its MetaTrader
siblings, but cannot work with push notification alerts.
Downloads (ver. 1.19, 2022-05-17)
MarketProfile indicator is being developed via a dedicated GitHub repository. You are encouraged to
actively participate in the improvement of this indicator by submitting your own features via
pull-requests and reviewing existing suggestions, changes, fixes, and so on.
MT4/MT5
cTrader
Market Profile for cTrader in .algo (compiled file including source code)
The main difference between today's currency market and the futures market of 80's is the lack of
daily trading sessions. Fortunately, it does not produce any real problems. The lack of strict daily
close and daily open can be compensated by one of the following methods:
A rolling 24-hour window for Market Profile calculation. Each new bar, the Market Profile
calculation window is shifted right by one bar as well. This way, a trader is always looking for
the graphical profile of the recent 24 hours of trading. Unfortunately, this would require a
complete recalculation of the whole curve with every new bar arriving. Still, this can be
accomplished by using the Rectangle session type in our Market Profile indicator.
Smaller geographically-bound time windows. The Forex market operates through several
widely recognized trading sessions. The most prominent of them are: London, New York, and
Tokyo. A trader operating mainly inside the New York trading session could use a 10-hour
window based on the NY open and close to calculate and display Market Profile. A trader
operating within a mix of New York and Asian sessions could use the span of both. The good
thing is that with this method, the calculation process is much simpler than with a rolling
window. The bad thing is that it ignores all the market data that is left outside of the target
trading sessions.
Weekly trading sessions. Unlike days, the weeks in Forex are clearly defined. The minor
difference of Sunday/Monday open and Friday/Saturday close between different brokers and
liquidity providers is small enough to ignore (one or two hours of thin-volume trading). Weekly
Market Profile is easy to calculate and offers a lot of data to traders. However, it is rarely
suitable to short-term intraday traders, less so to scalpers.
Apparently, it is still possible to apply Market Profile to modern foreign exchange market. The most
consistent approach seems to be the third one, which is based on weekly sessions.
Another important issue to solve when using this indicator in analysis is whether to apply it to the
current session — and suffer from the lack of data during the early hours — or to the previous session,
which could be based on stale data. In reality, this is no issue at all. As outlined in the CBOT's A
Six-Part Guide to Market Profile, the most important profile is based on the current session, but the
profile built during the previous one is also relevant and should be analyzed by a trader.
Moreover, it is possible (and useful) to look at several previous profiles at once, analyzing how the
trend developed across more than one value area. The multi-session Market Profile analysis is also a
key to detecting long-term areas of balance and states of imbalance. In fact, long-term traders should
be looking at Market Profiles of many sessions to determine possible points of entry and exits.
The following example shows Market Profile calculated for six weekly sessions of the EUR/USD
currency pair:
Usage
As the indicator's author stated, the Market Profile should not be used as a buy/sell signal generator.
It is a tool for analyzing the market and getting information that isn't evident from a bare chart. Here is
how the main parts of the Market Profile can be used in Forex trading:
Value area — the area of market acceptance. The price spent a hefty amount of time at those levels —
the market likes it. The edges of the value area form strong support and resistance levels.
Median — the middle of the value area offers a strong pivot point. It serves both as the attractor for
the price and as the bounce level. The median is also called a fair price. If market is below the level, it
is considered undervalued. If it is above the median, it is overvalued.
Areas of low volume — the long tails below and above the value area show the price areas rejected by
the market. The bottom tail is telling us of long-term buyers outperforming long-term sellers at those
price levels. The top tail is telling us about the long-term sellers doing better than buyers at the
respective price levels.
Even if you aren't a regular user of Market Profile indicator and your main trading strategy is based on
a different concept or if your strategies are either automated with expert advisors or use fundamental
indicators, you can still consult the long-term market profiles in times of doubt when lacking accurate
information on where to put an entry order, take-profit, or stop-loss.
Discussion
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 Market
Profile with the other traders and MQL programmers on the indicators forums.
Changelog
1.19 — 2022-05-17
1.18 — 2022-01-12
Added alerts for crossing Median (Point of Control), Value Area, and Single Print zones.
Added a new ray drawing mode (via the HideRaysFromInvisibleSessions input parameter)
where rays are not shown on the chart if their source sessions are behind the left edge of the
screen. This helps to reduce chart clutter when working with many sessions at once.
Improved performance in both MT4 and MT5 version of the indicator.
Fixed a bug with session colors in latest MT5 builds.
Fixed Value Area lowest edge — it is now drawn at its real level.
Fixed a bug when all rays could disappear when a new session started.
1.17 — 2021-07-17
Added a developing POC option to show how the Point of Control (median) developed during
the session.
Added style and width input parameters for all lines and rays.
Added a hotkey (r) to place a properly named rectangle chart object in the Rectangle session
mode.
Added an input parameter (ValueAreaPercentage) to control how many TPOs (the profile's
building blocks) should be captured by the Value Area.
Added an option for Single Print rays to mark the edges of single print profile ranges.
Fixed time zone shift parameter (TimeShiftMinutes) to work properly with Intraday sessions.
1.16 — 2020-12-07
Added an input parameter (DisableHistogram) to prevent the indicator from drawing profile
histograms (TPO's). Value area and point of control are still drawn in this mode.
Added an input parameter (RightToLeft) for right-to-left histogram display. Works for the
current trading session for non-Rectangle session types, and for all trading sessions for
Rectangle session type.
Added adaptive point multiplier option via setting the PointMultiplier input parameter to 0
(which is now default).
1.15 — 2020-07-14
Added Rectangle session type to display market profile based on rectangle objects added to
the chart. It works on any timeframe. A rectangle should have a name starting with MPR to be
detected by the indicator.
Added single print highlighting (ShowSinglePrint and SinglePrintColor input parameters).
Added prominent median (PPOC) highlighting (ProminentMedianPercentage and
ProminentMedianColor input parameters).
1.14 — 2020-01-26
1.13 — 2019-10-18
Added ColorBullBear input parameter to color the market profile according to bars' directions.
Added DisableAlertsOnWrongTimeframes input parameter to disable popup alerts when
Market Profile is applied to a wrong timeframe.
Added optional printouts for Value Area High, Value Area Low, and Point of Control rates for
each profile.
Added grouping for input parameter in MT5 version of the indicator.
1.12 — 2019-03-27
Added RaysUntilIntersection input parameter, which helps to hide the rays of the previous
sessions' median and value area that have already been violated by newer trading sessions.
Fixed a bug with TPO display when the symbol's TickSize is higher than _Point ×
PointMultiplier.
1.11 — 2019-01-20
Fixed a bug when empty holes could appear in the profile when the current session was built.
Fixed a bug that prevented current session profile from drawing from the first bar.
Fixed some potential 'array out of range' errors.
1.10 — 2018-12-25
Fixed potential array out of range error when old chart with Market Profile indicator is
reopened.
1.09 — 2018-12-24
Added two alternative options for dealing with Saturday and Sunday candlesticks.
Added more flexibility to displaying Median and Value Area rays.
Changed Median to draw as a single line inside the value area.
Reduced the size of the working arrays significantly, which should make MP calculation on
some trading instruments faster.
1.08 — 2018-05-28
1.07 — 2018-02-06
1.06 — 2017-11-30
Added proper object cleanup when Market Profile is used with chart templates.
1.05 — 2017-11-23
Added optional display for the previous session's Value Area High/Low lines.
Added time shift input parameter to move the sessions across time zones.
1.04 — 2016-11-07
1.03 — 2016-01-25
1.01 — 2011-12-11
1.00 — 2010-07-23