QUARTERLY THEORY TRUE OPENSQUARTERLY THEORY TRUE OPENS
Multi-cycle True Open indicator based on quarterly cycle theory, with precise cycle-begin termination logic.
OVERVIEW
TRUE OPENS (Cycle Q2) plots the True Open (Q2 open) across multiple market cycles and extends each level only until the next cycle begins.
This mirrors how price actually respects quarterly structure: a True Open is relevant only within its active cycle.
The indicator uses New York (exchange) time, is DST-aware, and relies on a 1-minute event engine to ensure accuracy and visibility across all intraday and higher timeframes — even when candle opens do not align with exact timestamps (e.g., 4H, Daily, Weekly charts).
WHAT IS A TRUE OPEN?
In quarterly cycle theory, each cycle is divided into four quarters (Q1–Q4).
The Q2 opening price — the True Open — often acts as:
A gravitational price level
A premium/discount reference
A mean price the market revisits during the cycle
This indicator tracks those Q2 opens across Micro, Session, Daily, Weekly, Monthly, and Yearly cycles, while respecting each cycle’s actual beginning and end.
CYCLES & DEFINITIONS
All times are New York (Exchange Time).
Micro Cycle
True Opens (Q2):
:22:30 and :52:30
Automatically rounded down on the 1-minute chart (:22, :52)
Cycle Begins:
18:45, 19:30, 20:15, 21:00
Repeats every 45 minutes, anchored at 18:45
Session Cycle (6-Hour)
True Opens (Q2):
19:30, 01:30, 07:30, 13:30
Cycle Begins:
18:00, 00:00, 06:00, 12:00
Daily Cycle
True Open (Q2):
00:00
Cycle Begins:
18:00
Weekly Cycle
True Open (Q2):
Monday 18:00
Cycle Begins:
Sunday 18:00
Monthly Cycle
True Open (Q2):
Second Monday of the month at 00:00
Cycle Begins:
First Sunday of the month at 18:00
Yearly Cycle
True Open (Q2):
First weekday of April at 00:00
Cycle Begins:
First Sunday of the year at 18:00
VISUAL LOGIC
Each True Open is plotted as a horizontal dotted line
The line:
Starts exactly at the True Open candle
Ends automatically when the next cycle begins
When a cycle ends, its line is finalized (solid)
Each cycle is handled independently
Optional labels are placed just after the line end, aligned mid-right
LABELS
Optional, concise labels for clarity:
TMSO — Micro True Open
TSO — Session True Open
TDO — Daily True Open
TWO — Weekly True Open
TMO — Monthly True Open
TYO — Yearly True Open
Text size is fully configurable (Tiny → Large).
TIMEFRAME VISIBILITY (AUTO MODE)
To keep charts clean and relevant, cycles auto-hide above sensible timeframes:
Micro: ≤ 1-minute
Session: ≤ 5-minute
Daily: ≤ 15-minute
Weekly: ≤ 1-hour
Monthly: ≤ 4-hour
Yearly: ≤ Weekly
A Custom mode allows full manual control.
TECHNICAL FEATURES
Pine Script v6
No repainting
No future leakage
No bar-index assumptions
DST-aware New York time handling
1-minute event engine ensures:
Monthly levels appear on 4H charts
Yearly levels appear correctly when history exists
Performance-safe (no loops, no heavy arrays)
HOW TO USE
Use Micro & Session True Opens for precision intraday entries
Use Daily & Weekly True Opens for bias and mean-reversion context
Look for confluence when multiple True Opens align near the same price
Respect cycle boundaries — once a cycle begins, its prior True Open loses relevance
IMPORTANT NOTES
Yearly True Opens require chart history that includes April
Continuous contracts (e.g., ES1!, NQ1!) are recommended for futures
Works on Forex, Futures, Indices, Crypto, and Stocks
DISCLAIMER
This indicator is for educational and informational purposes only.
It does not constitute financial advice. Past performance is not indicative of future results.
Always manage risk responsibly.
圖表形態
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)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
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.
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.
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
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.
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.
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.
Ram - EMA Crossover SignalThis is a EMA cross signals based on 20 50 and 200.
This will raise an alert when all EMA cross either up or down.
Crypto Swing Pro [All-in-One] v2 [R2D2]1. Introduction
Crypto Swing Pro (CSP) is a professional-grade technical analysis suite designed for high-volatility cryptocurrency markets. It consolidates the top five institutional-grade indicators—RSI, EMAs, OBV, MACD, and Bollinger Bands—into a single overlay.
New in v2.0: The script now includes a fully integrated Alert System. You no longer need to stare at the chart all day. You can set the script to email you or ping your phone exactly when a MACD Cross occurs or when Volatility Squeezes, ensuring you never miss a move.
2. Installation
1. Open TradingView: Go to your chart.
2. Open Pine Editor: Click the tab at the bottom of the screen.
3. Paste Code: Delete existing code and paste the v2.0 script above.
4. Save: Name it CSP v2.
5. Add to Chart: Click "Add to Chart".
3. How to Set Up Alerts
This is the most powerful feature of v2.0. You can set alerts for specific conditions without needing to write code.
1. Click the "Alert" Button: Located on the top menu bar of TradingView (looks like an alarm clock).
2. Condition: In the "Condition" dropdown menu, select CSP v2.
3. Select Trigger: A second dropdown will appear. Choose the specific signal you want to track:
MACD Buy Signal: Triggers when MACD crosses bullish.
RSI Oversold (<30): Triggers when price is mathematically cheap.
Volatility Squeeze: Triggers when a big move is imminent.
Price Cross Over 200 EMA: Triggers on major trend reversals.
4. Options: Select "Once Per Bar Close" (Recommended to avoid false signals during the candle fluctuation).
5. Notify: Check "Notify in App" or "Send Email".
6. Create: Click Create. You will now be notified even if you are asleep.
4. The Dashboard (HUD)
The on-screen table gives you an instant "Health Check" of the asset.
Indicator Status Meaning
RSI (14) Green (<30) Oversold. Look for long entries.
Red (>70) Overbought. Look to take profit.
MACD BULLISH Momentum is up.
TREND UPTREND Price is above the 200 EMA (White Line).
VOLATILITY SQUEEZE CRITICAL: Market is coiling. A breakout is coming soon.
VOLUME ACCUMULATION Whales are buying (OBV is rising).
5. Configuration & Visuals
Hover over the indicator name on the chart and click the Settings (Gear) icon.
Toggle Indicators: Uncheck any indicator (like Bollinger Bands or EMA 20) to hide them if you want a cleaner view. The Dashboard will still calculate them in the background.
Dashboard Position: Move the table to any corner or turn it off entirely if it blocks your price view.
Color Themes: Adjust the RSI background colors or EMA colors to fit your chart theme (Light/Dark mode).
6. Best Practices
The "Squeeze" Play: If you get a Volatility Squeeze alert, do not enter immediately. Wait for the price to break out of the Bollinger Bands. The squeeze is the "Get Ready" signal; the breakout is the "Go" signal.
The "Trend" Filter: If the 200 EMA (White Line) is above the price (Downtrend), ignore all "MACD Buy" alerts. Trade with the macro trend, not against it.
Jake's Candle by Candle UpgradedJake's Candle by Candle Upgraded
The "Story of the Market" Automated
This is not just another signal indicator. Jake's Candle by Candle Upgraded is a complete institutional trading framework designed for high-precision scalping on the 1-minute and 5-minute timeframes.
Built strictly on the principles of Al Brooks Price Action and Smart Money Concepts (SMC), this tool automates the rigorous "Candle-by-Candle" analysis used by professional floor traders. It moves beyond simple pattern recognition to read the "Story" of the market—Context, Setup, and Pressure—before ever allowing a trade.
The Philosophy: Why This Tool Was Built
Most retail traders fail for two reasons:
Getting Trapped: They enter on the first sign of a reversal (H1/L1), which is often an institutional trap.
Trading Chop: They bleed capital during low-volume, sideways markets.
This tool solves both problems with an Algorithmic Discipline Engine. It does not guess. It waits for the specific "Second Leg" criteria used by institutions and physically disables itself during dangerous market conditions.
Key Features
1. The Context Dashboard (HUD)
A professional Heads-Up Display in the top-right corner keeps you focused on the macro picture while you scalp.
FLOW: Monitors the 20-period Institutional EMA. (Green = Bull Flow, Red = Bear Flow). You are prevented from trading against the dominant trend.
STATE: A built-in "Volatility Compressor." If it says "⚠️ CHOP / RANGE", the algorithm is disabled. It protects you from overtrading during lunch hours or low-volume zones.
SETUP: Live tracking of the Al Brooks leg count. It tells you exactly when the algorithm is "Waiting for Pullback" or "Searching for Entry."
2. Smart "Trap Avoidance" Logic (H2/L2)
This tool uses the "Gold Standard" of scalping setups: The High 2 (H2) and Low 2 (L2).
It ignores the first breakout attempt (Leg 1), acknowledging it as a potential trap.
It waits for the pullback and only signals on the Second Leg, statistically increasing the probability of a successful trend resumption.
3. Volatility-Adaptive Risk Management
Stop calculating pips in your head. The moment a signal is valid, the tool draws your business plan on the chart:
Stop Loss (Red Line): Automatically placed behind the "Signal Bar" (the candle that created the setup) based on strict price action rules.
Take Profit (Green Line): Automatically projected at a 1.5 Risk-to-Reward Ratio.
Smart Adaptation: The targets expand and contract based on real-time market volatility. If the market is quiet, targets are tighter. If explosive, targets are wider.
4. The "Snap Entry" Signal
The BUY and SELL badges are not lagging. They are programmed with "Stop Entry" logic—appearing the exact moment price breaks the structure of the Signal Bar, ensuring you enter on momentum, not hope.
How to Trade Strategy
Check the HUD: Ensure FLOW matches your direction and STATE says "✅ VOLATILE".
Wait for the Badge: Do not front-run the tool. Wait for the BUY or SELL badge to print.
Set Your Orders: Once the signal candle closes:
Place your Stop Loss at the Red Line.
Place your Take Profit at the Green Line.
Walk Away: The trade is now a probability event. Let the math play out.
Technical Specifications
Engine: Pine Script v6 (Strict Compliance).
Best Timeframes: 1m, 5m.
Best Assets: Indices (NQ, ES), Gold (XAUUSD), and high-volume Crypto (BTC, ETH).
NY Open Candle IndicatorThe NY Open Candle Indicator identifies significant opening range activity at the New York stock market open.
It highlights the 09:30–09:45 EST 15-minute candle when its range (high - low) exceeds a user-defined percentage of the daily ATR (default 25%).
- Bullish wide-range candles are colored green
- Bearish wide-range candles are colored red
A small table displays:
- Current Daily ATR
- The threshold value (user % of ATR in price terms)
An alert condition is included — create an alert for "Wide NY Open Range Detected" to get notified when a qualifying candle closes.
Perfect for traders watching opening range breakouts, volatility expansion, or momentum at the NY open.
Requirements:
- Use on 15-minute timeframe
- Set chart timezone to America/New_York
Enjoy!
Hotjaem SignalBuy and Sell signals based on MACD, RSI, and Moving Averages.
Displays Golden Cross and Dead Cross for 5 and 20 Moving Averages.
Updates in progress.
MindEdge 2-7am (utc +1)This indicator highlights the 2-7am time for me to trade the opposite direction of a m15 sweep
Price Action Assistant V2All in One Assistant for Price Action Traders
1-Calculates and Displays the Opening Gap Relative to ADR.
2-Information Table Showing Yesterday’s and Today’s Range Plus Average Bar Range.
3-Displays Micro-Gaps (Fair Value Gaps).
4-Advanced Bar Numbering With an Option to Display at Custom Intervals, Using 9 or 12 Bar Color Multiples to Visualize the Closure of 45-Minute or 60-Minute Candles on an M5 Chart.
5-Plots Previous High, Low, and Close Levels Plus the Current Session Open.
6-Displays a 3-Bar Micro Channel in the Same Direction.
7-Includes Two Different Moving Averages.
8-Displays the Daily Date and Day-of-Week Label for Easy Journaling and Chart Archiving.
byquan AlphaTrend + Supertrend ComboAlphaTrend + Supertrend Combo (Confirmation-Based Indicator)
Description
AlphaTrend + Supertrend Combo is a confirmation-based technical indicator that combines momentum-sensitive trend tracking with ATR-based trend structure.
The script is designed to highlight situations where two independent trend-following methods agree within a short time window, helping users visually identify moments of potential trend alignment.
This indicator is intended for technical analysis and educational use only.
Conceptual Idea
The core concept of this indicator is confirmation, not prediction.
Instead of relying on a single signal source, the script observes:
A volatility-adjusted trend line (AlphaTrend)
A price-structure-based trend switch (Supertrend)
A signal is displayed only when both methods confirm each other within a limited number of bars.
Indicator Components
1. AlphaTrend Module
AlphaTrend is calculated using:
ATR-based dynamic levels
Momentum evaluation via:
Money Flow Index (MFI), or
RSI when volume data is unavailable
This module adapts its direction based on market momentum and volatility, producing trend transition events rather than continuous signals.
2. Supertrend Module
The Supertrend component uses:
ATR-based bands
Price crossing logic to define trend direction changes
Supertrend acts as a structural trend confirmation layer, reacting to changes in price behavior relative to volatility.
3. Confirmation Window Logic
Rather than requiring both indicators to trigger on the exact same bar, the script introduces a bar-based confirmation window:
When one indicator produces a signal
The script waits up to a user-defined number of bars
If the second indicator confirms within this window, the signal is considered valid
This approach allows for natural timing differences between indicators while avoiding long-delayed confirmations.
Signal Logic Summary
BUY confirmation
AlphaTrend signals bullish direction
Supertrend confirms bullish direction within the waiting window
SELL confirmation
AlphaTrend signals bearish direction
Supertrend confirms bearish direction within the waiting window
Signals are displayed only when both conditions are satisfied.
Inputs Overview
Confirmation Bars
Defines how many bars the script waits for the second indicator to confirm
AlphaTrend Settings
Period, multiplier, source, and volume handling options
Supertrend Settings
ATR period, multiplier, and calculation method
All parameters are user-adjustable to support different instruments and timeframes.
Intended Use
This indicator is designed to be used as:
A confirmation or alignment tool
A visual aid for studying trend behavior
A supporting layer within a broader analysis framework
It is not intended to:
Predict market direction
Serve as a complete trading system
Replace risk management or personal judgment
Technical Notes
The script is rule-based and deterministic
No repainting logic is used
Signals depend strictly on historical and current bar data
Results may vary across symbols, sessions, and timeframes
Attribution & Transparency
This script represents a custom integration and modification of widely known technical analysis concepts, including:
AlphaTrend-style volatility-adjusted trend tracking
Supertrend ATR-based trend logic
These methods are commonly documented in technical analysis literature.
The implementation, parameter structure, and confirmation logic reflect a personal adaptation and combination, not a claim of originality over the underlying concepts.
Disclaimer
This indicator is provided for educational and analytical purposes only.
It does not constitute financial advice, investment recommendations, or an invitation to trade.
Past behavior does not guarantee future outcomes.
byquan GP maxmin+SPtrendGP MaxMin SRSI + SSPtrend
Description
GP MaxMin SRSI + SSPtrend is a composite technical indicator designed to combine momentum context analysis with trend confirmation.
The script integrates:
A multi-source, multi-timeframe Stochastic RSI context layer
A standard Supertrend-based trend switch
A time-based signal validation window to reduce isolated or out-of-context signals
This indicator is intended for market observation and educational analysis, not as a standalone trading system.
Conceptual Overview
The core idea behind this indicator is simple:
Strong trend reversals or continuations are more meaningful when they occur after the market reaches extreme momentum conditions across multiple timeframes.
Instead of triggering signals immediately at overbought or oversold levels, this script:
Detects momentum extremes first
Waits for a structural trend confirmation
Allows signals only within a limited context window
Indicator Structure
1. Multi-Source Stochastic RSI Context
The script computes Stochastic RSI values based on four price sources:
Open
High
Low
Close
From these values, the script extracts:
The minimum momentum reading (deepest oversold condition)
The maximum momentum reading (strongest overbought condition)
This approach aims to reflect momentum dispersion, rather than relying on a single price input.
2. Multi-Timeframe Aggregation
Momentum values are evaluated across multiple higher timeframes (configurable by the user).
The aggregated values are normalized into a unified 0–100 scale, producing:
A composite oversold context
A composite overbought context
These conditions define market context only, not entry signals.
3. Trend Confirmation Using Supertrend
A conventional Supertrend calculation is used to detect trend state changes:
Trend transitions define potential directional shifts
Supertrend acts as the only trigger mechanism
No signal is generated solely from momentum values.
4. Context Validation Window
Once an overbought or oversold context is detected:
A configurable bar-based window is opened
Supertrend signals occurring within this window are considered valid
Signals outside the window are ignored
This design helps avoid delayed or unrelated confirmations.
Signal Logic Summary
BUY context
Oversold momentum detected → Supertrend turns bullish within the allowed window
SELL context
Overbought momentum detected → Supertrend turns bearish within the allowed window
Only signals satisfying both context and confirmation are displayed.
Intended Use
This indicator is designed to be used as:
A confirmation or filtering tool
A context layer alongside other analysis methods
A visual aid for studying market structure and momentum behavior
It is not intended to:
Predict future price movements
Replace risk management
Provide trading advice or signals with guaranteed outcomes
Important Notes
This script does not repaint
All calculations are rule-based and deterministic
Results may vary across symbols and timeframes
Users are encouraged to evaluate the logic independently
Past behavior does not imply future performance.
Attribution & Transparency
This script is a custom integration and modification of commonly used technical concepts such as:
Stochastic RSI
Supertrend
Multi-timeframe analysis
While the underlying ideas are widely known, the combination, parameterization, and signal-filtering logic reflect a personal implementation approach.
Disclaimer
This script is provided for educational and analytical purposes only.
It does not constitute financial advice, investment recommendations, or solicitation to trade.
byquan Indicator A - EMA20 Early Retest BUY (Trend Filter)Indicator A – EMA20 Early Retest (Trend-Filtered Buy Setup)
Overview
Indicator A – EMA20 Early Retest is a trend-following tool designed to identify early pullback buy opportunities using only EMA structure, without relying on candlestick patterns.
The indicator focuses on:
EMA alignment
EMA momentum
Controlled pullbacks
Early retests before a full breakout
It is designed to generate one signal per trend leg, helping reduce noise and repeated entries.
⚠️ This indicator is intended for educational and analytical purposes only. It does not provide trading advice or guarantee any performance.
Core Concept
The logic behind Indicator A is based on a simple observation:
In a healthy uptrend, EMA20 often pulls back after a strong move, then retests near its previous peak before continuing.
Instead of waiting for a breakout or reacting late, this indicator attempts to highlight early retest zones, where momentum may resume while risk remains relatively controlled.
EMA Structure Used
The indicator uses three exponential moving averages:
EMA20 → short-term momentum
EMA50 → medium-term trend
EMA100 → higher timeframe structure
Only the EMA values themselves are used.
No candle shapes, wicks, or price patterns are involved.
Buy Conditions (High-Level)
A BUY signal is considered only when all of the following steps occur in sequence:
1. EMA20 Crosses Up
EMA20 must cross above EMA50 or EMA100, signaling the start of a potential bullish momentum phase.
This event initializes a new setup.
2. EMA20 Builds a Peak
After the cross:
EMA20 continues rising
The indicator tracks the highest EMA20 value
The peak is considered valid only after EMA20 starts declining for more than one step, helping avoid minor fluctuations
3. Deep Pullback Requirement
EMA20 must pull back by a minimum percentage of the total move from:
the cross point → to the EMA20 peak
This pullback depth is configurable (default: 25%).
Shallow pullbacks are ignored.
4. Early Retest Zone
After a valid pullback, the indicator waits for EMA20 to rise again and reach approximately 90% of the previous EMA20 peak.
This is called an early retest:
The peak does not need to be broken
Momentum resumption is detected before a full breakout
5. Trend Filter (Critical)
A BUY signal is allowed only if:
EMA50 is above EMA100
This filter ensures that signals are aligned with the broader trend structure and helps avoid counter-trend setups.
If the early retest occurs while this condition is not met, the setup is discarded permanently.
Signal Behavior
Only one BUY signal is generated per EMA20 trend cycle
After a signal (or a discarded setup), the indicator locks and waits for a new EMA20 cross
This design prevents repeated or clustered signals
Inputs Explained
Pullback Depth (%)
Defines how deep EMA20 must retrace from its peak before a retest is considered.
Early Retest Ratio
Defines how close EMA20 must return to its previous peak (default: 90%).
These parameters allow users to adapt the indicator to different timeframes or market conditions.
How to Use the Indicator
Indicator A is best used as:
A trend continuation confirmation tool
A confluence layer, combined with:
Higher timeframe analysis
Risk management rules
Personal trading plans
It is not designed to:
Predict market direction
Replace risk management
Act as a standalone trading system
Timeframes & Markets
The indicator can be applied to:
Forex
Crypto
Indices
Stocks
Performance and behavior may vary depending on:
Market volatility
Timeframe
EMA sensitivity
Users are encouraged to observe and test the indicator in their own environment.
Final Notes
This script is intentionally designed to be:
Rule-based
Conservative
Noise-resistant
All logic is deterministic and transparent.
There are no repainting elements.
Always evaluate indicators as part of a broader analytical framework.
Past behavior does not imply future results.
Bear & Bull Builder // visual strategy builderAre you a trend follower?
Trend following systems have been a cornerstone of trading since the first candlestick charts were invented in 18th-century Japan by Munehisa Homma (or Honma), a legendary rice merchant who used them to analyze market sentiment and predict price movements. Since then, legendary traders like Richard Dennis and Dr. David Paul have used technical analysis—the study of turning points and trends of candlestick charts—to develop an edge and strategy for trading equity, commodity, and forex markets.
How to Utilize the Bear & Bull Builder
This script is a way to pick and choose technical methods like SMAs and EMAs to define trend exits and entries. Additionally, you can specify an ATR (Average True Range) calculated stop loss based on your individual strategy and trading plan. Within the settings panel, you can set up this script to display only Long Position values, zones, and levels—or configure it for shorts, or both.
What Makes This Original
Unlike most trend-following indicators that lock you into a single approach, this script lets you combine different indicator types (RSI, WaveTrend, CCI, EMA, SMA) across three separate trend timeframes. The originality comes from the flexibility: you can test whether momentum-based trends (like RSI) work better than moving averages for your timeframe, or experiment with mixing them together. The script also bridges the gap between manual trading and automation by providing visual position values and fill zones that show exactly where signals generate versus where orders execute—critical information most scripts ignore.
Getting Started
For this quick and easy setup example, I built a strategy that is long-only, displays only long positional data and values, and uses a 21 & 55 period exponential moving average for the short and medium-term trend in addition to an 89 period simple moving average for my longer-term outlook. I have set my ATR-based multiplier to 0.75, and have left the fill zone display turned on to help visualize when to set up the built-in alerts for automating my strategy. I have made this the default settings of the script.
Positional Values
GREEN NUMBERS → Entry signal price
YELLOW NUMBERS → Stop loss price
BLUE NUMBERS → Exit signal price
IMPORTANT
I cannot describe how useful it is to use TradingView's built-in Long and Short position tools! The whole reason for this script is that it is as manually friendly as it is automated—especially for backtesting. You can use the long position tool to measure exact profits and losses on individual trades for the strategies you build. This can really help you see clearly if you have built a system with positive expectancy.
Tables
1. Settings Display Table
Displays the trend types that are configurable in the settings panel. Shows if positional values for longs and shorts are currently displayed.
2. Back testing Table
Displays the total amount of long and short entry signals since the first bar of the chart. Additionally, it displays the average amount of bars per trade (time in trade).
Alerts & Automation
There are 4 built-in alerts for automating your strategy to an external server:
1.Long Entries
2.Long Exits
3.Short Entries
4.Short Exits
Since this script uses confirmed bar states for alert generation (to avoid repainting), all alerts and displayed position values (the green, yellow, and blue numbers) will be sent on the closing price. Each alert has a placeholder preset for further customization.
Technical Details
How the trend detection works:
Bullish state triggers when close > all three selected trends
Bearish state triggers when close < all three selected trends
Uses barstate.isconfirmed to prevent repainting
Stop loss calculation:
Long stops: highest_trend - (ATR × multiplier)
Short stops: lowest_trend + (ATR × multiplier)
ATR period is fixed at 20 bars, multiplier is user-adjustable
Entry placement logic:
Long entries execute at the highest value among the three selected trends
Short entries execute at the lowest value among the three selected trends
This ensures entries occur near the support/resistance created by the trend lines
Why calculate all indicators upfront:
The script calculates all five indicator types (EMA, SMA, RSI, CCI, WaveTrend) for all three trend lengths on every bar, then selectively uses the ones you choose in settings. This prevents Pine Script consistency warnings while maintaining flexibility.






















