OPEN-SOURCE SCRIPT

HTF Candles Overlay [Trendoscope®]

Обновлено
🎲 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.
Информация о релизе
Update to V6
Информация о релизе
Fix display
Candlestick AnalysisCandlestick analysishewhomustnotbenamedtrendoscope

Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Хотите использовать этот скрипт на графике?


Мои профили:

Отказ от ответственности