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精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?

免責聲明