PROTECTED SOURCE SCRIPT
Updated

Range Chart Time Analyzer by Shresht

215

DISCLAIMER :
This indicator is provided for informational and educational purposes only. It is not intended as financial, investment, or trading advice. The calculations and data presented by this indicator are based on available historical information and predefined logic, which may not always reflect real-time market conditions accurately.
I do not guarantee the accuracy, reliability, or completeness of the values displayed by this indicator. Users should independently verify any data before making trading decisions. I am not responsible or liable for any losses, damages, or financial consequences resulting from the use of this indicator.
By using this indicator, you acknowledge and accept full responsibility for any actions taken based on its output. Always conduct your own research and consult with a qualified financial professional before making any investment or trading decisions.



Range-Chart Time Analyzer

Make your Range Chart Complete

  • Overview:
    This indicator is specifically designed for Range Charts. Unlike traditional charts, Range Charts plot bars at varying time intervals. This indicator helps visualize these "time warps" by calculating the difference between the opening time of the current bar and the opening time of the previous bar, along with their averages. Additionally, it offers optional settings to display Green-only, Red-only, or Green vs. Red averages .
  • Time Unit:
    This indicator uses seconds as the unit of measurement for time
  • Logic: At its core, it relies solely on the opening time of each candle. The averages are calculated based on the time difference between consecutive pair of bars. For example, with a length of 3, the average is computed as:
    [(Opening Time of 3rd Bar−Opening Time of 2nd Bar)+(Opening Time of 2nd Bar−Opening Time of 1st Bar)] / 2
  • Features :
    ~Three Averages
    ~Green Candle only Average , Red Candle only Average and Green vs Red Average ( Green only Average minus Red only Average )
  • Inputs/Settings :~Reference Bar: When the indicator is first added to the chart, it will prompt you to select a Reference Bar. This selection can be changed later without reapplying the indicator by either specifying the timestamp in the settings or adjusting the slider that appears above the red "R" label when hovering over it. The Reference Bar allows you to calculate an average starting from a specific point in time, such as the beginning of a trading session or a significant event like a news release or an announcement.

    ~Session Breaker: This feature ensures that averages are not skewed by the large time gap between trading sessions, i.e., the last candle of the previous session and the first candle of the current session. It is measured in seconds, as mentioned earlier. Set it to a large number of seconds, but ensure that it is less than the actual time gap between sessions.

    ~ Length and Length 2: The default Length is set to 2, allowing you to see individual differences. It is important to understand the following: WHEN LENGTH IS 2, THE AVERAGE DISPLAYED BELOW A CANDLE REPRESENTS THE DIFFERENCE BETWEEN THE PREVIOUS CANDLE'S OPEN TIME AND THE CURRENT/LATEST CANDLE'S OPEN TIME. BECAUSE, IN RANGE CHARTS, THE CLOSE OF THE PREVIOUS CANDLE AND THE OPEN OF THE CURRENT CANDLE ARE THE SAME, THIS MAY RESULT IN A RED-COLORED COLUMN APPEARING BELOW A GREEN CANDLE IF THE PREVIOUS CANDLE WAS RED. HOWEVER, THIS DOES NOT AFFECT THE ACCURACY OF THE RED ONLY OR GREEN ONLY AVERAGES. THIS INDICATOR IS ALWAYS "ONE CANDLE AHEAD" IN ITS PLOTTING.
    Length 2 is used to calculate a third, larger average with a custom length of your choice.

    ~ Length for Green Only Average and Length for Red Only Average: These inputs define the lookback period for calculating the average of a specific candle color. A crucial point to remember is that when displaying the Green vs Red Average, both these inputs must be set to the same value to ensure an accurate comparison.





DISCLAIMER :
This indicator is provided for informational and educational purposes only. It is not intended as financial, investment, or trading advice. The calculations and data presented by this indicator are based on available historical information and predefined logic, which may not always reflect real-time market conditions accurately.
I do not guarantee the accuracy, reliability, or completeness of the values displayed by this indicator. Users should independently verify any data before making trading decisions. I am not responsible or liable for any losses, damages, or financial consequences resulting from the use of this indicator.
By using this indicator, you acknowledge and accept full responsibility for any actions taken based on its output. Always conduct your own research and consult with a qualified financial professional before making any investment or trading decisions.

Release Notes
DISCLAIMER :
This indicator is provided for informational and educational purposes only. It is not intended as financial, investment, or trading advice. The calculations and data presented by this indicator are based on available historical information and predefined logic, which may not always reflect real-time market conditions accurately.
I do not guarantee the accuracy, reliability, or completeness of the values displayed by this indicator. Users should independently verify any data before making trading decisions. I am not responsible or liable for any losses, damages, or financial consequences resulting from the use of this indicator.
By using this indicator, you acknowledge and accept full responsibility for any actions taken based on its output. Always conduct your own research and consult with a qualified financial professional before making any investment or trading decisions.



Range-Chart Time Analyzer ( in Version 6 )

Make your Range Chart Complete


  • Overview:
  • This indicator is specifically designed for Range Charts. Unlike traditional charts, Range Charts plot bars at varying time intervals. This indicator helps visualize these "time warps" by calculating the difference between the opening time of the current bar and the opening time of the previous bar, along with their averages .
  • Time Unit:
    This indicator uses seconds as the unit of measurement for time
  • Logic:
    ~At its core, it relies solely on the opening time of each candle. The averages are calculated based on the time difference between consecutive pair of bars. For example, with a length of 3, the average is computed as:
    [(Opening Time of 3rd Bar−Opening Time of 2nd Bar)+(Opening Time of 2nd Bar−Opening Time of 1st Bar)] / 2
    ~To visualize the time between the open and close of an individual candle, you can choose from two options: one with 'Gap' correction and one without. Since the current version of Pine Script only allows access to the open time of a candle, it is impossible to accurately plot the time between a candle's open and close. 'Gap' correction adds a small value to ensure that a candle opening after a significant gap is properly assessed against others, or a candle whose next candle opens after a significant time.

  • Inputs/Settings :
    ~Reference Bar: When the indicator is first added to the chart, it will prompt you to select a Reference Bar. This selection can be changed later without reapplying the indicator by either specifying the timestamp in the settings or adjusting the slider that appears above the red "R" label when hovering over it. The Reference Bar allows you to calculate an average starting from a specific point in time, such as the beginning of a trading session or a significant event like a news release or an announcement.
    ~Session Breaker: This feature ensures that averages are not skewed by the large time gap between trading sessions, i.e., the last candle of the previous session and the first candle of the current session. It is measured in seconds, as mentioned earlier. Set it to a large number of seconds, but ensure that it is less than the actual time gap between sessions in seconds .
    ~ Length and Length 2 : These are length for other two averages .


This indicator is provided for informational and educational purposes only. It is not intended as financial, investment, or trading advice. The calculations and data presented by this indicator are based on available historical information and predefined logic, which may not always reflect real-time market conditions accurately.
I do not guarantee the accuracy, reliability, or completeness of the values displayed by this indicator. Users should independently verify any data before making trading decisions. I am not responsible or liable for any losses, damages, or financial consequences resulting from the use of this indicator.
By using this indicator, you acknowledge and accept full responsibility for any actions taken based on its output. Always conduct your own research and consult with a qualified financial professional before making any investment or trading decisions.
Release Notes
Additional Notes added in settings .
Release Notes
.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.