🎲 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 אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יוכלו להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אבל השימוש החוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.