zigzagLibrary "zigzag"
Library dedicated to zigzags and related indicators
zigzag(length, numberOfPivots, useAlternativeSource, source, oscillatorSource, oscillatorHighSource, oscillatorLowSource, directionBias, divergenceOption)
zigzag: Calculates zigzag pivots and generates an array
Parameters:
length (int) : : Zigzag Length
numberOfPivots (simple int) : : Max number of pivots to return in the array. Default is 20
useAlternativeSource (simple bool) : : If set uses the source for genrating zigzag. Default is false
source (float) : : Alternative source used only if useAlternativeSource is set to true. Default is close
oscillatorSource (float) : : Oscillator source for calculating divergence
oscillatorHighSource (float)
oscillatorLowSource (float)
directionBias (int) : : Direction bias for calculating divergence
divergenceOption (int) : : 1 - hidden/regular, 2 - regular, 3 - hidden
Returns: zigzagpivots : Array containing zigzag pivots
zigzagpivotbars : Array containing zigzag pivot bars
zigzagpivotdirs : Array containing zigzag pivot directions (Lower High : 1, Higher High : 2, Lower Low : -2 and Higher Low : -1)
zigzagpivotratios : Array containing zigzag retracement ratios for each pivot
zigzagoscillators : Array of oscillator values at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagoscillatordirs: Array of oscillator directions (HH, HL, LH, LL) at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagtrendbias : Array of trend bias at pivots. Will have valid value only if directionBias series is sent in input parameters
zigzagdivergence : Array of divergence sentiment at each pivot. Will have valid values only if oscillatorSource and directionBias inputs are provided
newPivot : Returns true if new pivot created
doublePivot : Returns true if two new pivots are created on same bar (Happens in case of candles with long wicks and shorter zigzag lengths)
czigzag(length, numberOfPivots, highSource, lowSource, oscillatorHighSource, oscillatorLowSource, directionBias, divergenceOption)
czigzag: Calculates zigzag pivots and generates an array based on custom high and low source
Parameters:
length (int) : : Zigzag Length
numberOfPivots (simple int) : : Max number of pivots to return in the array. Default is 20
highSource (float) : : High Source for prices to calculate zigzag.
lowSource (float) : : Low source for prices to calculate zigzag.
oscillatorHighSource (float) : : Oscillator high source for calculating divergence
oscillatorLowSource (float) : : Oscillator high source for calculating divergence
directionBias (int) : : Direction bias for calculating divergence
divergenceOption (int) : : 1 - hidden/regular, 2 - regular, 3 - hidden
Returns: zigzagpivots : Array containing zigzag pivots
zigzagpivotbars : Array containing zigzag pivot bars
zigzagpivotdirs : Array containing zigzag pivot directions (Lower High : 1, Higher High : 2, Lower Low : -2 and Higher Low : -1)
zigzagpivotratios : Array containing zigzag retracement ratios for each pivot
zigzagoscillators : Array of oscillator values at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagoscillatordirs: Array of oscillator directions (HH, HL, LH, LL) at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagtrendbias : Array of trend bias at pivots. Will have valid value only if directionBias series is sent in input parameters
zigzagdivergence : Array of divergence sentiment at each pivot. Will have valid values only if oscillatorSource and directionBias inputs are provided
zigzagdoubledivergence : Array of double divergence sentiment at each pivot
newPivot : Returns true if new pivot created
doublePivot : Returns true if two new pivots are created on same bar (Happens in case of candles with long wicks and shorter zigzag lengths)
drawczigzag(length, numberOfPivots, highSource, lowSource, oscillatorHighSource, oscillatorLowSource, directionBias, showHighLow, showRatios, showDivergence, showDoubleDivergence, showIndicator, linecolor, linewidth, linestyle)
drawczigzag: Calculates and draws zigzag pivots and generates an array based on custom high and low source
Parameters:
length (int) : : Zigzag Length
numberOfPivots (simple int) : : Max number of pivots to return in the array. Default is 20
highSource (float) : : High Source for prices to calculate zigzag.
lowSource (float) : : Low source for prices to calculate zigzag.
oscillatorHighSource (float) : : Oscillator high source for calculating divergence
oscillatorLowSource (float) : : Oscillator high source for calculating divergence
directionBias (int) : : Direction bias for calculating divergence
showHighLow (simple bool) : : show highlow label
showRatios (simple bool) : : show retracement ratios
showDivergence (simple bool) : : Show divergence on label (Only works if divergence data is available - that is if we pass valid oscillatorSource and directionBias input)
showDoubleDivergence (simple bool) : : Show double divergence label
showIndicator (simple bool)
linecolor (color) : : zigzag line color
linewidth (int) : : zigzag line width
linestyle (string) : : zigzag line style
Returns: zigzagpivots : Array containing zigzag pivots
zigzagpivotbars : Array containing zigzag pivot bars
zigzagpivotdirs : Array containing zigzag pivot directions (Lower High : 1, Higher High : 2, Lower Low : -2 and Higher Low : -1)
zigzagpivotratios : Array containing zigzag retracement ratios for each pivot
zigzagoscillators : Array of oscillator values at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagoscillatordirs: Array of oscillator directions (HH, HL, LH, LL) at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagtrendbias : Array of trend bias at pivots. Will have valid value only if directionBias series is sent in input parameters
zigzagdivergence : Array of divergence sentiment at each pivot. Will have valid values only if oscillatorSource and directionBias inputs are provided
zigzagdoubledivergence : Array of double divergence sentiment at each pivot
zigzaglines : Returns array of zigzag lines
zigzaglabels : Returns array of zigzag labels
drawczigzag2(length, numberOfPivots, highSource, lowSource, oscillatorHighSource, oscillatorLowSource, directionBias, showHighLow, showRatios, showDivergence, showDoubleDivergence, showIndicator, linecolor, linewidth, linestyle)
drawczigzag2: Same as drawczigzag. But, returns newPivot and doublePivot bools as well.
Parameters:
length (int) : : Zigzag Length
numberOfPivots (simple int) : : Max number of pivots to return in the array. Default is 20
highSource (float) : : High Source for prices to calculate zigzag.
lowSource (float) : : Low source for prices to calculate zigzag.
oscillatorHighSource (float) : : Oscillator high source for calculating divergence
oscillatorLowSource (float) : : Oscillator high source for calculating divergence
directionBias (int) : : Direction bias for calculating divergence
showHighLow (simple bool) : : show highlow label
showRatios (simple bool) : : show retracement ratios
showDivergence (simple bool) : : Show divergence on label (Only works if divergence data is available - that is if we pass valid oscillatorSource and directionBias input)
showDoubleDivergence (simple bool) : : Show double divergence label
showIndicator (simple bool)
linecolor (color) : : zigzag line color
linewidth (int) : : zigzag line width
linestyle (string) : : zigzag line style
Returns: zigzagpivots : Array containing zigzag pivots
zigzagpivotbars : Array containing zigzag pivot bars
zigzagpivotdirs : Array containing zigzag pivot directions (Lower High : 1, Higher High : 2, Lower Low : -2 and Higher Low : -1)
zigzagpivotratios : Array containing zigzag retracement ratios for each pivot
zigzagoscillators : Array of oscillator values at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagoscillatordirs: Array of oscillator directions (HH, HL, LH, LL) at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagtrendbias : Array of trend bias at pivots. Will have valid value only if directionBias series is sent in input parameters
zigzagdivergence : Array of divergence sentiment at each pivot. Will have valid values only if oscillatorSource and directionBias inputs are provided
zigzagdoubledivergence : Array of double divergence sentiment at each pivot
zigzaglines : Returns array of zigzag lines
zigzaglabels : Returns array of zigzag labels
drawzigzag(length, numberOfPivots, useAlternativeSource, source, linecolor, linewidth, linestyle, oscillatorSource, oscillatorHighSource, oscillatorLowSource, directionBias, showHighLow, showRatios, showDivergence)
drawzigzag: Calculates and draws zigzag pivots
Parameters:
length (int) : : Zigzag Length
numberOfPivots (simple int) : : Max number of pivots to return in the array. Default is 20
useAlternativeSource (simple bool)
source (float) : : Alternative source used only if useAlternativeSource is set to true. Default is close
linecolor (color) : : zigzag line color
linewidth (int) : : zigzag line width
linestyle (string) : : zigzag line style
oscillatorSource (float) : : Oscillator source for calculating divergence
oscillatorHighSource (float)
oscillatorLowSource (float)
directionBias (int) : : Direction bias for calculating divergence
showHighLow (simple bool) : : show highlow label
showRatios (simple bool) : : show retracement ratios
showDivergence (simple bool) : : Show divergence on label (Only works if divergence data is available - that is if we pass valid oscillatorSource and directionBias input)
Returns: zigzagpivots : Array containing zigzag pivots
zigzagpivotbars : Array containing zigzag pivot bars
zigzagpivotdirs : Array containing zigzag pivot directions (Lower High : 1, Higher High : 2, Lower Low : -2 and Higher Low : -1)
zigzagpivotratios : Array containing zigzag retracement ratios for each pivot
zigzagoscillators : Array of oscillator values at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagoscillatordirs: Array of oscillator directions (HH, HL, LH, LL) at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagtrendbias : Array of trend bias at pivots. Will have valid value only if directionBias series is sent in input parameters
zigzagdivergence : Array of divergence sentiment at each pivot. Will have valid values only if oscillatorSource and directionBias inputs are provided
zigzaglines : Returns array of zigzag lines
zigzaglabels : Returns array of zigzag labels
Chỉ báo và chiến lược
Trend/Range Composite (Single-Line) v1.4🔹 Step 1: Add it to your chart
Copy the whole script.
In TradingView → Pine Editor → paste it.
Click Add to chart.
It will show a white line in a subwindow, plus thresholds at 40 and 60, and a colored background.
Optional: You’ll see a status box (top-right of chart) with details like ADX, ATR, slope, etc.
🔹 Step 2: Understand the Score
The indicator compresses all signals into a 0–100 “Trend Strength Score”:
≥ 60 = TREND (teal background)
→ Market is trending, consider trend strategies like vertical spreads, runners, breakouts.
≤ 40 = RANGE (orange background)
→ Market is choppy/sideways, consider range strategies like butterflies, condors, mean-reversion fades.
40–60 = MIXED (gray background)
→ Indecision / chop. Best to reduce size or wait for clarity.
🔹 Step 3: Use with Your Trading Plan
Intraday (5m, 15m, 30m)
Score < 40 → play support/resistance bounces, fade extremes.
Score > 60 → play momentum breakouts or pullback continuations.
Daily chart
Good for swing context (is this month trending or just chopping?).
🔹 Step 4: Alerts
You can set TradingView alerts:
Cross above 60 → market entering trend mode.
Cross below 40 → market entering range mode.
Useful if you don’t want to watch constantly.
🔹 Step 5: Confirm with Price Levels
The score tells you “trend vs range”, but you still need levels:
If score < 40 → mark PDH / PDL (previous day high/low), VAH/VAL, VWAP. Expect rejections/fades.
If score > 60 → watch for breakouts beyond PDH/PDL or supply/demand zones.
_matrixLibrary "_matrix"
Library helps visualize matrix as array of arrays and enables users to use array methods such as push, pop, shift, unshift etc along with cleanup activities on drawing objects wherever required
delete(mtx, rowNumber)
deletes row from a matrix
Parameters:
mtx (matrix) : matrix of objects
rowNumber (int) : row index to be deleted
Returns: void
delete(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
delete(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
delete(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
delete(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
delete(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
delete(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
delete(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
delete(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
delete(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
remove(mtx, rowNumber)
remove row from a matrix and returns them to caller
Parameters:
mtx (matrix) : matrix of objects
rowNumber (int) : row index to be deleted
Returns: type
remove(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
remove(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
remove(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
remove(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
remove(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
remove(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
remove(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
remove(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
remove(mtx, rowNumber)
Parameters:
mtx (matrix)
rowNumber (int)
unshift(mtx, row, maxItems)
unshift array of lines to first row of the matrix
Parameters:
mtx (matrix) : matrix of lines
row (array) : array of lines to be inserted in row
maxItems (simple int)
Returns: resulting matrix of type
unshift(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
unshift(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
unshift(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
unshift(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
unshift(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
unshift(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
unshift(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
unshift(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
unshift(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
push(mtx, row, maxItems)
push array of lines to end of the matrix row
Parameters:
mtx (matrix) : matrix of lines
row (array) : array of lines to be inserted in row
maxItems (simple int)
Returns: resulting matrix of lines
push(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
push(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
push(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
push(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
push(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
push(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
push(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
push(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
push(mtx, row, maxItems)
Parameters:
mtx (matrix)
row (array)
maxItems (simple int)
shift(mtx)
shift removes first row from matrix of lines
Parameters:
mtx (matrix) : matrix of lines from which the shift operation need to be performed
Returns: void
shift(mtx)
Parameters:
mtx (matrix)
shift(mtx)
Parameters:
mtx (matrix)
shift(mtx)
Parameters:
mtx (matrix)
shift(mtx)
Parameters:
mtx (matrix)
shift(mtx)
Parameters:
mtx (matrix)
shift(mtx)
Parameters:
mtx (matrix)
shift(mtx)
Parameters:
mtx (matrix)
shift(mtx)
Parameters:
mtx (matrix)
shift(mtx)
Parameters:
mtx (matrix)
rshift(mtx)
rshift removes first row from matrix of lines and returns them as array
Parameters:
mtx (matrix) : matrix of lines from which the rshift operation need to be performed
Returns: type
rshift(mtx)
Parameters:
mtx (matrix)
rshift(mtx)
Parameters:
mtx (matrix)
rshift(mtx)
Parameters:
mtx (matrix)
rshift(mtx)
Parameters:
mtx (matrix)
rshift(mtx)
Parameters:
mtx (matrix)
rshift(mtx)
Parameters:
mtx (matrix)
rshift(mtx)
Parameters:
mtx (matrix)
rshift(mtx)
Parameters:
mtx (matrix)
rshift(mtx)
Parameters:
mtx (matrix)
pop(mtx)
pop removes last row from matrix of lines
Parameters:
mtx (matrix) : matrix of lines from which the pop operation need to be performed
Returns: void
pop(mtx)
Parameters:
mtx (matrix)
pop(mtx)
Parameters:
mtx (matrix)
pop(mtx)
Parameters:
mtx (matrix)
pop(mtx)
Parameters:
mtx (matrix)
pop(mtx)
Parameters:
mtx (matrix)
pop(mtx)
Parameters:
mtx (matrix)
pop(mtx)
Parameters:
mtx (matrix)
pop(mtx)
Parameters:
mtx (matrix)
pop(mtx)
Parameters:
mtx (matrix)
rpop(mtx)
rpop removes last row from matrix of lines and reutnrs the array to caller
Parameters:
mtx (matrix) : matrix of lines from which the rpop operation need to be performed
Returns: void
rpop(mtx)
Parameters:
mtx (matrix)
rpop(mtx)
Parameters:
mtx (matrix)
rpop(mtx)
Parameters:
mtx (matrix)
rpop(mtx)
Parameters:
mtx (matrix)
rpop(mtx)
Parameters:
mtx (matrix)
rpop(mtx)
Parameters:
mtx (matrix)
rpop(mtx)
Parameters:
mtx (matrix)
rpop(mtx)
Parameters:
mtx (matrix)
rpop(mtx)
Parameters:
mtx (matrix)
clear(mtx)
clear clears the matrix
Parameters:
mtx (matrix) : matrix of lines which needs to be cleared
Returns: void
clear(mtx)
Parameters:
mtx (matrix)
clear(mtx)
Parameters:
mtx (matrix)
clear(mtx)
Parameters:
mtx (matrix)
clear(mtx)
Parameters:
mtx (matrix)
clear(mtx)
Parameters:
mtx (matrix)
clear(mtx)
Parameters:
mtx (matrix)
clear(mtx)
Parameters:
mtx (matrix)
clear(mtx)
Parameters:
mtx (matrix)
clear(mtx)
Parameters:
mtx (matrix)
rclear(mtx)
clear clears the matrix but retains the drawing objects
Parameters:
mtx (matrix) : matrix of lines which needs to be cleared
Returns: void
rclear(mtx)
Parameters:
mtx (matrix)
rclear(mtx)
Parameters:
mtx (matrix)
rclear(mtx)
Parameters:
mtx (matrix)
rclear(mtx)
Parameters:
mtx (matrix)
rclear(mtx)
Parameters:
mtx (matrix)
rclear(mtx)
Parameters:
mtx (matrix)
rclear(mtx)
Parameters:
mtx (matrix)
rclear(mtx)
Parameters:
mtx (matrix)
rclear(mtx)
Parameters:
mtx (matrix)
arraysLibrary "arrays"
Library contains utility functions using arrays. These are mostly customized for personal use. Hence, will not add documentation to it.
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (int)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (float)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (bool)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (string)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (color)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (line)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (label)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (box)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (table)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (linefill)
maxItems (simple int)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
push(arr, val, maxItems)
Parameters:
arr (array)
val (int)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (float)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (bool)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (string)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (color)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (line)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (label)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (box)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (table)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (linefill)
maxItems (simple int)
enhanced_taLibrary "enhanced_ta"
ma(source, maType, length)
returns custom moving averages
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
Returns: moving average for the given type and length
atr(maType, length)
returns ATR with custom moving average
Parameters:
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
Returns: ATR for the given moving average type and length
atrpercent(maType, length)
returns ATR as percentage of close price
Parameters:
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
Returns: ATR as percentage of close price for the given moving average type and length
bb(source, maType, length, multiplier, sticky)
returns Bollinger band for custom moving average
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
multiplier (float) : Standard Deviation multiplier
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Bollinger band with custom moving average for given source, length and multiplier
bbw(source, maType, length, multiplier, sticky)
returns Bollinger bandwidth for custom moving average
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
multiplier (float) : Standard Deviation multiplier
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Bollinger Bandwidth for custom moving average for given source, length and multiplier
bpercentb(source, maType, length, multiplier, sticky)
returns Bollinger Percent B for custom moving average
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
multiplier (float) : Standard Deviation multiplier
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Bollinger Percent B for custom moving average for given source, length and multiplier
kc(source, maType, length, multiplier, useTrueRange, sticky)
returns Keltner Channel for custom moving average
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
multiplier (float) : Standard Deviation multiplier
useTrueRange (simple bool) : - if set to false, uses high-low.
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Keltner Channel for custom moving average for given souce, length and multiplier
kcw(source, maType, length, multiplier, useTrueRange, sticky)
returns Keltner Channel Width with custom moving average
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
multiplier (float) : Standard Deviation multiplier
useTrueRange (simple bool) : - if set to false, uses high-low.
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Keltner Channel Width for custom moving average
kpercentk(source, maType, length, multiplier, useTrueRange, sticky)
returns Keltner Channel Percent K Width with custom moving average
Parameters:
source (float) : Moving Average Source
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : Moving Average Length
multiplier (float) : Standard Deviation multiplier
useTrueRange (simple bool) : - if set to false, uses high-low.
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Keltner Percent K for given moving average, source, length and multiplier
dc(length, useAlternateSource, alternateSource, sticky)
returns Custom Donchian Channel
Parameters:
length (simple int) : - donchian channel length
useAlternateSource (simple bool) : - Custom source is used only if useAlternateSource is set to true
alternateSource (float) : - Custom source
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Donchian channel
dcw(length, useAlternateSource, alternateSource, sticky)
returns Donchian Channel Width
Parameters:
length (simple int) : - donchian channel length
useAlternateSource (simple bool) : - Custom source is used only if useAlternateSource is set to true
alternateSource (float) : - Custom source
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Donchian channel width
dpercentd(length, useAlternateSource, alternateSource, sticky)
returns Donchian Channel Percent of price
Parameters:
length (simple int) : - donchian channel length
useAlternateSource (simple bool) : - Custom source is used only if useAlternateSource is set to true
alternateSource (float) : - Custom source
sticky (simple bool) : - sticky boundaries which will only change when value is outside boundary.
Returns: Donchian channel Percent D
oscillatorRange(source, method, highlowLength, rangeLength, sticky)
oscillatorRange - returns Custom overbought/oversold areas for an oscillator input
Parameters:
source (float) : - Osillator source such as RSI, COG etc.
method (simple string) : - Valid values for method are : sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
highlowLength (simple int) : - length on which highlow of the oscillator is calculated
rangeLength (simple int) : - length used for calculating oversold/overbought range - usually same as oscillator length
sticky (simple bool) : - overbought, oversold levels won't change unless crossed
Returns: Dynamic overbought and oversold range for oscillator input
oscillator(type, length, shortLength, longLength, source, highSource, lowSource, method, highlowLength, sticky)
oscillator - returns Choice of oscillator with custom overbought/oversold range
Parameters:
type (simple string) : - oscillator type. Valid values : cci, cmo, cog, mfi, roc, rsi, stoch, tsi, wpr
length (simple int) : - Oscillator length - not used for TSI
shortLength (simple int) : - shortLength only used for TSI
longLength (simple int) : - longLength only used for TSI
source (float) : - custom source if required
highSource (float) : - custom high source for stochastic oscillator
lowSource (float) : - custom low source for stochastic oscillator
method (simple string) : - Valid values for method are : sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
highlowLength (simple int) : - length on which highlow of the oscillator is calculated
sticky (simple bool) : - overbought, oversold levels won't change unless crossed
Returns: Oscillator value along with dynamic overbought and oversold range for oscillator input
multibands(bandType, source, maType, length, useTrueRange, sticky, numberOfBands, multiplierStart, multiplierStep)
multibands - returns Choice of oscillator with custom overbought/oversold range
Parameters:
bandType (simple string) : - Band type - can be either bb or kc
source (float) : - custom source if required
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : - Oscillator length - not used for TSI
useTrueRange (simple bool) : - if set to false, uses high-low.
sticky (simple bool) : - for sticky borders which only change upon source crossover/crossunder
numberOfBands (simple int) : - Number of bands to generate
multiplierStart (simple float) : - Starting ATR or Standard deviation multiplier for first band
multiplierStep (simple float) : - Incremental value for multiplier for each band
Returns: array of band values sorted in ascending order
mbandoscillator(bandType, source, maType, length, useTrueRange, stickyBands, numberOfBands, multiplierStart, multiplierStep)
mbandoscillator - Multiband oscillator created on the basis of bands
Parameters:
bandType (simple string) : - Band type - can be either bb or kc
source (float) : - custom source if required
maType (simple string) : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length (simple int) : - Oscillator length - not used for TSI
useTrueRange (simple bool) : - if set to false, uses high-low.
stickyBands (simple bool) : - for sticky borders which only change upon source crossover/crossunder for band detection
numberOfBands (simple int) : - Number of bands to generate
multiplierStart (simple float) : - Starting ATR or Standard deviation multiplier for first band
multiplierStep (simple float) : - Incremental value for multiplier for each band
Returns: oscillator currentStates - Array containing states for last n bars
timer(timeStart, timeEnd)
finds difference between two timestamps
Parameters:
timeStart (int) : - start timestamp
timeEnd (int)
arrayutilsLibrary "arrayutils"
delete(arr, index)
remove an item from array at specific index. Also deletes the item
Parameters:
arr (array) : - array from which the item needs to be deleted
index (int) : - index of item to be deleted
Returns: void
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
delete(arr, index)
Parameters:
arr (array)
index (int)
pop(arr)
remove the last item from array. Also deletes the item
Parameters:
arr (array) : - array from which the last item needs to be removed and deleted
Returns: void
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
pop(arr)
Parameters:
arr (array)
shift(arr)
remove an item from array at index 0. Also deletes the item
Parameters:
arr (array) : - array from which the first item needs to be removed and deleted
Returns: void
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
shift(arr)
Parameters:
arr (array)
unshift(arr, val, maxItems)
add an item to the beginning of an array with max items cap
Parameters:
arr (array) : - array to which the item needs to be added at the beginning
val (int) : - value of item which needs to be added
maxItems (simple int) : - max items array can hold. After that, items are removed from the other end
Returns: resulting array
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (float)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (bool)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (string)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (color)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (line)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (label)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (box)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (table)
maxItems (simple int)
unshift(arr, val, maxItems)
Parameters:
arr (array)
val (linefill)
maxItems (simple int)
clear(arr)
remove and delete all items in an array
Parameters:
arr (array) : - array which needs to be cleared
Returns: void
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
clear(arr)
Parameters:
arr (array)
push(arr, val, maxItems)
add an item to the end of an array with max items cap
Parameters:
arr (array) : - array to which the item needs to be added at the beginning
val (int) : - value of item which needs to be added
maxItems (simple int) : - max items array can hold. After that, items are removed from the starting index
Returns: resulting array
push(arr, val, maxItems)
Parameters:
arr (array)
val (float)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (bool)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (string)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (color)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (line)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (label)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (box)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (table)
maxItems (simple int)
push(arr, val, maxItems)
Parameters:
arr (array)
val (linefill)
maxItems (simple int)
check_overflow(a, b, c, pivots, barArray)
finds difference between two timestamps
Parameters:
a (float)
b (float)
c (float)
pivots (array) : pivots array
barArray (array) : pivot bar array
Returns: bool overflow
get_trend_series(pivots, length, highLow, trend)
finds series of pivots in particular trend
Parameters:
pivots (array) : pivots array
length (int) : length for which trend series need to be checked
highLow (int) : filter pivot high or low
trend (int) : Uptrend or Downtrend
Returns: int trendIndexes
get_trend_series(pivots, firstIndex, lastIndex)
finds series of pivots in particular trend
Parameters:
pivots (array) : pivots array
firstIndex (int) : First index of the series
lastIndex (int) : Last index of the series
Returns: int trendIndexes
sma(source)
calculates sma for elements in array
Parameters:
source (array) : source array
Returns: float sma
ema(source, length)
calculates ema for elements in array
Parameters:
source (array) : source array
length (simple int) : ema length
Returns: float ema
rma(source, length)
calculates rma for elements in array
Parameters:
source (array) : source array
length (simple int) : rma length
Returns: float rma
wma(source, length)
calculates wma for elements in array
Parameters:
source (array) : source array
length (simple int) : wma length
Returns: float wma
hma(source, length)
calculates hma for elements in array
Parameters:
source (array) : source array
length (simple int) : hma length
Returns: float hma
ma(source, matype, length)
wrapper for all moving averages based on array
Parameters:
source (array) : source array
matype (simple string) : moving average type. Valud values are: sma, ema, rma, wma, hma, high, low, median, medianHigh, medianLow
length (simple int) : moving average length length
Returns: float moving average
getFibSeries(numberOfFibs, start)
gets fib series in array
Parameters:
numberOfFibs (simple int) : number of fibs
start (simple int) : starting number
Returns: float fibArray
Custom Choppiness HistogramThe Custom Choppiness Histogram is a visually enhanced, multi-timeframe version of the traditional Choppiness Index , designed to make it easier to spot when the market is trending vs. ranging.
🔹 Key Features:
Histogram Visualization: Clear, color-coded bars for instant interpretation.
Two Coloring Modes:
1.Change Mode → Colors based on increase/decrease vs. previous CI value.
2.Absolute Levels → Uses common CI thresholds (e.g., >61.8 = choppy, <38.2 = trending).
Grey Bars / Neutral Zone: Bars turn grey when the market is neither strongly trending nor strongly choppy — signaling a neutral or indecisive market.
Multi-Timeframe Option: Analyze Choppiness from any higher timeframe while trading on a lower chart.
Custom Thresholds: Adjust high/low CI levels to fit your strategy.
🔹 How to Use:
Green bars → Market is becoming more trending.
Red bars → Market is becoming more choppy/ranging.
Grey bars → Market is in a neutral zone; use caution and combine with other signals.
Use the timeframe input to filter trades (e.g., check if the 1H is trending before entering on the 5M).
🔹 Best Practice:
Use as a context filter alongside your entry/exit strategy (e.g., MACD, ICT/Smart Money, Supply & Demand).
Helps reduce false entries by avoiding trades during sideways conditions.
⚠️ Disclaimer:
This script is provided for educational purposes only. It is not financial advice and should not be used as a sole basis for making trading decisions. Always do your own research and test thoroughly before applying to live markets. Trading carries risk, and you are solely responsible for your decisions.
Nth Candle by exp3rtsThis lightweight and versatile TradingView indicator highlights every Xth candle on your chart, making it easy to spot cyclical price behavior or track specific intervals in the market.
- Custom Interval – Choose how often candles should be highlighted (e.g., every 5th, 10th, or
20th bar).
- Color Coding – Highlighted candles are shaded green if bullish and red if bearish, giving you
quick visual insights into momentum at those intervals.
- Clean Overlay – The indicator draws directly on your main chart without clutter, so you can
combine it with your favorite setups and strategies.
Use this tool to:
1) Identify repeating patterns and cycles
2) Mark periodic reference candles
3) Support discretionary trading decisions with clear visual cues
RSI Prior DayLagged RSI indicator showing the prior day's RSI(14) value for easy divergence detection. Plot it alongside current RSI to spot bullish/bearish signals. Ideal for swing traders scanning for momentum shifts.
Harry Dunn Volatility BandsEnter strike price and 2 percentage numbers to automatically calculate and draw volatility bands on chart.
Vertical Lines at 10:00 & 11:30Sales-Style Description
This script is a simple but powerful TradingView add-on that automatically marks your chart with clear, bold vertical lines at exactly 10:00 AM and 11:30 AM every day. No more manually drawing lines or setting reminders — it does the work for you.
Always on time: It tracks the market clock in real-time and drops a line the moment your chart hits those times.
Clean visibility : The lines are bright blue (#2962FF), solid, and drawn with thickness level 3, so they stand out against any background or chart theme.
Automatic housekeeping: It keeps your workspace clean by automatically deleting old lines once you reach a set limit, so your chart never gets cluttered.
Customizable : You can change the time zone, thickness, and the number of days’ worth of lines to keep.
Set it and forget it: Once added to your chart, it runs quietly in the background — you’ll always know when the 10:00 and 11:30 sessions hit without lifting a finger.
Liquidity Scalp + SMC + FVG + SL 1% + Max Hold Barstabrez Liquidity Scalp + SMC + FVG + SL 1% + Max Hold Bars
Quantile-Based Adaptive Detection🙏🏻 Dedicated to John Tukey. He invented the boxplot, and I finalized it.
QBAD (Quantile-Based Adaptive Detection) is ‘the’ adaptive (also optionally weighted = ready for timeseries) boxplot with more senseful fences. Instead of hardcoded multipliers for outer fences, I base em on a set of quantile-based asymmetry metrics (you can view it as an ‘algorithmic’ counter part of central & standardized moments). So outer bands are Not hardcoded, not optimized, not cross-validated etc, simply calculated at O(nlogn).
You can use it literally everywhere in any context with any continuous data, in any task that requires statistical control, novelty || outlier detection, without worrying and doubting the sense in arbitrary chosen thresholds. Obviously, given the robust nature of quantiles, it would fit best the cases where data has problems.
The thresholds are:
Basis: the model of the data (median in our case);
Deviations: represent typical spread around basis, together form “value” in general sense;
Extensions: estimate data’s extremums via combination of quantile-based asymmetry metrics without relying on actual blunt min and max, together form “range” / ”frame”. Datapoints outside the frame/range are novelties or outliers;
Limits: based also on quantile asymmetry metrics, estimate the bounds within which values can ‘ever’ emerge given the current data generating process stays the same, together form “field”. Datapoints outside the field are very rare, happen when a significant change/structural break happens in current data-generating process, or when a corrupt datapoint emerges.
…
The first part of the post is for locals xd, the second is for the wanderers/wizards/creators/:
First part:
In terms of markets, mostly u gotta worry about dem instruments that represent crypto & FX assets: it’s either activity hence data sources there are decentralized, or data is fishy.
For a higher algocomplexity cost O(nlong), unlike MBAD that is 0(n), this thing (a control system in fact) works better with ishy data (contaminated with wrong values, incomplete, missing values etc). Read about the “ breakdown point of an estimator ” if you wanna understand it.
Even with good data, in cases when you have multiple instruments that represent the same asset, e.g. CL and BRN futures, and for some reason you wanna skip constructing a proper index of em (while you should), QBAD should be better put on each instrument individually.
Another reason to use this algo-based rather than math-based tool, might be in cases when data quality is all good, but the actual causal processes that generate the data are a bit inconsistent and/or possess ‘increased’ activity in a way. SO in high volatility periods, this tool should provide better.
In terms of built-ins you got 2 weightings: by sequence and by inferred volume delta. The former should be ‘On’ all the time when you work with timeseries, unless for a reason you want to consciously turn it off for a reason. The latter, you gotta keep it ‘On’ unless you apply the tool on another dataset that ain’t got that particular additional dimension.
Ain’t matter the way you gonna use it, moving windows, cumulative windows with or without anchors, that’s your freedom of will, but some stuff stays the same:
Basis and deviations are “value” levels. From process control perspective, if you pls, it makes sense to Not only fade or push based on these levels, but to also do nothing when things are ambiguous and/or don’t require your intervention
Extensions and limits are extreme levels. Here you either push or fade, doing nothing is not an option, these are decisive points in all the meanings
Another important thing, lately I started to see one kind of trend here on tradingview as well and in general in near quant sources, of applying averages, percentiles etc ‘on’ other stationary metrics, so called “indicators”. And I mean not for diagnostic or development reasons, for decision making xd
This is not the evil crime ofc, but hillbilly af, cuz the metrics are stationary it means that you can model em, fit a distribution, like do smth sharper. Worst case you have Bayesian statistics armed with high density intervals and equal tail intervals, and even some others. All this stuff is not hard to do, if u aint’t doing it, it’s on you.
So what I’m saying is it makes sense to apply QBAD on returns ‘of your strategy’, on volume delta, but Not on other metrics that already do calculations over their own moving windows.
...
Second part:
Looks like some finna start to have lil suspicions, that ‘maybe’ after all math entities in reality are more like blueprints, while actual representations are physical/mechanical/algorithmic. Std & centralized moments is a math entity that represents location, scale & asymmetry info, and we can use it no problem, when things are legit and consistent especially. Real world stuff tho sometimes deviates from that ideal, so we need smth more handy and real. Add to the mix the algo counter part of means: quantiles.
Unlike the legacy quantile-based asymmetry metrics from the previous century (check quantile skewness & kurtosis), I don’t use arbitrary sets of quantiles, instead we get a binary pattern that is totally geometric & natural (check the code if interested, I made it very damn explicit). In spirit with math based central & standardized moments, each consequent pair is wider empathizing tail info more and more for each higher order metric.
Unlike the classic box plot, where inner thresholds are quartiles and the rest are based on em, here the basis is median (minimises L1), I base inner thresholds on it, and we continue the pattern by basing the further set of levels on the previous set. So unlike the classic box plot, here we have coherency in construction, symmetry.
Another thing to pay attention to, tho for some reason ain’t many talk about it, it’s not conceptually right to think that “you got data and you apply std moments on it”. No, you apply it to ‘centered around smth’ data. That ‘smth’ should minimize L2 error in case of math, L1 error in case of algo, and L0 error in case of learning/MLish/optimizational/whatever-you-cal-it stuff. So in the case of L0, that’s actually the ‘mode’ of KDE, but that’s for another time. Anyways, in case of L2 it’s mean, so we center data around mean, and apply std moments on residuals. That’s the precise way of framing it. If you understand this, suddenly very interesting details like 0th and 1st central moments start to make sense. In case of quantiles, we center data around the median, and do further processing on residuals, same.
Oth moment (I call it init) is always 1, tho it’s interesting to extrapolate backwards the sequence for higher order moments construction, to understand how we actually end up with this zero.
1st moment (I call it bias) of residuals would be zero if you match centering and residuals analysis methods. But for some reason you didn’t do that (e.g centered data around midhinge or mean and applied QBAD on the centered data), you have to account for that bias.
Realizing stuff > understanding stuff
Learning 2981234 human invented fields < realizing the same unified principles how the Universe works
∞
Liquidity Scalp with SL 1% and Max Hold Bars profitis by tabrez my owe indicator 8hr wrok on this 1 stratgiy tabrez raj mafia samaar raj
Moving Averagemoving average indicator i created the follow genuine movement of volume in the market nased on the setting you use
Tragad00TanTechTrades — Trendilo with Moving Average + Divergences (Tragad00)
Inspired by Trendilo, this oscillator reworks the original logic and adds:
A selectable Moving Average (SMA/EMA/WMA/SMMA/VWMA) applied to the oscillator itself
Adaptive bands for overbought/oversold zones
Regular bullish & bearish divergence detection with labels
A full set of alert conditions for signals and state changes
What it does
This indicator transforms price into an ALMA-smoothed percent-change oscillator and compares it to an adaptive volatility band:
Oscillator (avpch)
Computes % change of your chosen Source, optionally smoothed, then smooths it again with ALMA (length, offset, sigma).
Adaptive bands (±rms)
Uses a root-mean-square of the oscillator over a band length (Lookback or custom) scaled by Band Multiplier.
Values above +rms suggest overbought pressure; below −rms suggest oversold pressure.
Trend coloring
Line (and optional bars) turn lime when avpch > +rms, red when avpch < −rms, and gray otherwise.
Optional fill highlights the dominant side.
Overlay MA on the oscillator
A selectable MA of the oscillator (maPlot) helps time signals relative to the Trendilo line.
Regular Divergences
Bullish: price makes a lower low while the oscillator makes a higher low.
Bearish: price makes a higher high while the oscillator makes a lower high.
Lookback windows are configurable and divergence labels are plotted on the oscillator.
Signals & how to read them
Trend Bias
Bull Zone: avpch above +rms (lime)
Bear Zone: avpch below −rms (red)
Neutral: between the bands (gray)
Cross Signals
Long Entry: MA crosses above the Trendilo line (maPlot ↑ over avpch)
Short Entry: MA crosses below the Trendilo line (maPlot ↓ under avpch)
Midline Cross: avpch crossing 0 flags shifts in momentum regime
Divergences
Bullish Divergence label (“Bull”) may mark potential bottoms
Bearish Divergence label (“Bear”) may mark potential tops
Tip: Combine divergence with a subsequent midline cross or MA cross for confirmation.
Alerts included (ready to use)
Overbought / No Longer Overbought
Oversold / No Longer Oversold
Long Entry (MA crosses above Trendilo)
Short Entry (MA crosses below Trendilo)
Midline Cross Up / Midline Cross Down
Bullish Divergence / Bearish Divergence
Set alerts from the “Conditions” menu using the titles above.
Inputs
Core
Source (default: Close)
Smoothing (pre-change smoothing)
Lookback (ALMA length)
ALMA Offset, ALMA Sigma
Band Multiplier
Custom Band Length? + Custom Band Length
Display: Highlight, Fill, Bar Color
Oscillator MA
MA Length
MA Type: SMA / EMA / WMA / SMMA (RMA) / VWMA
Divergences
Pivot Lookback Left / Right
Max/Min Lookback Range (window for valid pivots)
Plot Bullish Divergence / Plot Bearish Divergence
Suggested workflow
Trend context: Use band color (lime/red) to gauge dominant pressure.
Timing: Look for MA ↔ Trendilo crosses in the direction of the current zone.
Reversals: Watch for divergence labels; seek confirmation via midline (0) cross or a band exit.
Risk: Overbought/oversold alerts can warn of exhaustion—tighten stops or scale out.
Notes & credits
Built by TanTechTrades.
Inspired by the Trendilo concept; this version focuses on an ALMA-smoothed percent-change oscillator with adaptive RMS bands, an oscillator MA, and regular divergence detection.
This is a tool, not financial advice. Always combine with price action, structure, and risk management.
Extended from EMAIt highlights candles which have become extended from EMA. It could be used to protect profits in parabolic moves or when the script becomes too extended.
Session Boxes by NicoG (Real-time - Corrected)Draw the boxes in real time and not at the end of the session.
Multi-TF EMA+Ichimoku Table Multi-TF EMA+Ichimoku Table showing if the market it bullish or bearish in one sight.
CRT Candle + EMA Cross StrategyCRT with EMA Crossover:
CRT Candle:
Highlights the qualifying candle with a yellow triangle.
Shows “CRT” text on top.
EMA 9/16 Crosses:
Bullish cross → green triangle below candle.
Bearish cross → red triangle above candle.
EMA 200:
Plotted as trend reference.
Works multi-timeframe for CRT detection.
Clean and visual, no trades, purely signals.
ATR Volatility and Trend AnalysisATR Volatility and Trend Analysis
Unlock the power of the Average True Range (ATR) with the ATR Volatility and Trend Analysis indicator. This comprehensive tool is designed to provide traders with a multi-faceted view of market dynamics, combining volatility analysis, dynamic support and resistance levels, and trend detection into a single, easy-to-use indicator.
How It Works
The ATR Volatility and Trend Analysis indicator is built upon the core concept of the ATR, a classic measure of market volatility. It expands on this by providing several key features:
Dynamic ATR Bands: The indicator plots three sets of upper and lower bands around the price. These bands are calculated by multiplying the current ATR value by user-defined multipliers. They act as dynamic support and resistance levels, widening during volatile periods and contracting during calm markets.
Volatility Breakout Signals: Identify potential breakouts with precision. The indicator generates a signal when the current ATR value surges above its own moving average by a specified threshold, indicating a significant increase in volatility that could lead to a strong price move.
Trend Detection: The indicator determines the market trend by analyzing both price action and ATR behavior. A bullish trend is signaled when the price is above its moving average and volatility is increasing. Conversely, a bearish trend is signaled when the price is below its moving average and volatility is increasing.
How to Use the ATR Multi-Band Indicator
Identify Support and Resistance: Use the ATR bands as key levels. Price approaching the outer bands may indicate overbought or oversold conditions, while a break of the bands can signal a strong continuation.
Confirm Breakouts: Look for a volatility breakout signal to confirm the strength behind a price move. A breakout from a consolidation range accompanied by a volatility signal is a strong indicator of a new trend.
Trade with the Trend: Use the background coloring and trend signals to align your trades with the dominant market direction. Enter long positions during confirmed bullish trends and short positions during bearish trends.
Set Up Alerts: The indicator includes alerts for band crosses, trend changes, and volatility breakouts, ensuring you never miss a potential trading opportunity.
What makes it different?
While many indicators use ATR, the ATR Volatility and Trend Analysis tool is unique in its integration of multiple ATR-based concepts into a single, cohesive system. It doesn't just show volatility; it interprets it in the context of price action to deliver actionable trend and breakout signals, making it a complete solution for ATR-based analysis.
Disclaimer
This indicator is designed as a technical analysis tool and should be used in conjunction with other forms of analysis and proper risk management.
Past performance does not guarantee future results, and traders should thoroughly test any strategy before implementing it with real capital.