What it does
FXP Supply & Demand finds the price areas where the market paused briefly and then left with force. A demand zone is a small base followed by a strong bullish candle; a supply zone is a small base followed by a strong bearish candle. Each zone is drawn as a rectangle that extends to the right and carries a label showing its state.
Zones start as fresh, become tested when price returns into them (the label counts the tests), and are broken when a candle closes through the far side.
How it works
- Volatility is measured with a 14-period ATR (Wilder smoothing).
- A departure candle has a body of at least 1.5 x ATR (default). Before it, the indicator counts up to 3 consecutive base candles whose bodies are at most 0.5 x ATR.
- Demand: the departure closes bullish and above the base high. The proximal (near) edge is the highest open or close of the base; the distal (far) edge is the lowest low of the base and departure candle.
- Supply: the departure closes bearish and below the base low. Proximal edge = lowest open or close of the base; distal edge = highest high of the base and departure.
- On each later closed candle: if the close goes beyond the distal edge, the zone is broken. Otherwise, if the wick reaches the proximal edge, the zone is tested; one visit counts as one test until price leaves the zone again.
- Only closed candles are evaluated, and only new bars are processed.
How to use it
Copy the .ex5 file into MQL5/Indicators and attach it to a chart.
Fresh zones are where many supply and demand traders look first, because the orders that caused the departure may not have been fully filled. Each test tends to weaken a zone. Higher-timeframe zones (H4, D1) can frame trades taken on lower timeframes. Treat zones as areas rather than exact prices, and compare them with classic support and resistance.
If too many zones appear, raise the departure multiple or lower the base body limit. Turning off overlap skipping shows every zone, including nested ones.
Settings
| Input | Default | What it changes |
|---|---|---|
| Max base candles | 3 | Longer bases allowed when larger. |
| Base candle body at most (x ATR) | 0.5 | How quiet a base candle must be. |
| Departure candle body at least (x ATR) | 1.5 | How strong the move away must be. |
| ATR period | 14 | Volatility reference. |
| Skip zones overlapping a live zone | true | Avoids duplicate zones. |
| History bars to analyse | 2000 | Look-back for drawing. |
| Broken zones | Keep as grey | Grey out or delete. |
| Max live zones per side / max broken | 6 / 10 | Caps on drawn zones. |
| Extend live zones right by N bars | 10 | Projection beyond the last candle. |
| Zone colors | by state | Fresh, tested and broken colors. |
| Show zone state labels | true | Text labels on each zone. |
| Alert on new zone / first test | false | One alert per bar. |
Limitations
- The rules are a mechanical approximation; discretionary traders draw zones with more judgment and will disagree with some of them.
- Wide zones mean wide stops. Check the distance in pips with a pip calculator before planning a trade.
- Zones are only known after the departure candle closes.
- A zone can fail on the first test. Always define your risk in advance. Trading involves substantial risk of loss.

