🎲 HTF Candles Overlay is a simple indicator where you can overlay higher timeframe candles on current timeframe chart.
Most of the code is encapsulated in the library HTFCandlesLib. After publishing the library as open source, many people requested to convert that into an indicator. Based on this, we decided to publish this small code for the use of community.
🎯 Usage The indicator is simple, it helps users visualise higher timeframe candles. We majorly use this for debugging or validating our implementations based on higher timeframe. Instead of switching back and forth to different timeframes, it helps us visualise higher timeframe candles on the same chart when we are validating the implementation that involves higher timeframe calculations.
🎯 Components
The indicator provides two types of displays
Candles - overlay candles built through lines and labels
Plot - close price of higher timeframe plotted on chart
🎯 Candles The behaviour of the candles are similar to that of hollow candles. The color of the body and the border+wick demonstrates the movement of the candle.
Body color is lime if the HTF close is higher than HTF open. Body color is orange if the HTF close is lower than the HTF open.
Wick and border color is lime if HTF close price is higher than previous HTF close price. And they are orange if HTF close price is lower than the previous HTF close price
In most cases body color will be same as the wick color. In case of stocks and indices, it may happen that the open price is too far away from previous close price due to gaps. This can lead to close price being relatively in different direction when compared to open and previous close.
Wicks are not at the centre of the candle. Instead wicks are drawn on the current chart timeframe position where the current timeframe has reached the highest or lowest point within the given HTF candle
Candles also list OHLC price of HTF candle along with HTF bar index and the range of LTF bar index that the candle spawns
Here are some pictorial representations that can help understand better.
Here are the examples of candles with gaps where body and wick/border are in different directions (colours)
🎯 Indicator Settings Simple settings allow users to select the timeframe, whether to display candles and plots and their specific colors.
🎯 Possible inconsistencies The overlay can show inconsistent data in certain situations. Here are some of the scenarios where the indicator may not show consistent display of the data.
When the HTF data from request.security does not match that of combined LTF data. In such cases, HTF candles may not form inline with the current timeframe candles. This happens when there is a data issue of different OHLC data available in tradingview.
When using weekly candle as either chart timeframe or higher timeframe - end of week may not coincide with end of month or other timeframes. This can cause some inconsistencies in the visuals of the indicator.
When open and close time of either LTF or HTF falls under different day due to time zone used. - time is always the time on which the candle close. So, when we use time zone that causes the exchange day to open and close on different days, that can cause some inconsistencies in the candles being drawn.
진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.