What it does
FXP Premium & Discount splits the current dealing range into three areas. The upper half is the premium zone, where price is expensive relative to the range; the lower half is the discount zone, where price is cheap relative to the range; and a thin equilibrium band marks the 50% level between them.
The range is taken from the most recent confirmed swing high and swing low, so it updates automatically as the market forms new swings.
How it works
- Swing highs and lows are confirmed with a pivot length on both sides (10 by default): a swing high is a candle whose high is above the highs of the 10 candles before and after it.
- The range top is the latest confirmed swing high and the range bottom the latest confirmed swing low. With the stretch option on, the top becomes the highest high traded since that swing high, and the bottom the lowest low since that swing low, so the range never sits inside current price.
- Equilibrium = bottom + (top - bottom) / 2. The equilibrium band is centered on this value with a height equal to the chosen percentage of the range.
- Three rectangles are drawn from the older of the two swings to a few bars past the last candle: premium (band top to range top), equilibrium (the band) and discount (range bottom to band bottom).
- Swings are scanned only on newly closed candles; the zone edges are refreshed on each update.
How to use it
Copy the .ex5 file into MQL5/Indicators and attach it to a chart.
The idea is simple: in an uptrend, many traders prefer to buy in discount rather than chase price in premium, and in a downtrend they prefer to sell in premium. The zones do not tell you when to enter; they tell you whether the current price is relatively high or low inside the swing that matters. Pair them with a structure tool, an order block or a Fibonacci retracement for timing.
Use a larger pivot length on lower timeframes if the range jumps around too often. H1 and H4 ranges are a common reference for intraday forex and gold trading.
Settings
| Input | Default | What it changes |
|---|---|---|
| Swing pivot length | 10 | Larger values give a wider, more stable range. |
| Equilibrium band height (% of range) | 5.0 | Thickness of the neutral band. |
| Stretch range when price trades beyond it | true | Keeps the range wrapped around current price. |
| History bars to scan for swings | 1000 | Look-back for finding swings. |
| Extend zones right by N bars | 15 | Projection beyond the last candle. |
| Premium / equilibrium / discount color | red / grey / green | Zone colors. |
| Show zone labels | true | Text labels on the right edge. |
| Alert when a close moves into premium/discount | false | One alert per closed candle that changes zone. |
Limitations
- Only the current range is drawn; historical ranges are not kept, so you cannot review past zones on the chart.
- With the stretch option on, the zone edges move with the live candle while price makes new extremes. Alerts use closed candles only.
- The range changes whenever a new swing is confirmed, which happens a full pivot length after the turning point.
- "Cheap" and "expensive" are relative to one swing only. Price can stay in premium for a long time in a strong trend. Use a stop-loss and keep risk small. Trading involves substantial risk of loss.

