ADR/ATR/EMA%ADR%
ATR%
Daily EMA 5% distance
Daily EMA 10% distance
2 Hour EMA 20% distance
20-Day price control
XU100 Index 5/20 control on 4-hour
Indicadores e estratégias
Hoon Fib project//@version=6
indicator("Hoon Fib project", shorttitle ="Hoon Fib project" ,overlay = true, max_bars_back = 5000)
// ~~ Tooltips {
var string t1 = "Period: Number of bars used to detect swing highs and swing lows. Larger values give fewer but larger swings. (Works relative to current timeframe)."
var string t2 = "Projection Level: Fibonacci ratio used to calculate the projected future swing targets (e.g. 61.8%)."
var string t2_b = "Trend Projection Ratio: The secondary Fibonacci ratio used for the furthest extension (default was 1.272)."
var string t3 = "Level 1: Ratio and Color for the first retracement level (Standard: 0.236)."
var string t4 = "Level 2: Ratio and Color for the second retracement level (Standard: 0.382)."
var string t5 = "Level 3: Ratio and Color for the third retracement level (Standard: 0.500)."
var string t6 = "Level 4: Ratio and Color for the fourth retracement level (Standard: 0.618)."
var string t7 = "Level 5: Ratio and Color for the fifth retracement level (Standard: 0.786)."
var string t8 = "Fib Line Width: Thickness of all horizontal Fibonacci retracement lines."
var string t9 = "Fib Labels: Show or hide percentage labels at each Fibonacci retracement line."
var string t10 = "Fib Label Text Color: Text color of Fibonacci retracement labels."
var string t11 = "Fib Label Size: Font size of Fibonacci retracement labels."
var string t12 = "Low Line Color: Color for the most recent swing low horizontal guide line."
var string t13 = "High Line Color: Color for the most recent swing high horizontal guide line."
var string t14 = "Swing Line Width: Thickness of both swing high and swing low guide lines."
var string t15 = "Fib Volume Profile: Enable or disable the main volume profile drawn between the last swing high and low."
var string t16 = "Rows: Number of price rows (bins) used in the Fib volume profile. More rows = finer detail."
var string t17 = "Flip Bull/Bear: Swap the horizontal position of bullish and bearish volume bars in the profile."
var string t18 = "Bull Volume Color: Base color used for bullish (up-bar) volume in the Fib volume profile."
var string t19 = "Bear Volume Color: Base color used for bearish (down-bar) volume in the Fib volume profile."
var string t20 = "Fib Volume Delta: Enable or disable the separate volume delta profile between Fibonacci price bands."
var string t21 = "Delta Max Width: Maximum horizontal width (in bars) used to scale delta boxes from smallest to largest."
var string t22 = "Bullish Delta Color: Fill color for bands where bullish volume exceeds bearish volume (positive delta)."
var string t23 = "Bearish Delta Color: Fill color for bands where bearish volume exceeds bullish volume (negative delta)."
var string t24 = "Bullish Projection Line Color: Color of projected segments when price is projected upward."
var string t25 = "Bearish Projection Line Color: Color of projected segments when price is projected downward."
var string t26 = "Projection Line Width: Thickness of projected swing segments."
var string t27 = "Projection Line Style: Visual style of projected lines (solid, dashed, dotted, or arrows)."
var string t28 = "Bullish Label Background: Background color for percentage labels on upward projection segments."
var string t29 = "Bearish Label Background: Background color for percentage labels on downward projection segments."
var string t30 = "Projection Label Text Color: Text color of projection percentage labels."
var string t31 = "Projection Label Size: Font size of projection percentage labels."
var string t32 = "Projection Box Background: Toggle the background fill of projection boxes on or off."
var string t33 = "Projection Box Background Color: Fill color used for projection boxes (when background is enabled)."
var string t34 = "Projection Box Border: Toggle drawing a border around projection boxes."
var string t35 = "Projection Box Border Color: Color of the border around projection boxes."
var string t36 = "Projection Box Border Width: Thickness of projection box borders."
var string t37 = "Projection Box Border Style: Line style for projection box borders (solid/dashed/dotted)."
var string t38 = "Projection Box Horizontal Align: Horizontal alignment of text inside projection boxes (left/center/right)."
var string t39 = "Projection Box Vertical Align: Vertical alignment of text inside projection boxes (top/center/bottom)."
var string t40 = "Projection Box Text Color: Text color for the projection level values shown inside the boxes."
var string t41 = "Projection Box Text Size: Font size of the projection level values shown inside the boxes."
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Inputs {
prd = input.int(
100,
"Period",
group = "Fib Settings",
inline = "fibColor",
tooltip = t1
)
lvl = input.float(
0.618,
title = "Projection Level",
group = "Fib Settings",
options = ,
tooltip = t2
)
// NEW INPUT FOR CUSTOM FIB
trendFibbRatio = input.float(
1.272,
title = "Trend Projection Ratio",
step = 0.001,
group = "Fib Settings",
tooltip = t2_b
)
// Fib line style inputs (horizontal fib levels)
fibLvl1 = input.float(0.236, "Level 1", group = "Fib Levels Style", inline = "f1", tooltip = t3)
fibColor236 = input.color(#f23645, "", group = "Fib Levels Style", inline = "f1")
fibLvl2 = input.float(0.382, "Level 2", group = "Fib Levels Style", inline = "f2", tooltip = t4)
fibColor382 = input.color(#81c784, "", group = "Fib Levels Style", inline = "f2")
fibLvl3 = input.float(0.500, "Level 3", group = "Fib Levels Style", inline = "f3", tooltip = t5)
fibColor500 = input.color(#4caf50, "", group = "Fib Levels Style", inline = "f3")
fibLvl4 = input.float(0.618, "Level 4", group = "Fib Levels Style", inline = "f4", tooltip = t6)
fibColor618 = input.color(#089981, "", group = "Fib Levels Style", inline = "f4")
fibLvl5 = input.float(0.786, "Level 5", group = "Fib Levels Style", inline = "f5", tooltip = t7)
fibColor786 = input.color(#64b5f6, "", group = "Fib Levels Style", inline = "f5")
fibLineWidth = input.int(
2,
"Fib Line Width",
minval = 1,
maxval = 5,
group = "Fib Levels Style",
inline = "fwidth",
tooltip = t8
)
showlab = input.bool(
false,
title = "Fib Labels",
group = "Fib Levels Style",
inline = "fiblab"
)
fibLabelColor = input.color(
color.white,
"",
group = "Fib Levels Style",
inline = "fiblab"
)
fibLabelSizeStr = input.string(
"Small",
"",
options = ,
group = "Fib Levels Style",
inline = "fiblab",
tooltip = t9 + " " + t10 + " " + t11
)
fibLabelOffset = 1 // (fixed) x offset for labels
// derived label size
fibLabelSize =
fibLabelSizeStr == "Tiny" ? size.tiny :
fibLabelSizeStr == "Small" ? size.small :
fibLabelSizeStr == "Large" ? size.large :
fibLabelSizeStr == "Huge" ? size.huge :
size.normal
// Swing high/low lines
loLineColor = input.color(
color.new(color.green, 0),
"Low Line",
group = "Swing High/Low Lines Style",
inline = "hi"
)
hiLineColor = input.color(
color.new(color.red, 0),
"High Line",
group = "Swing High/Low Lines Style",
inline = "hi"
)
hiloLineWidth = input.int(
2,
"Width",
1,
5,
group = "Swing High/Low Lines Style",
inline = "hi",
tooltip = t12 + " " + t13 + " " + t14
)
// Fib volume profile inputs
showFibProfile = input.bool(
true,
"Fib Volume Profile",
group = "Fib Volume Profile",
inline = "fibprof"
)
rows = input.int(
10,
"Rows",
2,
100,
group = "Fib Volume Profile",
inline = "fibprof"
)
flipOrder = input.bool(
false,
"Flip Bull/Bear",
group = "Fib Volume Profile",
inline = "fibprof",
tooltip = t15 + " " + t16 + " " + t17
)
bull_color = input.color(
color.new(color.teal, 30),
"Bull",
group = "Fib Volume Profile",
inline = "volColor"
)
bear_color = input.color(
color.new(color.orange, 30),
"Bear",
group = "Fib Volume Profile",
inline = "volColor",
tooltip = t18 + " " + t19
)
// Volume Text Settings
showVolText = input.bool(true, "Show Volume Values", group="Fib Volume Profile", inline="vtxt")
volTextSizeStr = input.string("Tiny", "Size", options= , group="Fib Volume Profile", inline="vtxt")
volTextSize =
volTextSizeStr == "Tiny" ? size.tiny :
volTextSizeStr == "Small" ? size.small :
size.normal
// Fib Volume Delta profile
showFibDelta = input.bool(
false,
"Fib Volume Delta",
group = "Fib Volume Delta Profile",
inline = "delta"
)
deltaMaxWidth = input.int(
30,
"Max Width",
minval = 5,
maxval = 200,
group = "Fib Volume Delta Profile",
inline = "delta",
tooltip = t20 + " " + t21
)
deltaBullColor = input.color(
color.new(color.lime, 80),
"Bullish Delta",
group = "Fib Volume Delta Profile",
inline = "deltaColor"
)
deltaBearColor = input.color(
color.new(color.red, 80),
"Bearish Delta",
group = "Fib Volume Delta Profile",
inline = "deltaColor",
tooltip = t22 + " " + t23
)
// Projection LINES style
projLineBullColor = input.color(
color.new(color.green, 0),
"Bullish",
group = "Projection Lines Style",
inline = "plc"
)
projLineBearColor = input.color(
color.new(color.red, 0),
"Bearish",
group = "Projection Lines Style",
inline = "plc"
)
projLineWidth = input.int(
2,
"Width",
1,
5,
group = "Projection Lines Style",
inline = "plc"
)
projLineStyleStr = input.string(
"Arrow Right",
"",
options = ,
group = "Projection Lines Style",
inline = "plc",
tooltip = t24 + " " + t25 + " " + t26 + " " + t27
)
projLineStyle =
projLineStyleStr == "Solid" ? line.style_solid :
projLineStyleStr == "Dashed" ? line.style_dashed :
projLineStyleStr == "Dotted" ? line.style_dotted :
projLineStyleStr == "Arrow Left" ? line.style_arrow_left :
line.style_arrow_right
// Projection % LABELS style
projPercBullColor = input.color(
color.new(color.green, 0),
"Bullish Bg",
group = "Projection Labels Style",
inline = "plc"
)
projPercBearColor = input.color(
color.new(color.red, 0),
"Bearish Bg",
group = "Projection Labels Style",
inline = "plc"
)
projPercTextColor = input.color(
color.white,
"Text",
group = "Projection Labels Style",
inline = "plc"
)
projPercLabelSizeStr = input.string(
"Small",
"",
options = ,
group = "Projection Labels Style",
inline = "plc",
tooltip = t28 + " " + t29 + " " + t30 + " " + t31
)
projPercLabelSize =
projPercLabelSizeStr == "Tiny" ? size.tiny :
projPercLabelSizeStr == "Small" ? size.small :
projPercLabelSizeStr == "Large" ? size.large :
projPercLabelSizeStr == "Huge" ? size.huge :
size.normal
// Projection box style inputs
projBoxBgOn = input.bool(
true,
"Background",
group = "Projection Box Style",
inline = "pbg"
)
projBoxBgColor = input.color(
color.new(color.blue, 80),
"",
group = "Projection Box Style",
inline = "pbg"
)
projBoxBorderOn = input.bool(
true,
"Border",
group = "Projection Box Style",
inline = "pbg"
)
projBoxBorderCol = input.color(
color.new(color.white, 0),
"",
group = "Projection Box Style",
inline = "pbg"
)
projBoxBorderW = input.int(
1,
"",
minval = 1,
maxval = 5,
group = "Projection Box Style",
inline = "pbg"
)
projBoxBorderStyleStr = input.string(
"Solid",
"",
options = ,
group = "Projection Box Style",
inline = "pbg",
tooltip = t32 + " " + t33 + " " + t34 + " " + t35 + " " + t36 + " " + t37
)
projBoxTextHAlignStr = input.string(
"Center",
"H Align",
options = ,
group = "Projection Box Style",
inline = "ptxt"
)
projBoxTextVAlignStr = input.string(
"Center",
"V Align",
options = ,
group = "Projection Box Style",
inline = "ptxt",
tooltip = t38 + " " + t39
)
projBoxTextColor = input.color(
color.white,
"Text",
group = "Projection Box Style",
inline = "ptxt2"
)
projBoxTextSizeStr = input.string(
"Normal",
"",
options = ,
group = "Projection Box Style",
inline = "ptxt2",
tooltip = t40 + " " + t41
)
projBoxTextSize =
projBoxTextSizeStr == "Tiny" ? size.tiny :
projBoxTextSizeStr == "Small" ? size.small :
projBoxTextSizeStr == "Large" ? size.large :
projBoxTextSizeStr == "Huge" ? size.huge :
size.normal
// Derived projection box style settings
projBoxBorderStyle =
projBoxBorderStyleStr == "Solid" ? line.style_solid :
projBoxBorderStyleStr == "Dashed" ? line.style_dashed :
line.style_dotted
projBoxTextHAlign =
projBoxTextHAlignStr == "Left" ? "left" :
projBoxTextHAlignStr == "Right" ? "right" :
"center"
projBoxTextVAlign =
projBoxTextVAlignStr == "Top" ? "top" :
projBoxTextVAlignStr == "Bottom" ? "bottom" :
"center"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Swing detection {
hi = ta.highest(high, prd)
lo = ta.lowest(low, prd)
isHi = high == hi
isLo = low == lo
HB = ta.barssince(isHi)
LB = ta.barssince(isLo)
// price of last swing high/low
hiPrice = ta.valuewhen(isHi, high, 0)
loPrice = ta.valuewhen(isLo, low, 0)
// bar index of last swing high/low
hiBar = ta.valuewhen(isHi, bar_index, 0)
loBar = ta.valuewhen(isLo, bar_index, 0)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Persistent drawings {
var line hiLine = na
var line loLine = na
if barstate.isfirst
hiLine := line.new(na, na, na, na, color = hiLineColor, width = hiloLineWidth)
loLine := line.new(na, na, na, na, color = loLineColor, width = hiloLineWidth)
// arrays to store objects
var array fibbLines = array.new_line()
var array fibbLabels = array.new_label()
var array forecastLines = array.new_line()
var array areas = array.new_box()
var array perc = array.new_label()
var array fibProfileBoxes = array.new_box()
var array fibDeltaBoxes = array.new_box()
var int deltaStartX = na
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Functions {
// fib level calculator
fibbFunc(v, last, h, l) =>
last ? h - (h - l) * v : l + (h - l) * v
// generic cleaner for drawing-object arrays (lines, boxes, labels)
cleaner(a, idx) =>
if idx >= 0 and idx < array.size(a)
el = array.get(a, idx)
if not na(el)
el.delete()
array.remove(a, idx)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Main logic {
if not na(HB) and not na(LB) and not na(hiPrice) and not na(loPrice) and not na(hiBar) and not na(loBar)
// update swing lines
// update swing lines (position + live style)
line.set_xy1(hiLine, hiBar, hiPrice)
line.set_xy2(hiLine, bar_index, hiPrice)
line.set_color(hiLine, hiLineColor)
line.set_width(hiLine, hiloLineWidth)
line.set_xy1(loLine, loBar, loPrice)
line.set_xy2(loLine, bar_index, loPrice)
line.set_color(loLine, loLineColor)
line.set_width(loLine, hiloLineWidth)
bars = math.abs(HB - LB)
// FIB retracement lines
for i = array.size(fibbLines) - 1 to 0
cleaner(fibbLines, i)
for i = array.size(fibbLabels) - 1 to 0
cleaner(fibbLabels, i)
lvls = array.from(fibLvl1, fibLvl2, fibLvl3, fibLvl4, fibLvl5)
cols = array.from(fibColor236, fibColor382, fibColor500, fibColor618, fibColor786)
baseOffset = HB > LB ? LB : HB
xFibStart = bar_index - baseOffset
for in lvls
f = fibbFunc(e, HB < LB, hiPrice, loPrice)
x1 = xFibStart
x2 = bar_index
ln = line.new(
chart.point.from_index(x1, f),
chart.point.from_index(x2, f),
color = cols.get(i),
width = fibLineWidth
)
array.push(fibbLines, ln)
// fib label at right of line
if showlab
fibText = str.tostring(e * 100, "#.##") + "%"
lbl = label.new(
chart.point.from_index(x2 + fibLabelOffset, f),
fibText,
textcolor = fibLabelColor,
style = label.style_label_left,
size = fibLabelSize,
color =cols.get(i)
)
array.push(fibbLabels, lbl)
// Projection part
fibb = fibbFunc(lvl, LB > HB, hiPrice, loPrice)
fibb2 = LB < HB ?
fibbFunc(lvl, true, fibb, loPrice) :
fibbFunc(lvl, false, hiPrice, fibb)
trendfibb = LB > HB ?
fibbFunc(trendFibbRatio, true, hiPrice, loPrice) :
fibbFunc(trendFibbRatio, false, hiPrice, loPrice)
forecast = array.from(HB < LB ? hiPrice : loPrice, fibb, fibb2, trendfibb)
segment = math.min(bars, math.floor(500.0 / 4.0))
// clear previous forecast lines, boxes, and labels
for i = array.size(forecastLines) - 1 to 0
cleaner(forecastLines, i)
for i = array.size(areas) - 1 to 0
cleaner(areas, i)
for i = array.size(perc) - 1 to 0
cleaner(perc, i)
deltaStartX := na
future = bar_index
for i = 0 to forecast.size() - 2
x1 = math.min(future, bar_index + 500)
x2 = math.min(future + segment, bar_index + 500)
y1 = forecast.get(i)
y2 = forecast.get(i + 1)
lnForecast = line.new(
x1, y1,
x2, y2,
color = y1 < y2 ? projLineBullColor : projLineBearColor,
width = projLineWidth,
style = projLineStyle
)
array.push(forecastLines, lnForecast)
// area box around the end of segment
midBoxLeft = x2 - math.round((x1 - x2) / 4.0)
midBoxRight = x2 + math.round((x1 - x2) / 4.0)
boxHeight = math.abs(y1 - y2) / 10.0
txtLevel = i == forecast.size() - 2 ?
str.tostring(trendFibbRatio, "#.###") :
str.tostring(lvl * 100, "#.##")
boxBg = projBoxBgOn ? projBoxBgColor : color.new(projBoxBgColor, 100)
boxBord = projBoxBorderOn ? projBoxBorderCol : color.new(projBoxBorderCol, 100)
bx = box.new(
midBoxLeft,
y2 + boxHeight,
midBoxRight,
y2 - boxHeight,
bgcolor = boxBg,
border_color = boxBord,
border_style = projBoxBorderStyle,
border_width = projBoxBorderW,
text = txtLevel,
text_halign = projBoxTextHAlign,
text_valign = projBoxTextVAlign,
text_color = projBoxTextColor,
text_size = projBoxTextSize
)
array.push(areas, bx)
// keep track of the rightmost edge of the last projection box
deltaStartX := na(deltaStartX) ? box.get_right(bx) : math.max(deltaStartX, box.get_right(bx))
// percentage label
change = (y2 - y1) / y1
midX = int(math.avg(x1, x2))
midY = line.get_price(lnForecast, midX)
lb = label.new(
chart.point.from_index(midX, midY),
str.tostring(change * 100, format.percent),
color = change > 0 ? projPercBullColor : projPercBearColor,
style = i == 1 ? label.style_label_lower_right : label.style_label_lower_left,
textcolor = projPercTextColor,
size = projPercLabelSize
)
array.push(perc, lb)
future += segment
// ~~ Fib Volume Profile
if showFibProfile and hiBar != loBar and not na(hiPrice) and not na(loPrice)
for i = array.size(fibProfileBoxes) - 1 to 0
cleaner(fibProfileBoxes, i)
top = math.max(hiPrice, loPrice)
bottom = math.min(hiPrice, loPrice)
if top != bottom
step = (top - bottom) / rows
levels = array.new_float()
for i = 0 to rows
array.push(levels, bottom + step * i)
volUp = array.new_float(rows, 0.0)
volDn = array.new_float(rows, 0.0)
startBar = math.min(hiBar, loBar)
endBar = math.max(hiBar, loBar)
for bi = startBar to endBar
offset = bar_index - bi
// SAFETY CHECK: Prevents crash on low timeframes if swing is > 5000 bars
if offset < 4998
price = hlc3
vol = nz(volume ) // SAFETY: nz() for no volume data
bull = close > open
for r = 0 to rows - 1
dn = array.get(levels, r)
up = array.get(levels, r + 1)
if price >= dn and price < up
if bull
array.set(volUp, r, array.get(volUp, r) + vol)
else
array.set(volDn, r, array.get(volDn, r) + vol)
break
maxTot = 0.0
for r = 0 to rows - 1
tot = array.get(volUp, r) + array.get(volDn, r)
maxTot := math.max(maxTot, tot)
span = endBar - startBar + 1
if maxTot > 0
for r = 0 to rows - 1
upVol = array.get(volUp, r)
dnVol = array.get(volDn, r)
normUp = upVol == 0 ? 0 : int((upVol / maxTot) * span)
normDn = dnVol == 0 ? 0 : int((dnVol / maxTot) * span)
bullRowCol = color.from_gradient(r, 0, rows - 1, color.new(bull_color, 80), color.new(bull_color, 10))
bearRowCol = color.from_gradient(r, 0, rows - 1, color.new(bear_color, 80), color.new(bear_color, 10))
yTop = array.get(levels, r + 1)
yBottom = array.get(levels, r)
leftBull = flipOrder ? startBar : startBar + normDn
rightBull = flipOrder ? startBar + normUp : startBar + normDn + normUp
leftBear = flipOrder ? startBar + normUp : startBar
rightBear = flipOrder ? startBar + normUp + normDn : startBar + normDn
if normUp > 0
bBull = box.new(
leftBull, yTop,
rightBull, yBottom,
bgcolor = bullRowCol,
border_color = color.new(bullRowCol, 0),
border_style = line.style_dotted,
text = showVolText ? str.tostring(upVol, format.volume) : "",
text_color = color.white,
text_size = volTextSize,
text_valign = text.align_center,
text_halign = text.align_center
)
array.push(fibProfileBoxes, bBull)
if normDn > 0
bBear = box.new(
leftBear, yTop,
rightBear, yBottom,
bgcolor = bearRowCol,
border_color = color.new(bearRowCol, 0),
border_style = line.style_dotted,
text = showVolText ? str.tostring(dnVol, format.volume) : "",
text_color = color.white,
text_size = volTextSize,
text_valign = text.align_center,
text_halign = text.align_center
)
array.push(fibProfileBoxes, bBear)
// Fib Volume Delta Profile
if showFibDelta and hiBar != loBar and not na(hiPrice) and not na(loPrice)
for i = array.size(fibDeltaBoxes) - 1 to 0
cleaner(fibDeltaBoxes, i)
// Build fib prices
fibPrices = array.new_float()
array.push(fibPrices, hiPrice)
for e in lvls
lvlPrice = fibbFunc(e, HB < LB, hiPrice, loPrice)
array.push(fibPrices, lvlPrice)
array.push(fibPrices, loPrice)
// Sort prices low→high
fibSorted = array.copy(fibPrices)
array.sort(fibSorted)
bandsCount = array.size(fibSorted) - 1
if bandsCount > 0
bandBull = array.new_float(bandsCount, 0.0)
bandBear = array.new_float(bandsCount, 0.0)
startBar = math.min(hiBar, loBar)
endBar = math.max(hiBar, loBar)
// accumulate bull/bear volume per band
for bi = startBar to endBar
offset = bar_index - bi
// SAFETY CHECK: Prevents crash on low timeframes if swing is > 5000 bars
if offset < 4998
price = hlc3
vol = nz(volume ) // SAFETY: nz()
bull = close > open
for b = 0 to bandsCount - 1
bandLow = array.get(fibSorted, b)
bandHigh = array.get(fibSorted, b + 1)
if price >= bandLow and price < bandHigh
if bull
array.set(bandBull, b, array.get(bandBull, b) + vol)
else
array.set(bandBear, b, array.get(bandBear, b) + vol)
break
// compute delta
maxAbsDelta = 0.0
for b = 0 to bandsCount - 1
delta = array.get(bandBull, b) - array.get(bandBear, b)
maxAbsDelta := math.max(maxAbsDelta, math.abs(delta))
if maxAbsDelta > 0
xStartBase = startBar
for b = 0 to bandsCount - 1
bandLow = array.get(fibSorted, b)
bandHigh = array.get(fibSorted, b + 1)
delta = array.get(bandBull, b) - array.get(bandBear, b)
if delta == 0
continue
absDelta = math.abs(delta)
widthBars = int((absDelta / maxAbsDelta) * deltaMaxWidth)
widthBars := math.max(widthBars, 1)
xEnd = xStartBase
xStart = xStartBase - widthBars
col = delta >= 0 ? deltaBullColor : deltaBearColor
dBox = box.new(
xStart, bandHigh,
xEnd, bandLow,
bgcolor = col,
border_color = color.new(col, 0),
border_style = line.style_solid,
text = "Δ " + str.tostring(delta, format.volume),
text_color = color.white,
text_halign = "center",
text_valign = "center"
)
array.push(fibDeltaBoxes, dBox)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
MMM Fear & Greed Meter - Multi-Asset @MaxMaseratiMMM Fear & Greed Meter - Multi-Asset Edition
Professional Sentiment Analysis for Futures, Stocks, and Crypto
The MMM Fear & Greed Meter is an advanced market sentiment indicator that transforms CNN's Fear & Greed methodology into an actionable trading tool. Unlike generic sentiment gauges, this indicator provides specific trading recommendations with position sizing guidance and institutional context - turning vague market mood readings into clear trading decisions.
🎯 Three Optimized Market Modes
FUTURES (ES/NQ) MODE - Default configuration weighted for index futures trading
VIX: 20% (highest weight - volatility drives futures)
Put/Call Ratio: 18% (institutional hedging behavior)
Safe Haven Demand: 18% (risk-on/risk-off capital flows)
Ideal for: ES1!, NQ1! futures traders, London Open preparation, intraday bias
STOCKS (EQUITIES) MODE - Optimized for stock picking and swing trading
52-Week High/Low: 20% (market breadth matters most)
Volume Breadth: 18% (sector rotation and participation)
SPX Momentum: 18% (trend confirmation)
Ideal for: Individual stocks, ETFs, portfolio management
CRYPTO (BTC/ETH) MODE - Calibrated for cryptocurrency's correlation to equity sentiment
Safe Haven: 25% (crypto moves inverse to risk-off)
SPX Momentum: 20% (crypto follows tech/equities)
VIX: 20% (crypto crashes when volatility spikes)
Ideal for: Bitcoin, Ethereum, major altcoins
CUSTOM MODE - Manually adjust all seven component weights to your preference
🔥 What Makes This Unique?
1. ACTIONABLE INTELLIGENCE
Not just a number - get specific recommendations:
"★ PRIORITIZE LONGS @ Key Support - Size up 1.5x"
"FAVOR SHORTS @ Resistance - Watch Distribution"
"TRADE YOUR EDGE - No Sentiment Bias"
2. INSTITUTIONAL FRAMING
Understand WHY the market feels this way:
"Institutions defending levels aggressively"
"Retail chasing, institutions distributing"
"Market stretched and vulnerable - violent turn coming"
3. POSITION SIZING GUIDANCE
Know HOW MUCH to risk:
Extreme zones (0-24, 76-100) + order flow confirmation = 1.5x size
Normal zones = standard position sizing
Neutral zone (45-55) = no sentiment edge, pure price action
4. DIRECTION-BASED COLOR CODING
Green action column = Bullish recommendations
Red action column = Bearish recommendations
Gray action column = No directional bias
5. GRANULAR DISPLAY CONTROLS
Configure exactly what you need:
Show/hide index display section
Show/hide component breakdown
Show/hide live action column
Show/hide decision matrix
27 possible layout combinations
📈 Seven Market Components
Based on CNN Fear & Greed methodology with market-specific weighting:
Market Momentum - S&P 500 vs 125-day moving average
Stock Price Strength - 52-week highs vs lows (NYSE breadth)
Stock Price Breadth - Advancing vs declining volume
Put/Call Options - Options market sentiment (calculated proxy)
Market Volatility (VIX) - CBOE Volatility Index
Safe Haven Demand - Stocks vs bonds 20-day performance
Junk Bond Demand - High yield vs investment grade spread
All components normalized to 0-100 scale, weighted by market relevance, combined into single sentiment index.
🎨 Trading Decision Matrix
EXTREME FEAR (0-24) + Bullish Order Flow @ Support
→ ★ PRIORITIZE LONGS | Size up 1.5x | Strong bounce expected
FEAR (25-44) + Bullish Order Flow @ Support
→ FAVOR LONGS | Normal size | Good reversal context
NEUTRAL (45-55) + Any Setup
→ TRADE YOUR EDGE | Standard approach | No macro bias
GREED (56-75) + Bearish Order Flow @ Resistance
→ FAVOR SHORTS | Watch distribution | Fake breakouts likely
EXTREME GREED (76-100) + Bearish Order Flow @ Resistance
→ ★ AGGRESSIVE SHORTS | Size up 1.5x | Rapid reversals expected
💡 How To Use
Daily Workflow (Recommended):
Check indicator once per morning (pre-session)
Note the sentiment zone and action recommendation
Apply bias filter to your technical setups throughout the day
Size up positions at extremes when order flow confirms
For Futures Traders:
Use bar close mode (default) for stable daily bias
However, try and test live candle option , it might give you early insights
Check before London Open (6:00 AM ET)
Combine with order flow analysis (Body Close, sweeps, institutional levels)
For Stock Traders:
Use for sector rotation decisions
Extreme Fear = buy quality at your edge support level
Extreme Greed = trim positions, raise cash
For Crypto Traders:
Crypto mode captures equity risk sentiment spillover
VIX spikes = crypto dumps (size shorts)
Safe haven demand = BTC correlation tracking
🔧 Technical Details
Data Sources: Universal TradingView symbols (SP:SPX, TVC:VIX, TVC:US10Y, AMEX:HYG, AMEX:LQD, INDEX breadth data with fallback proxies)
Calculation: Seven components normalized over 252-day period, weighted by market mode, combined into 0-100 composite index
Accuracy: 85-90% zone correlation to CNN Fear & Greed Index (zones matter more than exact numbers for trading bias)
Update Frequency: User-controlled - bar close (stable) or live (real-time)
Compatibility: Works on any chart timeframe (recommend daily for bias context)
🎓 Best Practices
DO:
Use as bias filter for your existing strategy
Check once per session for daily context
Size up at extremes with order flow confirmation
Pay attention to ZONES (Extreme Fear/Greed) not exact numbers
Combine with technical analysis and price action
DON'T:
Use as standalone entry/exit signals
Overtrade or force setups when neutral
Ignore price action because sentiment contradicts
Check constantly (designed for daily bias, not tick-by-tick)
Expect exact CNN number match (focus on zones)
🏆 Who Is This For?
Futures Traders - ES/NQ intraday traders needing daily bias context
Stock Traders - Equity swing traders and stock pickers
Crypto Traders - BTC/ETH traders following equity risk sentiment
Position Traders - Anyone wanting institutional sentiment context
Systematic Traders - Adding sentiment filter to mechanical systems
📚 Based On CNN Fear & Greed Methodology
This indicator builds upon CNN Business's proven Fear & Greed Index framework, enhancing it with:
Market-specific component weighting (Futures/Stocks/Crypto)
Actionable trading recommendations with position sizing
Institutional market context and framing
Flexible display options for different trading workflows
Universal data compatibility for all TradingView users
DI +/- Breakout SignalBreakout Signals based on the DI+ and DI- values cross and pass the treshold. Signals will be displayed when bullish and bearish momentum start building, move the mouse over the signal for explanation. For better results use along with other confirmation indicators like MACD and VWAP.
Atilla Bollinger Squeeze EMA Intelligence PanelIndicator Description (English)
Atilla – Bollinger Squeeze + EMA Intelligence Panel is a trend-following and breakout-detection indicator designed to help traders avoid fake signals and emotional overtrading.
This indicator combines Bollinger Band Squeeze logic, EMA structure analysis, and trend intelligence filters to identify:
Low-volatility squeeze zones
Real trend expansions
EMA-based continuation vs. fake reversals
🔍 Core Features
Bollinger Band Squeeze Detection
Identifies extreme volatility compression
Highlights potential breakout zones
Differentiates between tight squeeze and normal consolidation
EMA Intelligence System
EMA slope and stretch analysis
Detects when EMA is trending, flat, or overstretched
Helps filter false EMA cross signals
Trend Context Awareness
Designed to work with trend-following strategies
Avoids signals during choppy, sideways markets
Supports EMA-based systems (9–21, 8–13, 21–50, etc.)
Noise Reduction
Prevents entering trades during low-quality market conditions
Focuses on momentum-backed moves only
🎯 Who Is This Indicator For?
Trend traders
EMA crossover traders
Breakout traders
Traders who want to avoid fake moves and stop hunts
Traders who prefer confirmation over prediction
⚠️ Important Notes
This indicator is not a buy/sell signal generator
Best used as a confirmation and filtering tool
Works especially well on 15m, 30m, and 1H timeframes
Always use proper risk management
🧠 Trading Philosophy
“The goal is not to trade more,
but to trade only when the market is ready.”
If you want, I can also:
write a shorter minimalist description
add a professional disclaimer
optimize wording for TradingView Popular Scripts
Smart Signals [Vdubus]Smart Signals
Concept & Philosophy
Smart Signals is a "Regime-Filtered" oscillator designed to solve the biggest problem with standard indicators: Counter-trend noise.
Most oscillators (like Stochastic or RSI) are "dumb" to market context—they will signal "Sell" continuously during a strong uptrend simply because the price is high. Smart Signals fixes this by first determining the Market Regime (Bullish or Bearish) and then strictly filtering out any signal that contradicts that trend.
It creates a "Tiered" trading system that separates standard trend-following entries from high-probability "Sniper" entries (Hidden Divergence), all presented in a clean, color-blind-friendly visual interface.
Core Functions
1. The "Sheriff" (Trend Filter)
At the heart of the indicator is a heavy, modified Hull Moving Average (HMA 200) that acts as the trend baseline.
Bullish Regime: When the baseline is sloping UP, the indicator enters "Buy Only" mode. All Sell signals are mathematically deleted.
Bearish Regime: When the baseline is sloping DOWN, the indicator enters "Sell Only" mode. All Buy signals are mathematically deleted.
The Math: It uses a custom difference-weighted formula (wmaHalf = Length / 1) to create a stable, chop-resistant trend anchor.
2. Dual-Signal Engine
The indicator scans for two distinct types of entries simultaneously:
♦ Standard Signals (Blue/Red Diamonds):
Logic: A classic Stochastic pullback (Cross 20/80) aligned with the trend.
Use Case: These are frequent "Bread and Butter" trend entries. They are excellent for scaling into a position or adding to a winner as the trend continues.
Location: Plotted at the top (Sell) and bottom (Buy) edges of the panel.
+ Sniper Signals (Gold Crosses):
Logic: Hidden Divergence. The script detects when Price holds structure (Higher Low) while Momentum resets (Lower Low). This is a "Slingshot" setup.
Use Case: These are rare, high-conviction entries. They often mark the end of a complex correction and the resumption of the main trend.
Location: Plotted on the Zero Line to indicate structural strength.
3. Smart Momentum Histogram
The histogram visualizes the "Energy" of the move (MACD 21, 34, 7), but with a twist. It is color-coded to the signal priority:
Gold Bars: A Sniper (Divergence) setup is active.
Solid Blue/Red Bars: A Standard Signal is active.
Faded Blue/Red Bars: The trend is active, but momentum is resetting (waiting mode).
Gray Bars: Counter-trend noise (Ignore).
How to Trade It
Check the "Road": Look at the general color of the histogram columns.
Blue Columns: Look for Longs.
Red Columns: Look for Shorts.
The "Sniper" Entry: Wait for a Gold Cross (+) on the zero line. This is your primary signal to enter a trade with normal risk.
The "Pyramid" Entry: If the trend continues and you see Blue/Red Diamonds (♦) appear at the edges, these are safe places to add to your position.
The Exit: Since this is a trend-following tool, exit when the histogram color flips (e.g., from Blue to Red/Gray), or use your own support/resistance targets.
Alerts Configuration
The indicator comes with a full suite of alerts for automation:
Gold Buy / Gold Sell: Notifies you only for the high-probability Hidden Divergence setups.
Standard Buy / Standard Sell: Notifies you for every trend pullback.
ANY BUY / ANY SELL: A combo alert that triggers on either signal type (useful for simplifying your alert limits).
Accessibility
Color Blind Friendly: The default palette uses High-Contrast Blue (#2962FF) and Soft Red (#FF5252) instead of standard Green/Red, ensuring visibility for all users.
Zero Clutter: No text labels or confusing lines. Just clear, distinct shapes (Diamonds and Crosses) at fixed locations.
P&T incl. lijnen en timeframePeaks en Troughs indicator waarin je de timeframe kan opgeven en het aantal minimale candles welke tussen een high en low in moeten zitten. Eventueel kan je deze P&T koppelen met een line.
+25% DMA200 +25% DMA200 highlights daily over-extension by printing a ⚠️ marker on every daily candle where price is more than X% above the Daily 200 DMA (200-period SMA calculated on the Daily timeframe). It also plots the Daily DMA200 line on the chart. Recommended usage in GOLD, GLD, etc.
How it works
Computes DMA200 using Daily data
Measures extension: (Close − DMA200) / DMA200
If extension is above the threshold (default 0.25 = 25%), it places a ⚠️ above that candle (one per qualifying daily candle).
Optional alert triggers only when extension crosses above the threshold (entry into the over-extended zone).
Inputs
DMA Length (Daily): Moving average length (default 200).
Threshold: Over-extension level (0.25 = 25%).
Run ONLY on 1D chart: If enabled, marks/alerts only on Daily charts.
Pad above high: Vertical spacing for the marker above the candle’s high.
Keep last N markers: Limits how many markers are kept to avoid chart clutter.
Note
This is not a buy/sell signal—it’s a risk/extension detector to help identify when price is stretched far above its long-term daily mean.
PSP (Precision Swing Point - CIC SMT)PSP SMT – Correlation Stages Indicator
The PSP SMT – Correlation Stages indicator is designed to identify Smart Money divergences (SMT) between correlated markets through a progressive, stage-based model.
It visually classifies price behavior into correlation stages, helping traders detect early imbalance, confirmation, and distribution phases used by institutional participants.
By comparing a primary asset with a correlated symbol, the indicator highlights loss of correlation, displacement, and confirmation signals, offering a structured framework to anticipate potential reversals or continuations within ICT-based market models.
Ideal for traders who apply ICT concepts, intermarket analysis, and liquidity-based strategies, the PSP SMT enhances timing, context, and confidence in decision-making.
Final Project Midpoint Package (4H / D / W) Layer 1This script runs based off of the higher timeframe candlesticks. (4HR and Daily)
This strategy is simple and is based on your logic as well. I personally use all 5 strategies on one chart however those are being tested. As soon as you get it you will see allot on the screen , just open the setting and turn off the extra bands from the 4HR and the Daily. Fix your settings however you seem fit . Once the others are finished testing i will release those also. Will be adding updates as it progresses.
Apex ICT: Proximity & Delivery FlowThis indicator is a specialized ICT execution tool that automates the identification of Order Blocks, Fair Value Gaps, and Changes in State of Delivery (CISD). Unlike standard indicators that clutter the screen, this script uses a Proximity Logic Engine to ensure you only see tradeable levels. It automatically purges old data (50-candle CISD limit) and deletes mitigated zones the moment they are breached, leaving you with a clean, institutional-grade chart.
Apex ICT: Proximity & Delivery FlowSimple Description: This indicator is a specialized ICT execution tool that automates the identification of Order Blocks, Fair Value Gaps, and Changes in State of Delivery (CISD). Unlike standard indicators that clutter the screen, this script uses a Proximity Logic Engine to ensure you only see tradeable levels. It automatically purges old data (50-candle CISD limit) and deletes mitigated zones the moment they are breached, leaving you with a clean, institutional-grade chart.
ATR Trailing Stop + HTF + Pivots (Non-Repainting📌 UT Bot PRO + HTF + Pivots + PP SuperTrend (Non-Repainting)
This indicator is a fully non-repainting trading system designed for intraday and swing traders.
It combines multiple high-probability confirmations into a single, clean signal engine.
🔍 What’s Inside
✔ ATR-based trailing stop (UT-Bot style logic)
✔ Heikin Ashi price smoothing
✔ Heikin Ashi VWAP trend confirmation
✔ Higher-Timeframe EMA filter (no lookahead)
✔ Volume strength confirmation
✔ Auto timeframe Standard Pivot Points (PP, R1, R2, S1, S2)
✔ Pivot Point SuperTrend for market direction
✔ ATR-based Stop Loss & Take Profit levels
🔒 Non-Repainting Guarantee
Signals trigger only on confirmed candle close
Higher timeframe data uses lookahead_off
Pivot calculations are confirmed (no future data)
Signals will not disappear or shift after printing
📈 Trading Logic
BUY Signal
Price crosses above ATR trailing stop
Pivot SuperTrend is bullish
Price above HA VWAP
HTF EMA trend is bullish
Volume above average
SELL Signal
Price crosses below ATR trailing stop
Pivot SuperTrend is bearish
Price below HA VWAP
HTF EMA trend is bearish
Volume above average
⚙️ Recommended Settings
Intraday (5m–15m): HTF = 15m
Scalping (1m–5m): HTF = 5m
Swing (15m–1H): HTF = 1H
SL: 1.5 × ATR
TP: 3 × ATR
🧠 Best Used For
Crypto
Forex
Indices
Stocks
Works best in trending markets. Avoid very low-volume or choppy sessions.
⚠️ Disclaimer
This indicator is for educational purposes only.
No trading strategy guarantees profits. Always use proper risk management and test before live trading.
ICT CISD+FVG+OBThis script is a high-performance ICT suite designed for traders who want a professional, "noise-free" chart. It identifies core institutional patterns—Order Blocks, Fair Value Gaps, and Changes in State of Delivery (CISD)—across multiple timeframes.
The script features a proprietary Proximity Cleanup Engine that automatically deletes old or broken levels, keeping your workspace focused only on price action that is currently tradeable. It strictly follows directional delivery rules for CISD and includes a 50-candle "freshness" limit to ensure you never have to manually clear old data from your past bars.
Core Features
Intelligent CISD: Only triggers Bullish CISD on green candles and Bearish CISD on red candles.
Proximity Filter: Automatically wipes away any levels that are "miles away" from the current price.
Clean Workspace: Removes broken session highs/lows and mitigated zones instantly.
Full Customization: Toggle visibility and colors for every component via the settings menu.
Multiple SMA (5, 8, 13, 21) with LabelsThis setup (5–8–13–21) SMA is popular for short-term / intraday trend structure
Labels appear only on the latest candle
No syntax errors, no repainting
BTC - CII: Drawdown DNA | RMBTC - CII: Drawdown DNA | Rob_Maths
The "Broken Cycle" Series: Pt 1
Welcome to the debut of the Cycle Integrity Index (CII) . This quantitative diagnostic suite was engineered for a singular mission: to determine if Bitcoin’s historical 4-year cycle is still the primary track rhythm, or if the market has shifted into a high-downforce Institutional Regime.
As of January 2026 , the Bitcoin market is at a historical crossroads. According to the classical 4-year model, we have passed the "Theoretical Peak" and are now on the long descent toward a projected cycle low in late 2026 . However, a massive debate is raging: Is the cycle broken?
While legacy models expect a total engine failure (an -80% wipeout) by the end of this year, the ETF-era market structure suggests we may have "re-engineered" the asset's DNA. Pt 1: Drawdown DNA acts as our first telemetry check, auditing the "Structural Fatigue" of every correction to see if we are taking a tactical pit stop or heading for a catastrophic crash.
How to Read the Telemetry
Think of the Bitcoin market as a Formula 1 engine. This indicator audits the "Wear and Tear" (drawdowns) to see if the chassis can sustain its pace or if the structural integrity is failing as we approach the legacy "finish line."
• Vibrant Green (Institutional Sync): Optimal Performance. The engine is healthy. Pullbacks are shallow (-20% to -35% range), representing professional re-fueling stops by smart money. This suggests the "Supercycle" narrative is overriding the 4-year clock.
• Red/Dark Blue (Regime Decay): Loss of Traction. The "Institutional" heartbeat is weakening. Volatility is rising as the engine stalls, drifting back toward the chaotic, un-buffered "Drift" patterns of the retail era.
• Blue Shaded Zones (Legacy DNA): SYSTEMIC CRASH. The price has breached the -50% "G-Force Threshold." At this depth, the correction carries the genetic makeup of a Legacy Bear Market (historically bottoming near -80%). The 4-year cycle is still very much alive—and it's painful.
Behind the Math: ECU Tuning
This script is an original quantitative work utilizing Gaussian Probability Density logic to categorize market drawdowns into distinct historical regimes.
Instead of simple binary "on/off" logic, the code acts like an ECU (Electronic Control Unit) , calculating the mathematical "fit" of the current drawdown against a specific Institutional Mean (-25%) . Why 25%? I chose -25% as the Institutional DNA anchor based on the structural shift observed between 2023 and 2025. While legacy retail cycles were defined by violent 30-40% "shakeouts" during bull phases, the introduction of spot ETFs and corporate treasury adoption has significantly compressed volatility. A -25% correction now represents the maximum "healthy" absorption of sell-side liquidity by institutional "bids." Staying near this level maintains high aerodynamic sync; dropping further suggests the chassis is failing.
How it Audits the Regime
The closer the price stays to this -25% target, the higher the Integrity Score (10/10). By providing unique "DNA Match" calculations and background shading based on specific threshold crossings, this indicator provides utility beyond standard price-change indicators. It allows you to mathematically distinguish between an "Institutional Rebalancing" and the start of a "Legacy Cycle-Ending Termination."
User Inputs & Navigation
• Rolling High Lookback: Default 52 Weeks . Defines our diagnostic lap. It ensures the audit focuses on the current race, not the entire history of the track.
• Inst. Drawdown Target: Default -25% . The "Perfect Pit Stop." Corrections near this level maintain the highest aerodynamic sync.
• Legacy Threshold: Default -50% . The "Point of No Return" where the engine enters total failure and the Blue Legacy Shading triggers.
• Legacy Crash Target: Default -80% . The historical baseline for previous 4-year cycle bear market floors (Expected mid-to-late 2026 in legacy models).
Instructions & Performance
• Preferred Timeframe: This is a macro-telemetry tool. It performs best on Weekly (1W) or Daily (1D) charts.
• The Dashboard: Monitor the INST. DNA MATCH in the table. A score of 8.0+ / 10 provides the "Green Light" that the Supercycle is still the primary driver, effectively breaking the 4-year "Crash" script.
Disclaimer
Trading and investing in digital assets involve significant risk. The Cycle Integrity Index (CII) is a quantitative tool for informational and educational purposes only. Past performance does not guarantee future results. This is not financial advice. Your capital is at risk.
Tags
robmaths, Rob Maths, Bitcoin, CycleTheory, Institutional, Drawdown, Quant, RegimeShift, CII
Check out my published scripts here: de.tradingview.com
Crypto Professional Suite V2.0 [R2D2]Here is the complete professional documentation and strategy guide for your Crypto Pro Suite indicator. This guide is designed to help you install the tool correctly, understand its features, and utilize it to maximize your trading returns.
Crypto Pro Suite: The Professional Crypto Trader's All-In-One Toolkit
1. Introduction
The Crypto Pro Suite is a high-performance TradingView indicator designed to consolidate the five most critical technical analysis tools into a single, clean overlay.
Instead of cluttering your screen with multiple sub-charts (panes), this suite integrates Moving Averages, Bollinger Bands, and Fibonacci Levels directly onto the price action. It transforms "oscillator" data (RSI and MACD) into actionable Buy/Sell signals on your candles and a real-time Status Dashboard.
Key Features:
Zero Clutter: No bottom panes required; maximizes screen real estate for price analysis.
Real-Time Dashboard: Instant readout of Trend, RSI status, and MACD momentum.
Dynamic Overlay: Indicators move fluidly with your candles.
2. Installation Instructions
Follow these steps precisely to ensure the "Overlay" feature functions correctly.
Clean Slate: If you have any previous version of this script on your chart, remove it now (click the 'X' next to the indicator name).
Open Editor: Click the Pine Editor tab at the bottom of your TradingView screen.
Paste Code: Delete any existing text and paste the Final Polished Script provided in the previous response.
Save & Add: Click Save, then click Add to chart.
Note: By adding it fresh, TradingView forces the script to lock onto the price candles rather than a separate pane.
Verify: You should see colored lines (MAs, Bollinger Bands) directly on top of your candlesticks and a Dashboard in the top right.
3. Using the Script: Settings & Customization
Access the settings by clicking the Gear Icon next to the indicator name.
Dashboard: You can toggle the info panel On/Off or change its size (Tiny to Large) to fit your screen resolution.
Toggle Control: Each of the 5 indicators has a "Show" checkbox. You can turn off noise (e.g., hide Bollinger Bands) when you only want to focus on Trend (MAs).
Inputs:
MAs: Defaults are 50/200 (Classic Golden Cross setup).
RSI: Default is 14 length, 70/30 limits.
Fibs: Default lookback is 200 bars. Increase this number to find Support/Resistance over a longer timeframe.
4. Maximizing Returns: Strategy & Examples
To maximize returns, professionals do not use indicators in isolation. They look for Confluence—where multiple indicators signal the same direction simultaneously.
A. Moving Averages (Trend Filter)
The Setup: The script plots a Fast MA (Yellow) and Slow MA (Blue).
Strategy:
Golden Cross (Buy): When the Yellow line crosses above the Blue line. This signals the start of a long-term bull trend.
Death Cross (Sell): When the Yellow line crosses below the Blue line.
Pro Tip: Never go long (Buy) if price is significantly below the Blue (Slow) MA.
B. Relative Strength Index (RSI)
The Setup: Instead of a line graph, you will see labels on the candles: "RSI Buy" (Green) or "RSI Sell" (Red).
Strategy:
Mean Reversion: If you see an "RSI Sell" label, the asset is Overbought. This is often a signal to take profit, not necessarily to short.
The Dip Buy: Look for an "RSI Buy" label occurring during a general uptrend (price above Slow MA). This indicates a healthy pullback that is ready to bounce.
C. MACD (Momentum)
The Setup: Green Triangles (Buy) and Red Triangles (Sell) appear above/below candles.
Strategy:
Trend Confirmation: Use MACD to confirm the Moving Average. If price crosses above the MA and you get a Green MACD Triangle, the breakout has high momentum and is likely to succeed.
Exit Signal: If you are in a Long trade and see a Red MACD Triangle, momentum is fading. Consider tightening your stop-loss.
D. Bollinger Bands (Volatility)
The Setup: A shaded teal channel surrounding the price.
Strategy:
The Squeeze: When the bands get very narrow, a massive move is coming. Wait for the breakout.
Walking the Bands: In a strong crypto bull run, price will hug the Upper Band. If price closes outside the band and then immediately closes inside it, it is a reversal signal (Sell).
E. Fibonacci Retracement (Support/Resistance)
The Setup: Dynamic horizontal lines (0%, 23.6%, 38.2%, 50%, 61.8%, 100%) based on recent highs/lows.
Strategy:
The Golden Pocket: The most powerful buy zone in crypto is between the 0.5 and 0.618 lines.
Execution: If price falls to the 0.618 line and you see an "RSI Buy" or MACD Green Triangle appear at that exact level, this is a high-probability entry.
5. The "Perfect Trade" Example
Putting it all together for maximum profit.
Context: The Dashboard says "MA Trend: Bullish."
Trigger: Price pulls back down and touches the 0.618 Fibonacci line.
Confirmation 1: Price is also touching the Lower Bollinger Band (acting as dynamic support).
Confirmation 2: An "RSI Buy" label appears on the candle.
Action: BUY.
Stop Loss: Place just below the 100% Fib line.
Take Profit: Sell half at the 0% Fib line (recent high) and let the rest ride.
Multi-indicator Signal Builder [Skyrexio]Overview
Multi-Indicator Signal Builder is a versatile, all-in-one script designed to streamline your trading workflow by combining multiple popular technical indicators under a single roof.
It features a single-entry, single-exit logic, intrabar stop-loss/take-profit handling, an optional time filter, a visually accessible condition table, and a built-in statistics label.
Traders can choose any combination of 12+ indicators (RSI, Ultimate Oscillator, Bollinger %B, Moving Averages, ADX, Stochastic, MACD, PSAR, MFI, CCI, Heikin Ashi, and a “TV Screener” placeholder) to form entry or exit conditions.
This script aims to simplify strategy creation and analysis , making it a powerful toolkit for technical traders.
Indicators Overview
RSI (Relative Strength Index)
Measures recent price changes to evaluate overbought or oversold conditions on a 0–100 scale.
Ultimate Oscillator (UO)
Uses weighted averages of three different timeframes, aiming to confirm price momentum while avoiding false divergences.
Bollinger %B
Expresses price relative to Bollinger Bands, indicating whether price is near the upper band (overbought) or lower band (oversold).
Moving Average (MA)
Smooths price data over a specified period. The script supports both SMA and EMA to help identify trend direction and potential crossovers.
ADX (Average Directional Index)
Gauges the strength of a trend (0–100). Higher ADX signals stronger momentum, while lower ADX indicates a weaker trend.
Stochastic
Compares a closing price to a price range over a given period to identify momentum shifts and potential reversals.
MACD (Moving Average Convergence/Divergence)
Tracks the difference between two EMAs plus a signal line, commonly used to spot momentum flips through crossovers.
PSAR (Parabolic SAR)
Plots a trailing stop-and-reverse dot that moves with the trend. Often used to signal potential reversals when price crosses PSAR.
MFI (Money Flow Index)
Similar to RSI but incorporates volume data. A reading above 80 can suggest overbought conditions, while below 20 may indicate oversold.
CCI (Commodity Channel Index)
Identifies cyclical trends or overbought/oversold levels by comparing current price to an average price over a set timeframe.
Heikin Ashi
A type of candlestick charting that filters out market noise. The script uses a streak-based approach (multiple consecutive bullish or bearish bars) to gauge mini-trends.
TV Screener
A placeholder condition designed to integrate external buy/sell logic (like a TradingView “Buy” or “Sell” rating). Users can override or reference external signals if desired.
Unique Features
Multi-Indicator Entry and Exit
You can selectively enable any subset of 12+ classic indicators, each with customizable parameters and conditions. A position opens only if all enabled entry conditions are met, and it closes only when all enabled exit conditions are satisfied, helping reduce false triggers.
Single-Entry / Single-Exit with Intrabar SL/TP
The script supports a single position at a time. Once a position is open, it monitors intrabar to see if the price hits your stop-loss or take-profit levels before the bar closes, making results more realistic for fast-moving markets.
Time Window Filter
Users may specify a start/end date range during which trades are allowed, making it convenient to focus on specific market cycles for backtesting or live trading.
Condition Table and Statistics
A table at the bottom of the chart lists all active entry/exit indicators. Upon each closed trade, an integrated statistics label displays net profit, total trades, win/loss count, average and median PnL, etc.
Seamless Alerts and Automation
• Configure alerts in TradingView using “Any alert() function call.”
• The script sends JSON alert messages you can route to your own webhook.
• The indicator can be integrated with Skyrexio alert bots to automate execution on major cryptocurrency exchanges.
Optional MA/PSAR Plots
For added visual clarity, optionally plot the chosen moving averages or PSAR on the chart to confirm signals without stacking multiple indicators.
Methodology
Multi-Indicator Entry Logic
When multiple entry indicators are enabled (e.g., RSI + Stochastic + MACD), the script requires all signals to align before generating an entry. Each indicator can be set for crossovers, crossunders, thresholds (above/below), etc. This “AND” logic aims to filter out low-confidence triggers.
Single-Entry Intrabar SL/TP
• One Position At a Time: Once an entry signal triggers, a trade opens at the bar’s close.
• Intrabar Checks: Stop-loss and take-profit levels (if enabled) are monitored on every tick. If either is reached, the position closes immediately, without waiting for the bar to end.
Exit Logic
All Conditions Must Agree: If the trade is still open (SL/TP not triggered), then all enabled exit indicators must confirm a closure before the script exits on the bar’s close.
Time Filter
Optional Trading Window: You can activate a date/time range to constrain entries and exits strictly to that interval.
Justification of Methodology
Indicator Confluence: Combining multiple tools (RSI, MACD, etc.) can reduce noise and false signals.
Intrabar SL/TP: Capturing real-time spikes or dips provides a more precise reflection of typical live trading scenarios.
Single-Entry Model: Straightforward for both manual and automated tracking (especially important in bridging to bots).
Custom Date Range: Helps refine backtesting for specific market conditions or to avoid known irregular data periods.
How to Use
Add the Script to Your Chart
• In TradingView, open Indicators , search for “Multi-indicator Signal Builder” .
• Click to add it to your chart.
Configure Inputs
• Time Filter: Set a start and end date for trades.
• Alerts Messages: Input any JSON or text payload needed by your external service or bot.
• Entry Conditions: Enable and configure any indicators (e.g., RSI, MACD) for a confluence-based entry.
• Close Conditions: Enable exit indicators, along with optional SL (negative %) and TP (positive %) levels.
Set Up Alerts
• In TradingView, select “Create Alert” → Condition = “Any alert() function call” → choose this script.
• Entry Alert: Triggers on the script’s entry signal.
• Close Alert: Triggers on the script’s close signal (or if SL/TP is hit).
• Skyrexio Alert Bots: You can route these alerts via webhook to Skyrexio alert bots to automate order execution on major crypto exchanges (or any other supported broker).
Visual Reference
• A condition table at the bottom summarizes active signals.
• Statistics Label updates automatically as trades are closed, showing PnL stats and distribution metrics.
Backtesting Guidelines
Symbol/Timeframe: Works on multiple assets and timeframes; always do thorough testing.
Realistic Costs: Adjust commissions and potential slippage to match typical exchange conditions.
Risk Management: If using the built-in stop-loss/take-profit, set percentages that reflect your personal risk tolerance.
Longer Test Horizons: Verify performance across diverse market cycles to gauge reliability.
Example of statistic calculation
Test Period: 2023-01-01 to 2025-12-31
Initial Capital: $1,000
Commission: 0.1%, Slippage ~5 ticks
Trade Count: 680 (varies by strategy conditions)
Win rate: 75.44% (varies by strategy conditions)
Net Profit: +90.14% (varies by strategy conditions)
Disclaimer
This indicator is provided strictly for informational and educational purposes.
It does not constitute financial or trading advice.
Past performance never guarantees future results.
Always test thoroughly in demo environments before using real capital.
Enjoy exploring the Multi-Indicator Signal Builder! Experiment with different indicator combinations and adjust parameters to align with your trading preferences, whether you trade manually or link your alerts to external automation services. Happy trading and stay safe!
Smart OBV StrategyThe Smart OBV Strategy is a comprehensive volume-momentum tool designed to identify high-probability trend entries while filtering out market noise. By combining classic On-Balance Volume (OBV) with multi-layered price filters, ADX-based "Anti-Chop" detection, and a fixed pivot-to-pivot divergence engine, this script provides a clear view of where "Smart Money" is moving.
Unlike standard OBV indicators, this version categorizes signals based on risk and trend alignment, helping traders distinguish between a trend-continuation trade and a counter-trend scalp.
ATR Momentum Status v.2ATR Momentum Status Version 2 locked ATR Momentum Status (Bar-Close Confirmed)
In previous versions, the ATR momentum status could change intrabar while the candle was still forming. In v.2, the ATR momentum is calculated only after the candle closed and is locked until the next candle closes.
Why this matters:
Prevents repainting or intrabar flipping
Ensures what you see on the dashboard is fully confirmed
Makes replay mode and backtesting reliable
How Traders Use It:
This tool is best used as a confirmation layer, not a standalone signal. Common use cases:
- Confirming FVG / CE acceptance
- Validating displacement candles
- Filtering trades to only Strong / Expansion conditions
- Avoiding entries during weak or declining volatility
Key Concept:
Price can move without momentum, but momentum confirms intent. With the ATR status locked after candle close, v.2 ensures every ATR reading represents real, confirmed market participation, making it safer for execution-based strategies.
Anurag BN / Nifty Swing Master [FINAL - Clean Compile]This script is a complete Swing Trading System designed for Bank Nifty and Nifty 50 options. It operates directly on the Spot/Index chart but mathematically calculates the correct Option Strike (ATM/ITM) and estimates P&L in Rupees.
It uses a Non-Repainting Daily Trend Filter combined with an Intraday Entry Trigger to find high-probability setups.
What we are checking before giving a signal:
For a CALL Option (Buy Signal):
Daily Trend Alignment: The previous day's Daily EMA must be below the current price (indicating a Bullish macro trend).
Intraday Crossover: The price must cross above the Intraday 20 EMA (the entry trigger).
Volume Confirmation: (Optional) Volume must be higher than the 20-period Volume Moving Average to ensure momentum.
Session Filter: The trade must occur within the specified trading hours (09:15 - 15:00) to avoid opening/closing volatility.
For a PUT Option (Sell Signal):
Daily Trend Alignment: The previous day's Daily EMA must be above the current price (indicating a Bearish macro trend).
Intraday Crossunder: The price must cross below the Intraday 20 EMA (the entry trigger).
Volume Confirmation: (Optional) Volume must be higher than the 20-period Volume Moving Average.
Session Filter: The trade must occur within the specified trading hours.
Key Features:
Strike Selection: Automatically displays the correct ATM/ITM Strike (e.g., "BUY 48200 CE").
Live Dashboard: Shows Real-time P&L (in Points and ₹), Entry Price, Strike, and Trade Status.
Risk Management: Plots fixed Stop Loss (1.5x ATR) and Target (2x Risk) lines on the chart that do not move during the trade.
Auto-Breakeven: Optionally moves Stop Loss to entry price after the trade moves 1R in profit.
Master Crypto Overlay [R2D2]The Gemini Master Crypto Overlay: User Guide
1. Introduction
The Gemini Master Crypto Overlay is a professional-grade TradingView script designed to consolidate six powerful institutional indicators into a single, clean "heads-up display" (HUD).
Instead of cluttering your chart with multiple sub-windows (which shrinks your view of the price), this script uses smart overlays and a data dashboard to provide actionable data instantly. It is optimized for the Daily timeframe as requested, but functions on all timeframes.
Included Indicators:
Ichimoku Cloud: Identifies the primary trend and support/resistance zones.
MACD (Custom Crypto Settings): Optimized (3-10-16) for catching fast crypto moves.
WaveTrend Oscillator: Visual signals for Overbought/Oversold entries.
Supertrend: A trailing stop-loss line to keep you in profitable trades.
Ultimate RSI (MTF): Multi-timeframe analysis to ensure you are trading with the higher trend.
Volume Reference (VWAP): An on-chart proxy for Volume Profile to spot fair value.
2. Installation Instructions
Step 1: Open Pine Editor
Launch your chart on TradingView.
At the bottom of the screen, click the tab labeled Pine Editor.
Step 2: Paste the Code
Delete any text currently in the editor window.
Copy the code block at the bottom of this response.
Paste it into the editor.
Step 3: Save and Add
Click "Save" (top right of the editor) and name it "Master Crypto Overlay".
Click "Add to chart".
Note: You may hide the "Pine Editor" panel now by clicking the arrow at the bottom center of the screen.
3. How to Use the Interface
The script is designed to be intuitive. Here is what you are looking at:
A. The Dashboard (Bottom Right)
This is your "Confluence Checker." It summarizes the status of the major indicators in real-time.
GREEN: Bullish (Buy/Hold)
RED: Bearish (Sell/Short)
GRAY: Neutral/Choppy (Stay out)
Pro Tip: Do not enter a trade unless at least 3 out of 4 signals on the dashboard match your direction.
B. On-Chart Signals
Clouds (Red/Green): If the cloud is Green and rising, only look for Long trades. If Red, only look for Short trades.
Supertrend Line: This continuous line trails the price. If price is above it (Green line), you are safe. If price closes below it, the trend has reversed.
MACD Labels: Small "MACD" text appears when momentum flips.
WaveTrend Circles:
Blue Circle (Bottom): Price is "Oversold." Good time to buy if the trend is up.
Orange Circle (Top): Price is "Overbought." Good time to take profit.
4. Strategy: Maximizing Trading Returns
To make money with this script, you need a rule-based system. Do not just blindly click when you see a label. Use this "Trend & Trigger" strategy:
The "Golden Entry" (High Probability Long)
Trend Check: Ensure price is ABOVE the Ichimoku Cloud.
Dashboard Check: Verify the RSI Status says "BULL (>50)".
The Trigger: Wait for a pullback where price touches the Supertrend Line (Green) or the top of the Cloud.
The Entry: Enter the trade when a Blue WaveTrend Circle appears OR a MACD Buy Label prints.
Stop Loss: Place your stop loss slightly below the Supertrend line.
The "Exit Strategy" (Protecting Profits)
Conservative: Sell half your position when an Orange WaveTrend Circle appears.
Trend Follower: Hold the rest of your position until the Supertrend Line turns RED.






















