Calculates the time elapsed between consecutive bars to measure market speed and volatility, designed primarily for Renko chart blocks where bar duration varies.
1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
62 lines of Pine Script v4 from renko-acc.pine, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.
renko-acc.pine
//@version=4
// Renko Acceleration
//
// Renko is a very useful charting method for analyzing stock movement.
// It does a great job of filtering out all the excess noise so that all we're
// left with is pure price action. But, what about time? Time is a fundamental
// part of chart analysis and without it we're only seeing part of the
// picture. After all, shouldn't we take a very different approach to trading
// signals from a block that renders in 2 seconds as opposed to a block that
// renders in 30 minutes?
//
// This indicator provides the best of both worlds, enabling us to correlate
// the passing of time with price movement and see clearly when squeezes and
// breakouts occur.
//
// As the indicator turns up to green we can see that volatility is on the
// move and the market is accelerating (breakout), and as it turns down to red
// the market is stagnating (squeeze). There is also an alternate 'Precise'
// view which renders the exact time per block for more granular analysis.
//
study("Renko Acceleration", overlay=false)
// Allow selection of signal content.
IncludeFilter = input(true, 'Include Filter')
mode = input("Momentum", "Display Mode", options=["Momentum", "Precise"])
smoothing = input(10, "Smoothing", input.integer, minval=0)
float duration = (time-time[1]) / (1000*60) // block time in seconds
float accel = na
color accelColor = na
if mode == "Momentum"
bline = sma(duration, 100) * 1.25
accel := max(bline-duration, -20) // trim negative outliers
accel := smoothing ? sma(accel, smoothing) : accel
accelColor := accel > 15 ? color.lime :
accel > 5 ? color.green :
accel > 0 ? color.olive :
accel > -5 ? color.yellow :
accel > -10 ? color.orange : color.red
if mode == "Precise"
accel := duration
accelColor := duration > 30 ? color.red :
duration > 15 ? color.orange :
duration > 5 ? color.yellow : color.silver
plot(accel, "Time", style=plot.style_histogram, color=accelColor)
// ————— Filter.
FilterLong = accel > 0
FilterShort = accel > 0
// ————— Build required values corresponding to states.
Filter = FilterLong ? 0.001 : FilterShort ? 0.001 : 0
// ————— We must decide which value will be sent in case more than one is different than 0, since only one value can be sent at each bar.
// Priority is given to exits, with filter states coming last.
Signal = IncludeFilter and Filter != -0.001 ? Filter : na
// ————— Plot signal which is to be connected to the Engine through the External Indicator field at the very bottom of the Engine's Settings/Inputs.
plot(Signal, 'Signal')
Overview
In Momentum mode, it contrasts the current duration against a 100-period moving average baseline, applies optional smoothing, and plots a color-coded acceleration histogram. In Precise mode, it plots the raw block duration. It also exports an external filter state for integration with the PineCoders Backtesting Trading Engine. Draws in a separate pane.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Include Filter
bool
true
IncludeFilter
Display Mode
string
Momentum
mode
Smoothing
int
10
smoothing
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This indicator measures market consolidation and breakout phases by computing a scaled Relative Strength Index (RSI) on normalized price data. It identifies chop zones when the RSI oscillates between 40 and 60, highlighting tight consolidation between 45 and 5
This indicator plots Squeeze Momentum in a separate pane. It compares Bollinger Bands with a Keltner Channel to mark a squeeze when the bands sit inside the channel. Momentum is a linear regression of price relative to a Donchian midline and an SMA, shown as a
This indicator plots a higher-timeframe MACD breakout setup on the price chart and combines it with linear regression channels. It marks support and resistance zones from MACD histogram sensitivity, then filters them with the MACD zero line, a linear regressio
Squeeze Panel plots a volatility squeeze in a separate pane. It marks a squeeze when Bollinger Bands sit inside a Keltner Channel and marks when the bands expand outside it. The user chooses Money Flow Index or linear regression to color likely breakout direct
This overlay indicator marks Linda Raschke short-term bar setups on the price chart. It flags Turtle Soup and Turtle Soup plus one false breakouts of a prior extreme, 80-20 bars, inside bars, failed inside-bar breakouts, outside up and down bars, NR4 and NR7 c
This overlay indicator scores breakouts of recent highs and lows against failed-breakout checks, EMA trend alignment, RSI momentum, and an ATR volatility band. It plots green buy and red sell labels when conditions pass a minimum score, and it prints ATR-based