OPEN-SOURCE SCRIPT

Dynamic Time Period Candles

This indicator gives the dynamic history of the current price over various time frames as a series of candles on the right of the display, with optional lines on the chart, so that you can assess the current trend more easily.

In the library I found lots of indicators that looked at the previous xx time period candle, but they then immediately switched to the new xx time candle when it started to be formed. This indicator looks back at the rolling previous time period. With this indicator, you can clearly see how price has been behaving over time.

IMPORTANT SETUP INFO:
Initially, you must go into the settings and select the timeframe (in minutes) that your chart is displaying. If you don't do this then the indicator will look back the wrong number of candles and give you totally wrong results.

You can then setup how high you want the candle labels to be on the chart.
Then you can select settings for each candle that you want displayed. Anywhere between 1 and 5 different timeframes can be displayed on the chart at once.


I initially published an indicator called 'Dynamic 4-Hour Candle (Accurate Highs and Lows)', but this new indicator is so different that it needs to be forked and published as a separate indicator. The reasons for this are below:

  1. The original indicator only looked at the previous 4 hour time period. This indicator allows the user to select any time period that they choose.
  2. The original indicator only looked at one time period. This indicator allows to select between one and five time periods on the chart at once.
  3. The original indicator did not put lines on the chart to show the lookback period and the highs and lows of that time period. This indicator does both those things.
  4. The name of the original indicator in no way now describes what this new indicator is capable of, and would be very misleading to anyone who came across it. This new indicator has a name that much more accurately reflects what its' purpose and functionality is.
candleCandlestick analysishighlookbackLOWmultitimeframeperiodTIMEtimeframetrendTrend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer