Buying in the expensive half of a move is where a lot of Gold (XAUUSD) trades go wrong. This indicator takes the last confirmed swing high and swing low as the dealing range, splits it at 50 percent and shades the top half as premium and the bottom half as discount, the way ICT traders read it.
On top it marks the OTE band, 62 to 79 percent of the last leg. If the swing low came first the leg is up and the band sits in discount for buys. If the swing high came first it sits in premium for sells. A swing counts only when 5 bars on each side confirm it, so nothing moves on the forming candle. A second mode uses the highest high and lowest low of the last 100 closed bars.
It only marks where price sits inside the range. It does not say buy or sell. Use it as a filter next to your own entry, for example longs only from discount in an uptrend.

Any symbol and any timeframe. It draws with standard chart objects (rectangles, trend lines and text) and never trades. On the first run and on every new bar it recalculates from the history on the chart. Push notifications need your MetaQuotes ID in the terminal options. Wrong inputs stop it with a message in the log.
Run it on XAUUSD, XAGUSD, EURUSD, GBPUSD, US30 or NAS100 and compare M15, H1 and H4, and swing strength 3, 5 and 10. From an EA you can read it with iCustom: buffer 0 is the range high, buffer 1 the range low, buffer 2 the equilibrium and buffer 3 the zone of each bar (1 premium, -1 discount), buffers 4 and 5 the top and bottom of the OTE band. It fits next to Smart Money Concepts structure, order blocks or fair value gaps: take the setups that form in discount for buys and in premium for sells. XP_IsSwingHigh, XP_IsSwingLow and the drawing helpers are small functions you can lift into your own code.
Open source. Use it as it is, adapt it, build your own version on top of it. New versions and new tools are announced first on my MQL5 channel: https://www.mql5.com/en/channels/xander. Questions, suggestions and your own backtests are welcome in the Xander Lab group: https://www.mql5.com/en/messages/02eec85e4364dd01. More tools on my profile: https://www.mql5.com/en/users/09151993a. Provided as is, use at your own risk.
Related: Smart Money Concepts BOS CHoCH, Order Blocks Zones SMC, Fair Value Gap Zones Tracker, Liquidity Sweep Equal Highs Lows.
v1.0 (2026-11-20): initial release.
Opening Range Breakout EA Gold
Opening range breakout EA for MT5 on Gold (XAUUSD), forex and indices: trades the first candle that closes outside the opening range, stop at the range, target in multiples of the stop, lot by risk, end of day close. Open source code.
Spectar Prop Challenge Dashboard
Read-only panel with the numbers a prop-style challenge is judged on: today's result from server midnight (closed plus floating), room to your daily loss limit, static or trailing overall floor, profit target and trading days.
Daily Loss and Profit Lock
Daily loss limit EA for MT5 on prop firm and funded accounts, Gold (XAUUSD), forex and indices: closes every position at the daily loss or profit limit, deletes pending orders and locks trading until the next day. Open source code.
PDH PDL Sweep Levels
Previous day high and low indicator for MT5 on Gold (XAUUSD), forex and indices: PDH, PDL, previous week high and low, day and week open, and an arrow when a closed candle sweeps a level and closes back inside. Open source code.