On this page
What Market Profile measures
Market Profile arranges prices by the number of candle ranges that include each level. In this implementation one TPO means one selected-timeframe candle touching a grid price through its Low–High range. It is not traded volume, tick volume or an exact record of seconds spent at that price. The indicator draws analysis objects; it does not place orders.
ForexBestRobots edition 1.26 is a marked derivative of EarnForex 1.25 under Apache 2.0. We made completed and developing value-area calculations consistent across MT4/MT5, stabilized the price grid, aligned the VAL label with its drawn boundary and protected instance namespaces. Original notices, unchanged originals and a patch are included.
POC is the most populated price row. The source also calls it Median, but it is a mode, not a statistical median or proof of a fair price. VAH and VAL bound a chosen share of TPOs; 70% is a calculation setting, not a forecast or win rate. A single print means one contributing candle, not evidence about buyers or sellers.
TPO, POC and the value-area calculation
For each grid price p, N(p)=Σ1{Low≤p≤High}: every selected candle contributes at most one TPO to that row. Repeated quotes within the candle add nothing. Neither tick_volume, real volume nor our CSV QuoteCount weights the profile. A candle range can include prices that the supplied ticks skipped, so this remains an OHLC approximation.
POC uses the highest N(p). Ties choose the row nearest the middle of the session price grid, then the higher row. From POC, the value area grows one adjacent row at a time, choosing the side with the larger count; equal counts choose the upper side. The edition uses ceil(total TPO×70/100), so the included count reaches at least the selected percentage. Whole rows can overshoot it.
A row is drawn one price step high. VAL is the lower edge of the lowest included row; VAH is one step above the highest included row. Our VAL text now matches the actual lower line. These are descriptive reference levels, not guaranteed support, resistance or executable prices.
PointMultiplier=0 adapts row height to the visible price scale, so changing chart zoom can change the profile. Use a fixed multiplier for repeatable comparisons. On a five-decimal EUR/USD symbol, 10 points=0.00010 and 50 points=0.00050. The edition preserves non-power-of-ten steps and rounds up to a valid symbol tick-size multiple. Different row sizes or TPO timeframes produce different levels.
Three real EUR/USD examples
The figures use real HistData EUR/USD Bid quotes from June 2025, aggregated to M30. The supplied timestamps are fixed EST without daylight-saving adjustment; we add five hours for UTC. We reconstructed 236 candles from 507,552 selected quote records. Provider Volume is zero; neither it nor the number of quote records is used as TPO weight.
The two daily profiles use 48 candles each and a fixed 10-point row. For 4 June, POC/VAH/VAL are 1.13850/1.14170/1.13660; for 5 June they are 1.14430/1.14500/1.14130. Final levels become known only at 00:00 UTC on the following day. Drawing them beside earlier candles is a retrospective summary, not an earlier signal.
The second figure changes only the row size on the same 5 June candles. The third rebuilds 6 June from each closed M30 prefix, with snapshots known at 06:00, 12:00 and 21:00 UTC. The last snapshot is not a complete calendar day. Candle and price-row CSVs preserve the inputs and the time each result became available; no trades or returns are simulated.



