DinexSpace Higher Timeframe Range Position
- Indicatori
- Versione: 1.1
DinexSpace Higher Timeframe Range Position is an indicator for MetaTrader 5 (MT5) that shows where the close of each bar stands inside the range of the higher-timeframe candle that is running at that moment. The value runs from 0 (at the low so far) to 100 (at the high so far). For example, on an H1 chart with the daily candle selected, it tells you whether the close is in the lower or the upper part of the day's range so far.
The formula
- For a closed bar, take the bars of the chart from the start of the higher-timeframe candle up to that bar. Let H be their highest high and L their lowest low.
- Position = (Close − L) / (H − L) × 100.
- The range uses only the bars up to the bar itself, so the value of a bar does not change later. Each new higher-timeframe candle starts the range again. If H equals L the value is left empty.
What you get
- The position line in its own window with two dotted levels, 20 and 80 by default.
- Three colours: green above the high level, blue below the low level, orange between. Both levels are inputs.
- Any higher timeframe above the chart timeframe: H4, D1, W1 and so on (D1 by default).
- Panel on the chart: the position, the zone (low, mid or high), the higher timeframe and the bar number inside its candle. You can turn it off or move it to any corner.
- Closed bars only. The number of bars calculated is an input.
How to use it
- Copy DinexHtfRangePosition.ex5 to MQL5\Indicators, or find it in the Navigator under Indicators > Market.
- Drag it onto a chart of a lower timeframe than the one you choose in the inputs.
- Read the line and the panel.
Checked
A test Expert Advisor reads the indicator buffers and colours on every new bar in the Strategy Tester and compares each value with a separate calculation, on EURUSD H1 and GBPUSD M15 with the D1, H4 and W1 higher timeframes and different levels. It prints the number of checks and the number of failed checks.
Notes
- The first bars of a new higher-timeframe candle have a very small range, so the position jumps between 0 and 100 there. Read the bar number in the panel.
- If the data of the higher timeframe is still loading, the indicator waits and calculates again on the next tick.
- The indicator describes where the close stands. It gives no entries or exits and does not predict any move.
Requirements
- MetaTrader 5, any symbol; a chart timeframe below the higher timeframe you choose.
