Higher Timeframe Bias
- Göstergeler
- Sürüm: 1.0
- Etkinleştirmeler: 5
# Higher Timeframe Bias - The higher timeframe without deception
*Category: Multi Timeframe Hybrids | Difficulty: intermediate | Window: separate window below the chart | Markets: Universal (Forex, indices, commodities, crypto, stocks) | Suggested timeframes: M5, M15, M30, H1, H4*
## Short description
> Brings a higher timeframe direction onto the current chart using only already closed bars, avoiding the most insidious form of repaint.
## Full description
### Overview
Multi timeframe indicators nearly all suffer from the same problem, and nearly none declares it. The forming bar of the higher timeframe changes value until it closes, so an indicator using it shows historical values that were not yet available in real time. It is the most insidious form of repaint, because the chart looks perfect and nobody notices until they actually try trading it, discovering that real time signals are far less clean than historical ones. This indicator uses exclusively already closed higher timeframe bars: the direction shown on every bar is exactly what was available at that moment, verifiable historically and reproducible in real time. The price of that honesty is a maximum lag of one higher timeframe bar.
### How the calculation works
1. For every bar of the current chart the higher timeframe bar containing it is located.
2. The immediately preceding bar is then taken, that is the last one fully closed at that moment.
3. On that bar and the preceding ones the average close and the higher timeframe ATR are computed.
4. The direction is the deviation of the higher close from its own average, divided by the ATR.
5. ATR normalisation makes the value comparable across instruments and across periods with different volatility.
6. If the specified timeframe is not higher than the current one it is automatically corrected to the first natural multiple.
### How to use it
- Use the colour as a directional filter: trade only in the direction indicated by the higher timeframe.
- The gold strength line says how pronounced the direction is: low values indicate an undecided higher timeframe.
- The colour change occurs with at most one higher bar of lag: the price of having no repaint.
- Leaving the timeframe on automatic is the safest choice: it picks a sensible multiple of the current one.
- Check the history before trusting it: being repaint free, what you see is what you would have seen.
### Who it is for and on which timeframes
It targets traders working low timeframes who want to respect the direction of higher ones, that is most intraday traders. It works from M5 to H4. The one higher bar lag is deliberate and unavoidable: anyone seeking an instantaneous reading of the higher timeframe is seeking something that does not exist in real time. It is also a good basis for automation, because historical and real behaviour coincide.
### Practical example of reading a signal
A trader works M15 with an H4 filter. At ten in the morning the indicator is green: the last closed H4 bar, the eight o'clock one, closed above its own average. The trader looks only for long entries. Around half past eleven price falls sharply and the forming H4 bar, the twelve o'clock one, would already be below the average: an indicator using it would change colour at that moment, then turn green again if price recovered before twelve. Here the colour stays green until the H4 bar actually closes, and the displayed value never changes retroactively. It is less responsive, but what you see on the history is exactly what you would have seen while trading.
## Input parameters
| Parameter | Default | Description |
|---|---|---|
| `InpHigherTf` | PERIOD_CURRENT | Higher timeframe to read. Leaving the default value selects the first natural multiple of the current one automatically. |
| `InpMaPeriod` | 20 | Period of the average computed on the higher timeframe. It defines what counts as direction on that horizon. |
| `InpAtrPeriod` | 20 | ATR period on the higher timeframe, used to normalise the deviation. |
| `InpFlatLevel` | 0.30 | Minimum deviation in ATR to declare a direction. Below this threshold the higher timeframe is deemed undecided. |
## Advantages / strengths
- It avoids the most insidious form of repaint, the one afflicting nearly every multi timeframe indicator.
- The history shows exactly what would have been seen in real time, so visual backtesting is trustworthy.
- ATR normalisation makes the value comparable across different instruments and timeframes.
- The higher timeframe is chosen automatically and corrected if set inconsistently.
## Limitations and warnings
- The one higher bar lag is structural: on H4 it means up to four hours of waiting.
- Accessing another timeframe data requires the history to be already downloaded, otherwise the first values are missing.
- It uses a single directional criterion, deviation from the average, which is simple but not exhaustive.
- On instruments with limited higher timeframe history the indicator stays neutral for a long time.
**No repaint:** values printed on a closed bar are never modified afterwards.
**Disclaimer.** This product is a technical analysis tool, not an automated trading system, and it offers no profit guarantee whatsoever. Financial markets carry the risk of total loss of the invested capital. Past performance is not indicative of future results. Every signal must be confirmed with your own analysis, a money management plan and prior testing on a demo account. The author is not responsible for trading decisions taken on the basis of this indicator.
## Suggested tags / keywords for MQL5
`multi timeframe`, `trend filter`, `no repaint`, `higher timeframe`, `bias`, `atr`, `confirmation`, `intraday`
