Loading…

Profile Ledge Detector

Every profile tool in this catalogue already finds the point of control - the single busiest price. A ledge is a different shape entirely: not a spike, a plateau. This scans the merged tick-volume profile of a chosen broker-time session across InpLookbackDays calendar days for runs of consecutive buckets whose volume stays within InpFlatnessRatio of each other (the run's own highest bucket divided by its lowest stays under that ratio), extending each run as far as it can while that flatness test still holds. A flat run only counts as a genuine ledge once it is at least InpMinLedgeBuckets wide AND the bucket immediately outside at least one end falls to no more than InpDropRatio times the run's own average volume - the abrupt drop-off that distinguishes a real ledge from merely where the profile happens to taper off gradually or where the scanned range simply ends. Buckets are weighted by tick volume using the standard bar-overlap spread used throughout this catalogue, since MT4 has no true per-price-level volume to read directly. Each qualifying ledge draws as a shaded box across its price range, with a dashed line marking whichever edge (or edges) showed the abrupt drop - the wall a market-profile trader would read as support or resistance built from where trade concentrated and then sharply thinned out. Notes and limitations - Every volume figure is MT4 tick volume (price update count), never real traded contracts or lots. - A ledge at either extreme of the scanned price range is only checked against its one existing neighbour; reaching the edge of the scanned range itself also counts as a qualifying "drop" there, which can occasionally mark the very top or bottom bucket of a session as a ledge even without a true volume cliff. - Rebuilds once per new bar, not every tick; a large InpLookbackDays on a low timeframe increases rebuild cost accordingly. - No trade or stop-loss logic - visual analysis only.

Indicator · MT4 · v1.0 · Free

About Profile Ledge Detector

Profile Ledge Detector is an indicator for MetaTrader 4. It has 10 settings, such as Session start hour, Session end hour and Lookback days. MQL source code included.

Files in the download: ProfileLedgeDetector.mq4, ProfileLedgeDetector.txt.

Settings

SettingDefaultWhat it does
Session start hour8Session start hour (broker time, 0-23)
Session end hour16Session end hour (broker time, 0-23)
Lookback days10Calendar days of session instances merged into the profile
Bucket pips4.0Bucket width, in pips
Max buckets250Hard cap on bucket count (performance guard)
Min ledge buckets3Minimum consecutive buckets to call a run a ledge
Flatness ratio1.35Max(volume)/min(volume) allowed inside a ledge run
Drop ratio0.45Neighbour bucket must fall to at most this fraction of the ledge average
Ledge colorclrGoldenrodLedge box colour
Drop edge colorclrRedDrop-off edge line colour

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: Volume · Trading Sessions · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria