renkotimev2
Download scriptUnderstanding the Renko Time Indicator
This tool is designed to provide traders with a visual representation of the speed at which price action is developing on a Renko chart. Unlike standard charts that move based on fixed time intervals (like every minute or hour), Renko charts are "time-independent," meaning they only create a new block when the price moves a specific amount. Because of this, the actual time it takes for a new block to form can vary significantly depending on market volatility.
How the Logic Works:
The indicator works by measuring and calculating the "waiting time" between consecutive blocks. Here is the step-by-step breakdown of its logic:
- Historical Analysis: The script looks back at previous blocks on your chart and calculates the exact number of seconds that passed between one block finishing and the next one appearing.
- Real-Time Tracking: For the most recent (live) block, the script continuously calculates the difference between the current market time and the time the current block began.
- Visual Representation: These time differences are then plotted on a separate window below your main chart as a histogram.
What This Means for the Trader:
By looking at this histogram, you can visually identify periods of high activity versus stagnation:
- Short Time Intervals: If the bars on the indicator are small, it means blocks are forming very quickly. This signals high market volatility and rapid price movement.
- Long Time Intervals: If the bars on the indicator are tall, it means a long period has passed without a new block forming. This signals a "sideways" market or a period of low liquidity where the price is struggling to make significant moves.
Essentially, this tool translates price action into a time dimension, allowing you to see exactly how fast (or slow) the market is moving in real-time.
//--- Renko Time Indicator - time difference between candles / bricks / blocks
#property copyright "Copyright 2015, Paul Reed."
#property version "2.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue
#property indicator_width1 2
#property indicator_minimum 0 // Set indicator fixed min is 0
double timebuffer[]; // Buffer to hold the array of time differences
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int OnInit(void)
{
IndicatorDigits(0); // We don't need to display fractions of a second!
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,timebuffer);
IndicatorShortName("RenkoTime v 2.0");
SetIndexLabel(0,"Seconds");
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
int i,limit;
limit=rates_total-prev_calculated; // Set limit to the number of candles
if(prev_calculated>0) limit++;
for(i=1; i<limit; i++) // For each candle...
timebuffer[i]=(double)(time[i-1]-time[i]); // Calculate time difference and put in buffer
timebuffer[0]=(double)(TimeCurrent()-time[0]); // Calculate last bar from the current time
return(rates_total);
}
//+------------------------------------------------------------------+
Comments