Real Bid OHLC from HistData; own TPO reconstruction, not a MetaTrader screenshot or a profit backtest. CSV files contain candles and price-row counts; all times are UTC.
Download chart calculation data (CSV) · 1Download chart calculation data (CSV) · 2Download chart calculation data (CSV) · 3
TPO · Download chart calculation data (CSV) · 1TPO · Download chart calculation data (CSV) · 2TPO · Download chart calculation data (CSV) · 3
Sessions, timeframes and the broker clock
The default is Daily, two sessions, with TPOTimeframe=PERIOD_CURRENT. Daily profiles require TPO data from M5 to M30; Weekly uses M30–H4, Monthly H1–D1, Quarterly H4–D1, and Semiannual/Annual H4–W1. Intraday requires M30 or lower. Rectangle mode uses a manually selected range and still needs sufficient loaded history.
TPOTimeframe may equal or exceed the chart timeframe; a lower request falls back to the chart timeframe. Our edition requires a whole timeframe multiple. Whole higher-timeframe candles are used, including candles that straddle a chosen boundary. Historical values filled across a parent candle are retrospective; an unfinished TPO candle can change. Wait for its close when evaluating an event.
Session boundaries use the broker chart clock. TimeShiftMinutes shifts that clock boundary: positive moves the session start earlier, negative later. It does not automatically follow daylight saving. The four preset intraday windows are 00:00–06:00, 06:00–12:00, 12:00–18:00 and 18:00–00:00. They are not automatically synchronized to London or New York. Weekend settings keep, ignore or append Saturday/Sunday; data above D1 cannot separate those days.
All settings and defaults
The table contains all 92 functional inputs shared by MT4 and MT5. MT4 also has text separators. Values shown are source defaults: __DATE__ is the compile date, not a daily clock update. Begin with two sessions and a fixed grid on a demo chart. Large session ranges, many rows and developing calculations can be expensive.
| Input | Default | Practical meaning |
|---|---|---|
Session | Daily | Daily by default. Daily, Weekly, Monthly, Quarterly, Semiannual, Annual, Intraday or Rectangle. |
StartFromDate | __DATE__ | Compile date. Used when current-session mode and seamless scrolling are both off. |
StartFromCurrentSession | true | Starts with the newest session; takes priority over StartFromDate. |
SessionsToCount | 2 | Number of sessions, 1–1000. Default 2; more is slower. |
SeamlessScrollingMode | false | Uses the right edge of the visible chart; ignores the two start-date inputs. Not for Rectangle. |
EnableDevelopingPOC | false | Draws changing POC history; off by default. |
EnableDevelopingVAHVAL | false | Draws changing VAH/VAL history; off by default. |
ValueAreaPercentage | 70 | Integer 1–100. Includes at least this share of total TPOs, with whole-row overshoot. |
TPOTimeframe | PERIOD_CURRENT | Current or higher; lower selections fall back to chart. Requires a whole chart-timeframe multiple. |
InstancePrefix | "FBR-MP" | Unique 1–12 ASCII letters, digits or hyphens. Default FBR-MP; conflicts are rejected. |
ColorScheme | Blue_to_Red | One of six color gradients, or Single_Color. |
SingleColor | clrBlue | Color of the named object or event family. |
ColorBullBear | false | Colors blocks by candle direction instead of age; not buy/sell volume. |
MedianColor | clrWhite | Color of the named object or event family. |
ValueAreaSidesColor | clrWhite | Color of the named object or event family. |
ValueAreaHighLowColor | clrWhite | Color of the named object or event family. |
MedianStyle | STYLE_SOLID | Line style: solid, dash, dot or the other terminal options. |
MedianRayStyle | STYLE_DASH | Line style: solid, dash, dot or the other terminal options. |
ValueAreaSidesStyle | STYLE_SOLID | Line style: solid, dash, dot or the other terminal options. |
ValueAreaHighLowStyle | STYLE_SOLID | Line style: solid, dash, dot or the other terminal options. |
ValueAreaRayHighLowStyle | STYLE_DOT | Line style: solid, dash, dot or the other terminal options. |
MedianWidth | 1 | Line/arrow width 1–5. |
MedianRayWidth | 1 | Line/arrow width 1–5. |
ValueAreaSidesWidth | 1 | Line/arrow width 1–5. |
ValueAreaHighLowWidth | 1 | Line/arrow width 1–5. |
ValueAreaRayHighLowWidth | 1 | Line/arrow width 1–5. |
ShowValueAreaRays | None | Which sessions project rays: None, Previous, Current, PreviousCurrent, AllPrevious or All. |
ShowMedianRays | None | Which sessions project rays: None, Previous, Current, PreviousCurrent, AllPrevious or All. |
RaysUntilIntersection | Stop_No_Rays | Stop no rays, all rays, all except previous session, or only the previous session at intersection. |
HideRaysFromInvisibleSessions | false | Hides rays from sessions outside the left edge of the chart. |
TimeShiftMinutes | 0 | Broker session shift, −1440 to +1440 minutes; positive earlier, negative later. |
ShowKeyValues | true | Prints POC, VAH and VAL; true by default. |
KeyValuesColor | clrWhite | Color of the named object or event family. |
KeyValuesSize | 8 | Text size 1–72, default 8 in the terminal. |
ShowSinglePrint | No | No, Leftside or Rightside: marks rows with one contributing TPO. |
SinglePrintRays | false | Projects single-print zone boundaries as rays; false by default. |
SinglePrintColor | clrGold | Color of the named object or event family. |
SinglePrintRayStyle | STYLE_SOLID | Line style: solid, dash, dot or the other terminal options. |
SinglePrintRayWidth | 1 | Line/arrow width 1–5. |
SPRaysUntilIntersection | Stop_No_Rays | Stop no rays, all rays, all except previous session, or only the previous session at intersection. |
ProminentMedianColor | clrYellow | Color of the named object or event family. |
ProminentMedianStyle | STYLE_SOLID | Line style: solid, dash, dot or the other terminal options. |
ProminentMedianWidth | 4 | Line/arrow width 1–5. |
ShowTPOCounts | false | Counts TPOs above/below POC, excluding the POC row; not volume. |
TPOCountAboveColor | clrHoneydew | Color of the named object or event family. |
TPOCountBelowColor | clrMistyRose | Color of the named object or event family. |
RightToLeft | false | Draws the latest profile, or all Rectangle profiles, from right to left. |
PointMultiplier | 0 | 0 adaptive; 1–1000000 manual quote-point multiplier, rounded up to valid tick size. |
ThrottleRedraw | 0 | Update delay 0–86400 seconds; 0 adds no intentional delay. |
DisableHistogram | false | Hides histogram blocks while retaining POC/value-area calculations and marks. |
EnableOldProfilesCleanup | false | Removes older profiles beyond SessionsToCount. |
AlertNative | false | Native popup channel; false by default. |
AlertEmail | false | Email channel; terminal setup required. Messages omit account identity. |
AlertPush | false | Push channel; terminal setup required. |
AlertArrows | false | Draws event arrows, including qualifying historical events; false by default. |
AlertCheckBar | CheckPreviousBar | CheckPreviousBar uses closed candles; CheckCurrentBar uses unfinished prices. |
AlertForValueArea | false | Enables VAH/VAL ray events; corresponding rays must be drawn. |
AlertForMedian | false | Enables POC ray events; corresponding rays must be drawn. |
AlertForSinglePrint | false | Enables single-print ray events; SinglePrintRays must be true. |
AlertOnPriceBreak | false | Previous: wick reaches level then close returns. Current: previous-quote crossing. |
AlertOnCandleClose | false | Consecutive-close crossing of a ray; current mode is not a completed-candle confirmation. |
AlertOnGapCross | false | Gap crossing relative to the prior candle range. |
AlertArrowCodePB | 108 | Wingdings arrow code 0–255. |
AlertArrowCodeCC | 110 | Wingdings arrow code 0–255. |
AlertArrowCodeGC | 117 | Wingdings arrow code 0–255. |
AlertArrowColorPB | clrRed | Color of the named object or event family. |
AlertArrowColorCC | clrBlue | Color of the named object or event family. |
AlertArrowColorGC | clrYellow | Color of the named object or event family. |
AlertArrowWidthPB | 1 | Line/arrow width 1–5. |
AlertArrowWidthCC | 1 | Line/arrow width 1–5. |
AlertArrowWidthGC | 1 | Line/arrow width 1–5. |
EnableIntradaySession1 | true | Enables this window when Session=Intraday. |
IntradaySession1StartTime | "00:00" | Window start in HH:MM, broker clock before the time-shift adjustment. |
IntradaySession1EndTime | "06:00" | Window end in HH:MM; 00:00 means the next midnight. |
IntradaySession1ColorScheme | Blue_to_Red | One of six color gradients, or Single_Color. |
EnableIntradaySession2 | true | Enables this window when Session=Intraday. |
IntradaySession2StartTime | "06:00" | Window start in HH:MM, broker clock before the time-shift adjustment. |
IntradaySession2EndTime | "12:00" | Window end in HH:MM; 00:00 means the next midnight. |
IntradaySession2ColorScheme | Red_to_Green | One of six color gradients, or Single_Color. |
EnableIntradaySession3 | true | Enables this window when Session=Intraday. |
IntradaySession3StartTime | "12:00" | Window start in HH:MM, broker clock before the time-shift adjustment. |
IntradaySession3EndTime | "18:00" | Window end in HH:MM; 00:00 means the next midnight. |
IntradaySession3ColorScheme | Green_to_Blue | One of six color gradients, or Single_Color. |
EnableIntradaySession4 | true | Enables this window when Session=Intraday. |
IntradaySession4StartTime | "18:00" | Window start in HH:MM, broker clock before the time-shift adjustment. |
IntradaySession4EndTime | "00:00" | Window end in HH:MM; 00:00 means the next midnight. |
IntradaySession4ColorScheme | Yellow_to_Cyan | One of six color gradients, or Single_Color. |
SaturdaySunday | Saturday_Sunday_Normal_Days | Normal days, ignore weekend candles, or append Saturday to Friday and Sunday to Monday. |
DisableAlertsOnWrongTimeframes | false | Suppresses timeframe-error popups; does not make an invalid combination valid. |
ProminentMedianPercentage | 101 | 0–101. POC prominence threshold; 101 disables prominence highlighting. |
ShowToggleButton | false | Shows the hide/show control; hidden profiles pause normal updates and alert checks. |
ToggleButtonCorner | CORNER_LEFT_UPPER | Chart corner for the optional hide/show button. |
Rays, alerts and practical controls
Alerts need three choices: a delivery channel or AlertArrows, an enabled level family and an enabled event type. All are off by default. Median/value-area alerts examine rays, so enable ShowMedianRays or ShowValueAreaRays for the relevant sessions; a visible profile boundary alone is insufficient. Single-print alerts require SinglePrintRays.
CheckPreviousBar evaluates closed chart candles. Candle-close events compare two consecutive closes across the ray; a prior strict side and a new equality can count. Price-break events detect a wick reaching the ray and closing back on the previous side. Gap events compare separated candle ranges. Arrows are placed on the event candle and become observable after its close; historical arrows are retrospective.
The first live-alert pass after attach/reset is silent. CheckCurrentBar uses unfinished prices and can produce repeated events; all its price-break rays now share the same previous quote. Email/push require terminal configuration and a running connection. After the hide button has hidden an already drawn profile, normal updates and alert checks pause until it is shown again.
Install and compile the source
- Extract the ZIP for your platform. In desktop MetaTrader choose File → Open Data Folder.
- Copy Indicators/Market_Profile_ForexBestRobots.mq4 or .mq5 into the matching MQL4/Indicators or MQL5/Indicators folder. Keep upstream files separately.
- Open the modified source in the matching MetaEditor, press F7 and inspect errors and warnings. No extra includes or DLL are required.
- Refresh Navigator → Indicators, attach to a demo M30 chart with loaded history and use a unique InstancePrefix. Daily and two sessions are the defaults.
- For Rectangle mode, press r or create a rectangle named MPR0–MPR999, at most 6 characters and no underscore. Ctrl+1–8 selects Daily through Rectangle. Test time boundaries before using the levels.
Source only: no ready EX4/EX5. Native compilation, chart rendering, rectangle controls and notifications have not been verified here. Desktop MetaEditor and a demo-terminal check are required; these files cannot be installed directly in the mobile app.
Download Market Profile free
Both ZIPs download directly from our site. Each contains the modified platform source, unchanged upstream source, Apache 2.0, edition notes, a patch, checksums and instructions in 12 languages. These are source packages, with no ready EX4/EX5, DLL or trading account requirement.
MQ4/MQ5 source only · no ready EX4/EX5 · compile in matching desktop MetaEditor.
Data limits and performance
Broker OHLC, session clock, loaded history, TPO timeframe and row size all affect the result. Current-session levels develop; a completed profile must not be used as if it were known at the session open. Rectangle mode includes whole selected TPO candles and clips the price range. MPR rectangles can be seen by multiple instances, so use deliberate ranges and unique prefixes.
A row-grid guard rejects more than 2,000,000 levels; it is not a performance guarantee. Fewer sessions, a coarser grid, DisableHistogram, ThrottleRedraw or old-profile cleanup can reduce work, with a loss of detail where applicable. Native compilation, terminal rendering, hotkeys, dragging, file persistence and actual message delivery have not been verified here; test in the matching desktop terminal.
Frequently asked questions
Is this Volume Profile?
No. Counts come from candle Low–High ranges touching price rows, once per candle and row. Neither real volume nor tick volume weights them.
Why does the source call POC Median?
That is the source label. It selects a maximum-count row, a mode, not a statistical median or an objective fair price.
Does 70% mean a 70% chance of winning?
No. It is the share of profile TPO counts enclosed by the value area. Whole rows may take the actual share above the target.
Why do levels differ between two charts?
Check broker OHLC and clock, session dates, TPO timeframe, row size, loaded history and weekend policy. Adaptive PointMultiplier=0 also depends on the visible scale.
Can the lines change or look ahead?
The active session and unfinished TPO candle change. Final-session lines and parent-timeframe values drawn across earlier candles are retrospective. Our developing CSV uses only each closed-bar prefix.
Why are there no alerts?
Enable a channel or arrows, a level family and an event type. Draw the corresponding rays, keep the profile visible and configure terminal email/push if used. Attach/reset is silent for live events.
How are session changes and multiple instances handled?
Use Ctrl+1–8 or Session, and r for an MPR rectangle without underscores. The terminal stores session/visibility state under MQL4/Files/MP_Settings or MQL5/Files/MP_Settings. Each instance needs a unique valid prefix; never delete its hidden lock while it runs.
Sources and edition changes
Original copyright © 2010–2026 EarnForex.com is retained. This is our marked edition 1.26 of upstream 1.25, not an endorsement by EarnForex. The pinned repository has Apache 2.0 and no NOTICE file. We tested selected actual calculation and control functions through C++ with modeled APIs and independent comparisons; that is not native MetaTrader execution.