Consolidating Trend MasterA complimentary Oscillator to the Hybrid ST/EMA Trend Table Indicator to help provide confident Confluence signals and when the market is consolidating/choppy/moving sideways.
This Oscillator may also help someone with scalping.
warning as always, no chart is 100% accurate.
Indicadores y estrategias
BUZARA// © Buzzara
// =================================
// PLEASE SUPPORT THE TEAM
// =================================
//
// Telegram: t.me
// =================================
//@version=5
VERSION = ' Buzzara2.0'
strategy('ALGOX V6_1_24', shorttitle = '🚀〄 Buzzara2.0 〄🚀'+ VERSION, overlay = true, explicit_plot_zorder = true, pyramiding = 0, default_qty_type = strategy.percent_of_equity, initial_capital = 1000, default_qty_value = 1, calc_on_every_tick = false, process_orders_on_close = true)
G_SCRIPT01 = '■ ' + 'SAIYAN OCC'
//#region ———— <↓↓↓ G_SCRIPT01 ↓↓↓> {
// === INPUTS ===
res = input.timeframe('15', 'TIMEFRAME', group ="NON REPAINT")
useRes = input(true, 'Use Alternate Signals')
intRes = input(10, 'Multiplier for Alernate Signals')
basisType = input.string('ALMA', 'MA Type: ', options= )
basisLen = input.int(50, 'MA Period', minval=1)
offsetSigma = input.int(5, 'Offset for LSMA / Sigma for ALMA', minval=0)
offsetALMA = input.float(2, 'Offset for ALMA', minval=0, step=0.01)
scolor = input(false, 'Show coloured Bars to indicate Trend?')
delayOffset = input.int(0, 'Delay Open/Close MA', minval=0, step=1,
tooltip = 'Forces Non-Repainting')
tradeType = input.string('BOTH', 'What trades should be taken : ',
options = )
//=== /INPUTS ===
h = input(false, 'Signals for Heikin Ashi Candles')
//INDICATOR SETTINGS
swing_length = input.int(10, 'Swing High/Low Length', group = 'Settings', minval = 1, maxval = 50)
history_of_demand_to_keep = input.int(20, 'History To Keep', minval = 5, maxval = 50)
box_width = input.float(2.5, 'Supply/Demand Box Width', group = 'Settings', minval = 1, maxval = 10, step = 0.5)
//INDICATOR VISUAL SETTINGS
show_zigzag = input.bool(false, 'Show Zig Zag', group = 'Visual Settings', inline = '1')
show_price_action_labels = input.bool(false, 'Show Price Action Labels', group = 'Visual Settings', inline = '2')
supply_color = input.color(#00000000, 'Supply', group = 'Visual Settings', inline = '3')
supply_outline_color = input.color(#00000000, 'Outline', group = 'Visual Settings', inline = '3')
demand_color = input.color(#00000000, 'Demand', group = 'Visual Settings', inline = '4')
demand_outline_color = input.color(#00000000, 'Outline', group = 'Visual Settings', inline = '4')
bos_label_color = input.color(#00000000, 'BOS Label', group = 'Visual Settings', inline = '5')
poi_label_color = input.color(#00000000, 'POI Label', group = 'Visual Settings', inline = '7')
poi_border_color = input.color(#00000000, 'POI border', group = 'Visual Settings', inline = '7')
swing_type_color = input.color(#00000000, 'Price Action Label', group = 'Visual Settings', inline = '8')
zigzag_color = input.color(#00000000, 'Zig Zag', group = 'Visual Settings', inline = '9')
//END SETTINGS
// FUNCTION TO ADD NEW AND REMOVE LAST IN ARRAY
f_array_add_pop(array, new_value_to_add) =>
array.unshift(array, new_value_to_add)
array.pop(array)
// FUNCTION SWING H & L LABELS
f_sh_sl_labels(array, swing_type) =>
var string label_text = na
if swing_type == 1
if array.get(array, 0) >= array.get(array, 1)
label_text := 'HH'
else
label_text := 'LH'
label.new(
bar_index - swing_length,
array.get(array,0),
text = label_text,
style = label.style_label_down,
textcolor = swing_type_color,
color = swing_type_color,
size = size.tiny)
else if swing_type == -1
if array.get(array, 0) >= array.get(array, 1)
label_text := 'HL'
else
label_text := 'LL'
label.new(
bar_index - swing_length,
array.get(array,0),
text = label_text,
style = label.style_label_up,
textcolor = swing_type_color,
color = swing_type_color,
size = size.tiny)
// FUNCTION MAKE SURE SUPPLY ISNT OVERLAPPING
f_check_overlapping(new_poi, box_array, atrValue) =>
atr_threshold = atrValue * 2
okay_to_draw = true
for i = 0 to array.size(box_array) - 1
top = box.get_top(array.get(box_array, i))
bottom = box.get_bottom(array.get(box_array, i))
poi = (top + bottom) / 2
upper_boundary = poi + atr_threshold
lower_boundary = poi - atr_threshold
if new_poi >= lower_boundary and new_poi <= upper_boundary
okay_to_draw := false
break
else
okay_to_draw := true
okay_to_draw
// FUNCTION TO DRAW SUPPLY OR DEMAND ZONE
f_supply_demand(value_array, bn_array, box_array, label_array, box_type, atrValue) =>
atr_buffer = atrValue * (box_width / 10)
box_left = array.get(bn_array, 0)
box_right = bar_index
var float box_top = 0.00
var float box_bottom = 0.00
var float poi = 0.00
if box_type == 1
box_top := array.get(value_array, 0)
box_bottom := box_top - atr_buffer
poi := (box_top + box_bottom) / 2
else if box_type == -1
box_bottom := array.get(value_array, 0)
box_top := box_bottom + atr_buffer
poi := (box_top + box_bottom) / 2
okay_to_draw = f_check_overlapping(poi, box_array, atrValue)
// okay_to_draw = true
//delete oldest box, and then create a new box and add it to the array
if box_type == 1 and okay_to_draw
box.delete( array.get(box_array, array.size(box_array) - 1) )
f_array_add_pop(box_array, box.new( left = box_left, top = box_top, right = box_right, bottom = box_bottom, border_color = supply_outline_color,
bgcolor = supply_color, extend = extend.right, text = 'SUPPLY', text_halign = text.align_center, text_valign = text.align_center, text_color = poi_label_color, text_size = size.small, xloc = xloc.bar_index))
box.delete( array.get(label_array, array.size(label_array) - 1) )
f_array_add_pop(label_array, box.new( left = box_left, top = poi, right = box_right, bottom = poi, border_color = poi_border_color,
bgcolor = poi_border_color, extend = extend.right, text = 'POI', text_halign = text.align_left, text_valign = text.align_center, text_color = poi_label_color, text_size = size.small, xloc = xloc.bar_index))
else if box_type == -1 and okay_to_draw
box.delete( array.get(box_array, array.size(box_array) - 1) )
f_array_add_pop(box_array, box.new( left = box_left, top = box_top, right = box_right, bottom = box_bottom, border_color = demand_outline_color,
bgcolor = demand_color, extend = extend.right, text = 'DEMAND', text_halign = text.align_center, text_valign = text.align_center, text_color = poi_label_color, text_size = size.small, xloc = xloc.bar_index))
box.delete( array.get(label_array, array.size(label_array) - 1) )
f_array_add_pop(label_array, box.new( left = box_left, top = poi, right = box_right, bottom = poi, border_color = poi_border_color,
bgcolor = poi_border_color, extend = extend.right, text = 'POI', text_halign = text.align_left, text_valign = text.align_center, text_color = poi_label_color, text_size = size.small, xloc = xloc.bar_index))
// FUNCTION TO CHANGE SUPPLY/DEMAND TO A BOS IF BROKEN
f_sd_to_bos(box_array, bos_array, label_array, zone_type) =>
if zone_type == 1
for i = 0 to array.size(box_array) - 1
level_to_break = box.get_top(array.get(box_array,i))
// if ta.crossover(close, level_to_break)
if close >= level_to_break
copied_box = box.copy(array.get(box_array,i))
f_array_add_pop(bos_array, copied_box)
mid = (box.get_top(array.get(box_array,i)) + box.get_bottom(array.get(box_array,i))) / 2
box.set_top(array.get(bos_array,0), mid)
box.set_bottom(array.get(bos_array,0), mid)
box.set_extend( array.get(bos_array,0), extend.none)
box.set_right( array.get(bos_array,0), bar_index)
box.set_text( array.get(bos_array,0), 'BOS' )
box.set_text_color( array.get(bos_array,0), bos_label_color)
box.set_text_size( array.get(bos_array,0), size.small)
box.set_text_halign( array.get(bos_array,0), text.align_center)
box.set_text_valign( array.get(bos_array,0), text.align_center)
box.delete(array.get(box_array, i))
box.delete(array.get(label_array, i))
if zone_type == -1
for i = 0 to array.size(box_array) - 1
level_to_break = box.get_bottom(array.get(box_array,i))
// if ta.crossunder(close, level_to_break)
if close <= level_to_break
copied_box = box.copy(array.get(box_array,i))
f_array_add_pop(bos_array, copied_box)
mid = (box.get_top(array.get(box_array,i)) + box.get_bottom(array.get(box_array,i))) / 2
box.set_top(array.get(bos_array,0), mid)
box.set_bottom(array.get(bos_array,0), mid)
box.set_extend( array.get(bos_array,0), extend.none)
box.set_right( array.get(bos_array,0), bar_index)
box.set_text( array.get(bos_array,0), 'BOS' )
box.set_text_color( array.get(bos_array,0), bos_label_color)
box.set_text_size( array.get(bos_array,0), size.small)
box.set_text_halign( array.get(bos_array,0), text.align_center)
box.set_text_valign( array.get(bos_array,0), text.align_center)
box.delete(array.get(box_array, i))
box.delete(array.get(label_array, i))
// FUNCTION MANAGE CURRENT BOXES BY CHANGING ENDPOINT
f_extend_box_endpoint(box_array) =>
for i = 0 to array.size(box_array) - 1
box.set_right(array.get(box_array, i), bar_index + 100)
//
stratRes = timeframe.ismonthly ? str.tostring(timeframe.multiplier * intRes, '###M') :
timeframe.isweekly ? str.tostring(timeframe.multiplier * intRes, '###W') :
timeframe.isdaily ? str.tostring(timeframe.multiplier * intRes, '###D') :
timeframe.isintraday ? str.tostring(timeframe.multiplier * intRes, '####') :
'60'
src = h ? request.security(ticker.heikinashi(syminfo.tickerid),
timeframe.period, close, lookahead = barmerge.lookahead_off) : close
// CALCULATE ATR
atrValue = ta.atr(50)
// CALCULATE SWING HIGHS & SWING LOWS
swing_high = ta.pivothigh(high, swing_length, swing_length)
swing_low = ta.pivotlow(low, swing_length, swing_length)
// ARRAYS FOR SWING H/L & BN
var swing_high_values = array.new_float(5,0.00)
var swing_low_values = array.new_float(5,0.00)
var swing_high_bns = array.new_int(5,0)
var swing_low_bns = array.new_int(5,0)
// ARRAYS FOR SUPPLY / DEMAND
var current_supply_box = array.new_box(history_of_demand_to_keep, na)
var current_demand_box = array.new_box(history_of_demand_to_keep, na)
// ARRAYS FOR SUPPLY / DEMAND POI LABELS
var current_supply_poi = array.new_box(history_of_demand_to_keep, na)
var current_demand_poi = array.new_box(history_of_demand_to_keep, na)
// ARRAYS FOR BOS
var supply_bos = array.new_box(5, na)
var demand_bos = array.new_box(5, na)
//END CALCULATIONS
// NEW SWING HIGH
if not na(swing_high)
//MANAGE SWING HIGH VALUES
f_array_add_pop(swing_high_values, swing_high)
f_array_add_pop(swing_high_bns, bar_index )
if show_price_action_labels
f_sh_sl_labels(swing_high_values, 1)
f_supply_demand(swing_high_values, swing_high_bns, current_supply_box, current_supply_poi, 1, atrValue)
// NEW SWING LOW
else if not na(swing_low)
//MANAGE SWING LOW VALUES
f_array_add_pop(swing_low_values, swing_low)
f_array_add_pop(swing_low_bns, bar_index )
if show_price_action_labels
f_sh_sl_labels(swing_low_values, -1)
f_supply_demand(swing_low_values, swing_low_bns, current_demand_box, current_demand_poi, -1, atrValue)
f_sd_to_bos(current_supply_box, supply_bos, current_supply_poi, 1)
f_sd_to_bos(current_demand_box, demand_bos, current_demand_poi, -1)
f_extend_box_endpoint(current_supply_box)
f_extend_box_endpoint(current_demand_box)
channelBal = input.bool(false, "Channel Balance", group = "CHART")
lr_slope(_src, _len) =>
x = 0.0, y = 0.0, x2 = 0.0, xy = 0.0
for i = 0 to _len - 1
val = _src
per = i + 1
x += per
y += val
x2 += per * per
xy += val * per
_slp = (_len * xy - x * y) / (_len * x2 - x * x)
_avg = y / _len
_int = _avg - _slp * x / _len + _slp
lr_dev(_src, _len, _slp, _avg, _int) =>
upDev = 0.0, dnDev = 0.0
val = _int
for j = 0 to _len - 1
price = high - val
if price > upDev
upDev := price
price := val - low
if price > dnDev
dnDev := price
price := _src
val += _slp
//
= ta.kc(close, 80, 10.5)
= ta.kc(close, 80, 9.5)
= ta.kc(close, 80, 8)
= ta.kc(close, 80, 3)
barsL = 10
barsR = 10
pivotHigh = fixnan(ta.pivothigh(barsL, barsR) )
pivotLow = fixnan(ta.pivotlow(barsL, barsR) )
source = close, period = 150
= lr_slope(source, period)
= lr_dev(source, period, s, a, i)
y1 = low - (ta.atr(30) * 2), y1B = low - ta.atr(30)
y2 = high + (ta.atr(30) * 2), y2B = high + ta.atr(30)
x1 = bar_index - period + 1, _y1 = i + s * (period - 1), x2 = bar_index, _y2 = i
//Functions
//Line Style function
get_line_style(style) =>
out = switch style
'???' => line.style_solid
'----' => line.style_dashed
' ' => line.style_dotted
//Function to get order block coordinates
get_coordinates(condition, top, btm, ob_val)=>
var ob_top = array.new_float(0)
var ob_btm = array.new_float(0)
var ob_avg = array.new_float(0)
var ob_left = array.new_int(0)
float ob = na
//Append coordinates to arrays
if condition
avg = math.avg(top, btm)
array.unshift(ob_top, top)
array.unshift(ob_btm, btm)
array.unshift(ob_avg, avg)
ob := ob_val
//Function to remove mitigated order blocks from coordinate arrays
remove_mitigated(ob_top, ob_btm, ob_left, ob_avg, target, bull)=>
mitigated = false
target_array = bull ? ob_btm : ob_top
for element in target_array
idx = array.indexof(target_array, element)
if (bull ? target < element : target > element)
mitigated := true
array.remove(ob_top, idx)
array.remove(ob_btm, idx)
array.remove(ob_avg, idx)
array.remove(ob_left, idx)
mitigated
//Function to set order blocks
set_order_blocks(ob_top, ob_btm, ob_left, ob_avg, ext_last, bg_css, border_css, lvl_css)=>
var ob_box = array.new_box(0)
var ob_lvl = array.new_line(0)
//Global elements
var os = 0
var target_bull = 0.
var target_bear = 0.
// Create non-repainting security function
rp_security(_symbol, _res, _src) =>
request.security(_symbol, _res, _src )
htfHigh = rp_security(syminfo.tickerid, res, high)
htfLow = rp_security(syminfo.tickerid, res, low)
// Main Indicator
// Functions
smoothrng(x, t, m) =>
wper = t * 2 - 1
avrng = ta.ema(math.abs(x - x ), t)
smoothrng = ta.ema(avrng, wper) * m
rngfilt(x, r) =>
rngfilt = x
rngfilt := x > nz(rngfilt ) ? x - r < nz(rngfilt ) ? nz(rngfilt ) : x - r : x + r > nz(rngfilt ) ? nz(rngfilt ) : x + r
percWidth(len, perc) => (ta.highest(len) - ta.lowest(len)) * perc / 100
securityNoRep(sym, res, src) => request.security(sym, res, src, barmerge.gaps_off, barmerge.lookahead_on)
swingPoints(prd) =>
pivHi = ta.pivothigh(prd, prd)
pivLo = ta.pivotlow (prd, prd)
last_pivHi = ta.valuewhen(pivHi, pivHi, 1)
last_pivLo = ta.valuewhen(pivLo, pivLo, 1)
hh = pivHi and pivHi > last_pivHi ? pivHi : na
lh = pivHi and pivHi < last_pivHi ? pivHi : na
hl = pivLo and pivLo > last_pivLo ? pivLo : na
ll = pivLo and pivLo < last_pivLo ? pivLo : na
f_chartTfInMinutes() =>
float _resInMinutes = timeframe.multiplier * (
timeframe.isseconds ? 1 :
timeframe.isminutes ? 1. :
timeframe.isdaily ? 60. * 24 :
timeframe.isweekly ? 60. * 24 * 7 :
timeframe.ismonthly ? 60. * 24 * 30.4375 : na)
f_kc(src, len, sensitivity) =>
basis = ta.sma(src, len)
span = ta.atr(len)
wavetrend(src, chlLen, avgLen) =>
esa = ta.ema(src, chlLen)
d = ta.ema(math.abs(src - esa), chlLen)
ci = (src - esa) / (0.015 * d)
wt1 = ta.ema(ci, avgLen)
wt2 = ta.sma(wt1, 3)
f_top_fractal(_src) => _src < _src and _src < _src and _src > _src and _src > _src
f_bot_fractal(_src) => _src > _src and _src > _src and _src < _src and _src < _src
top_fractal = f_top_fractal(src)
bot_fractal = f_bot_fractal(src)
f_fractalize (_src) => top_fractal ? 1 : bot_fractal ? -1 : 0
f_findDivs(src, topLimit, botLimit) =>
fractalTop = f_fractalize(src) > 0 and src >= topLimit ? src : na
fractalBot = f_fractalize(src) < 0 and src <= botLimit ? src : na
highPrev = ta.valuewhen(fractalTop, src , 0)
highPrice = ta.valuewhen(fractalTop, high , 0)
lowPrev = ta.valuewhen(fractalBot, src , 0)
lowPrice = ta.valuewhen(fractalBot, low , 0)
bearSignal = fractalTop and high > highPrice and src < highPrev
bullSignal = fractalBot and low < lowPrice and src > lowPrev
// Get user input
enableSR = input(false , "SR On/Off", group="SR")
colorSup = input(#00000000 , "Support Color", group="SR")
colorRes = input(#00000000 , "Resistance Color", group="SR")
strengthSR = input.int(2 , "S/R Strength", 1, group="SR")
lineStyle = input.string("Dotted", "Line Style", , group="SR")
lineWidth = input.int(2 , "S/R Line Width", 1, group="SR")
useZones = input(true , "Zones On/Off", group="SR")
useHLZones = input(true , "High Low Zones On/Off", group="SR")
zoneWidth = input.int(2 , "Zone Width %", 0,
tooltip = "it's calculated using % of the distance between highest/lowest in last 300 bars", group="SR")
expandSR = input(true , "Expand SR")
// Get components
rb = 10
prd = 284
ChannelW = 10
label_loc = 55
style = lineStyle == "Solid" ? line.style_solid :
lineStyle == "Dotted" ? line.style_dotted : line.style_dashed
ph = ta.pivothigh(rb, rb)
pl = ta.pivotlow (rb, rb)
sr_levels = array.new_float(21, na)
prdhighest = ta.highest(prd)
prdlowest = ta.lowest(prd)
cwidth = percWidth(prd, ChannelW)
zonePerc = percWidth(300, zoneWidth)
aas = array.new_bool(41, true)
u1 = 0.0, u1 := nz(u1 )
d1 = 0.0, d1 := nz(d1 )
highestph = 0.0, highestph := highestph
lowestpl = 0.0, lowestpl := lowestpl
var sr_levs = array.new_float(21, na)
label hlabel = na, label.delete(hlabel )
label llabel = na, label.delete(llabel )
var sr_lines = array.new_line(21, na)
var sr_linesH = array.new_line(21, na)
var sr_linesL = array.new_line(21, na)
var sr_linesF = array.new_linefill(21, na)
var sr_labels = array.new_label(21, na)
if (not na(ph) or not na(pl))
for x = 0 to array.size(sr_levels) - 1
array.set(sr_levels, x, na)
highestph := prdlowest
lowestpl := prdhighest
countpp = 0
for x = 0 to prd
if na(close )
break
if not na(ph ) or not na(pl )
highestph := math.max(highestph, nz(ph , prdlowest), nz(pl , prdlowest))
lowestpl := math.min(lowestpl, nz(ph , prdhighest), nz(pl , prdhighest))
countpp += 1
if countpp > 40
break
if array.get(aas, countpp)
upl = (not na(ph ) and (ph != 0) ? high : low ) + cwidth
dnl = (not na(ph ) and (ph != 0) ? high : low ) - cwidth
u1 := countpp == 1 ? upl : u1
d1 := countpp == 1 ? dnl : d1
tmp = array.new_bool(41, true)
cnt = 0
tpoint = 0
for xx = 0 to prd
if na(close )
break
if not na(ph ) or not na(pl )
chg = false
cnt += 1
if cnt > 40
break
if array.get(aas, cnt)
if not na(ph )
if high <= upl and high >= dnl
tpoint += 1
chg := true
if not na(pl )
if low <= upl and low >= dnl
tpoint += 1
chg := true
if chg and cnt < 41
array.set(tmp, cnt, false)
if tpoint >= strengthSR
for g = 0 to 40 by 1
if not array.get(tmp, g)
array.set(aas, g, false)
if (not na(ph ) and countpp < 21)
array.set(sr_levels, countpp, high )
if (not na(pl ) and countpp < 21)
array.set(sr_levels, countpp, low )
// Plot
var line highest_ = na, line.delete(highest_)
var line lowest_ = na, line.delete(lowest_)
var line highest_fill1 = na, line.delete(highest_fill1)
var line highest_fill2 = na, line.delete(highest_fill2)
var line lowest_fill1 = na, line.delete(lowest_fill1)
var line lowest_fill2 = na, line.delete(lowest_fill2)
hi_col = close >= highestph ? colorSup : colorRes
lo_col = close >= lowestpl ? colorSup : colorRes
if enableSR
highest_ := line.new(bar_index - 311, highestph, bar_index, highestph, xloc.bar_index, expandSR ? extend.both : extend.right, hi_col, style, lineWidth)
lowest_ := line.new(bar_index - 311, lowestpl , bar_index, lowestpl , xloc.bar_index, expandSR ? extend.both : extend.right, lo_col, style, lineWidth)
if useHLZones
highest_fill1 := line.new(bar_index - 311, highestph + zonePerc, bar_index, highestph + zonePerc, xloc.bar_index, expandSR ? extend.both : extend.right, na)
highest_fill2 := line.new(bar_index - 311, highestph - zonePerc, bar_index, highestph - zonePerc, xloc.bar_index, expandSR ? extend.both : extend.right, na)
lowest_fill1 := line.new(bar_index - 311, lowestpl + zonePerc , bar_index, lowestpl + zonePerc , xloc.bar_index, expandSR ? extend.both : extend.right, na)
lowest_fill2 := line.new(bar_index - 311, lowestpl - zonePerc , bar_index, lowestpl - zonePerc , xloc.bar_index, expandSR ? extend.both : extend.right, na)
linefill.new(highest_fill1, highest_fill2, hi_col)
linefill.new(lowest_fill1 , lowest_fill2 , lo_col)
if (not na(ph) or not na(pl))
for x = 0 to array.size(sr_lines) - 1
array.set(sr_levs, x, array.get(sr_levels, x))
for x = 0 to array.size(sr_lines) - 1
line.delete(array.get(sr_lines, x))
line.delete(array.get(sr_linesH, x))
line.delete(array.get(sr_linesL, x))
linefill.delete(array.get(sr_linesF, x))
if (not na(array.get(sr_levs, x)) and enableSR)
line_col = close >= array.get(sr_levs, x) ? colorSup : colorRes
array.set(sr_lines, x, line.new(bar_index - 355, array.get(sr_levs, x), bar_index, array.get(sr_levs, x), xloc.bar_index, expandSR ? extend.both : extend.right, line_col, style, lineWidth))
if useZones
array.set(sr_linesH, x, line.new(bar_index - 355, array.get(sr_levs, x) + zonePerc, bar_index, array.get(sr_levs, x) + zonePerc, xloc.bar_index, expandSR ? extend.both : extend.right, na))
array.set(sr_linesL, x, line.new(bar_index - 355, array.get(sr_levs, x) - zonePerc, bar_index, array.get(sr_levs, x) - zonePerc, xloc.bar_index, expandSR ? extend.both : extend.right, na))
array.set(sr_linesF, x, linefill.new(array.get(sr_linesH, x), array.get(sr_linesL, x), line_col))
for x = 0 to array.size(sr_labels) - 1
label.delete(array.get(sr_labels, x))
if (not na(array.get(sr_levs, x)) and enableSR)
lab_loc = close >= array.get(sr_levs, x) ? label.style_label_up : label.style_label_down
lab_col = close >= array.get(sr_levs, x) ? colorSup : colorRes
array.set(sr_labels, x, label.new(bar_index + label_loc, array.get(sr_levs, x), str.tostring(math.round_to_mintick(array.get(sr_levs, x))), color=lab_col , textcolor=#000000, style=lab_loc))
hlabel := enableSR ? label.new(bar_index + label_loc + math.round(math.sign(label_loc)) * 20, highestph, "High Level : " + str.tostring(highestph), color=hi_col, textcolor=#000000, style=label.style_label_down) : na
llabel := enableSR ? label.new(bar_index + label_loc + math.round(math.sign(label_loc)) * 20, lowestpl , "Low Level : " + str.tostring(lowestpl) , color=lo_col, textcolor=#000000, style=label.style_label_up ) : na
// Get components
rsi = ta.rsi(close, 28)
//rsiOb = rsi > 78 and rsi > ta.ema(rsi, 10)
//rsiOs = rsi < 27 and rsi < ta.ema(rsi, 10)
rsiOb = rsi > 65 and rsi > ta.ema(rsi, 10)
rsiOs = rsi < 35 and rsi < ta.ema(rsi, 10)
dHigh = securityNoRep(syminfo.tickerid, "D", high )
dLow = securityNoRep(syminfo.tickerid, "D", low )
dClose = securityNoRep(syminfo.tickerid, "D", close )
ema = ta.ema(close, 144)
emaBull = close > ema
equal_tf(res) => str.tonumber(res) == f_chartTfInMinutes() and not timeframe.isseconds
higher_tf(res) => str.tonumber(res) > f_chartTfInMinutes() or timeframe.isseconds
too_small_tf(res) => (timeframe.isweekly and res=="1") or (timeframe.ismonthly and str.tonumber(res) < 10)
securityNoRep1(sym, res, src) =>
bool bull_ = na
bull_ := equal_tf(res) ? src : bull_
bull_ := higher_tf(res) ? request.security(sym, res, src, barmerge.gaps_off, barmerge.lookahead_on) : bull_
bull_array = request.security_lower_tf(syminfo.tickerid, higher_tf(res) ? str.tostring(f_chartTfInMinutes()) + (timeframe.isseconds ? "S" : "") : too_small_tf(res) ? (timeframe.isweekly ? "3" : "10") : res, src)
if array.size(bull_array) > 1 and not equal_tf(res) and not higher_tf(res)
bull_ := array.pop(bull_array)
array.clear(bull_array)
bull_
// === BASE FUNCTIONS ===
// Returns MA input selection variant, default to SMA if blank or typo.
variant(type, src, len, offSig, offALMA) =>
v1 = ta.sma(src, len) // Simple
v2 = ta.ema(src, len) // Exponential
v3 = 2 * v2 - ta.ema(v2, len) // Double Exponential
v4 = 3 * (v2 - ta.ema(v2, len)) + ta.ema(ta.ema(v2, len), len) // Triple Exponential
v5 = ta.wma(src, len) // Weighted
v6 = ta.vwma(src, len) // Volume Weighted
v7 = 0.0
sma_1 = ta.sma(src, len) // Smoothed
v7 := na(v7 ) ? sma_1 : (v7 * (len - 1) + src) / len
v8 = ta.wma(2 * ta.wma(src, len / 2) - ta.wma(src, len), math.round(math.sqrt(len))) // Hull
v9 = ta.linreg(src, len, offSig) // Least Squares
v10 = ta.alma(src, len, offALMA, offSig) // Arnaud Legoux
v11 = ta.sma(v1, len) // Triangular (extreme smooth)
// SuperSmoother filter
// 2013 John F. Ehlers
a1 = math.exp(-1.414 * 3.14159 / len)
b1 = 2 * a1 * math.cos(1.414 * 3.14159 / len)
c2 = b1
c3 = -a1 * a1
c1 = 1 - c2 - c3
v12 = 0.0
v12 := c1 * (src + nz(src )) / 2 + c2 * nz(v12 ) + c3 * nz(v12 )
type == 'EMA' ? v2 : type == 'DEMA' ? v3 : type == 'TEMA' ? v4 : type == 'WMA' ? v5 : type == 'VWMA' ? v6 : type == 'SMMA' ? v7 : type == 'HullMA' ? v8 : type == 'LSMA' ? v9 : type == 'ALMA' ? v10 : type == 'TMA' ? v11 : type == 'SSMA' ? v12 : v1
// security wrapper for repeat calls
reso(exp, use, res) =>
security_1 = request.security(syminfo.tickerid, res, exp, gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on)
use ? security_1 : exp
// === /BASE FUNCTIONS ===
// === SERIES SETUP ===
closeSeries = variant(basisType, close , basisLen, offsetSigma, offsetALMA)
openSeries = variant(basisType, open , basisLen, offsetSigma, offsetALMA)
// === /SERIES ===
// Get Alternate resolution Series if selected.
closeSeriesAlt = reso(closeSeries, useRes, stratRes)
openSeriesAlt = reso(openSeries, useRes, stratRes)
//
lxTrigger = false
sxTrigger = false
leTrigger = ta.crossover (closeSeriesAlt, openSeriesAlt)
seTrigger = ta.crossunder(closeSeriesAlt, openSeriesAlt)
G_RISK = '■ ' + 'Risk Management'
//#region ———— <↓↓↓ G_RISK ↓↓↓> {
// ———————————
//Tooltip
T_LVL = '(%) Exit Level'
T_QTY = '(%) Adjust trade exit volume'
T_MSG = 'Paste JSON message for your bot'
//Webhook Message
O_LEMSG = 'Long Entry'
O_LXMSGSL = 'Long SL'
O_LXMSGTP1 = 'Long TP1'
O_LXMSGTP2 = 'Long TP2'
O_LXMSGTP3 = 'Long TP3'
O_LXMSG = 'Long Exit'
O_SEMSG = 'Short Entry'
O_SXMSGSL = 'Short SL'
O_SXMSGA = 'Short TP1'
O_SXMSGB = 'Short TP2'
O_SXMSGC = 'Short TP3'
O_SXMSGX = 'Short Exit'
// ——————————— | | | Line length guide |
i_lxLvlTP1 = input.float (0.2, 'Level TP1' , group = G_RISK,
tooltip = T_LVL)
i_lxQtyTP1 = input.float (80.0, 'Qty TP1' , group = G_RISK,
tooltip = T_QTY)
i_lxLvlTP2 = input.float (0.5, 'Level TP2' , group = G_RISK,
tooltip = T_LVL)
i_lxQtyTP2 = input.float (10.0, 'Qty TP2' , group = G_RISK,
tooltip = T_QTY)
i_lxLvlTP3 = input.float (7.0, 'Level TP3' , group = G_RISK,
tooltip = T_LVL)
i_lxQtyTP3 = input.float (2, 'Qty TP3' , group = G_RISK,
tooltip = T_QTY)
i_lxLvlSL = input.float (0.5, 'Stop Loss' , group = G_RISK,
tooltip = T_LVL)
i_sxLvlTP1 = i_lxLvlTP1
i_sxQtyTP1 = i_lxQtyTP1
i_sxLvlTP2 = i_lxLvlTP2
i_sxQtyTP2 = i_lxQtyTP2
i_sxLvlTP3 = i_lxLvlTP3
i_sxQtyTP3 = i_lxQtyTP3
i_sxLvlSL = i_lxLvlSL
G_MSG = '■ ' + 'Webhook Message'
i_leMsg = input.string (O_LEMSG ,'Long Entry' , group = G_MSG, tooltip = T_MSG)
i_lxMsgSL = input.string (O_LXMSGSL ,'Long SL' , group = G_MSG, tooltip = T_MSG)
i_lxMsgTP1 = input.string (O_LXMSGTP1,'Long TP1' , group = G_MSG, tooltip = T_MSG)
i_lxMsgTP2 = input.string (O_LXMSGTP2,'Long TP2' , group = G_MSG, tooltip = T_MSG)
i_lxMsgTP3 = input.string (O_LXMSGTP3,'Long TP3' , group = G_MSG, tooltip = T_MSG)
i_lxMsg = input.string (O_LXMSG ,'Long Exit' , group = G_MSG, tooltip = T_MSG)
i_seMsg = input.string (O_SEMSG ,'Short Entry' , group = G_MSG, tooltip = T_MSG)
i_sxMsgSL = input.string (O_SXMSGSL ,'Short SL' , group = G_MSG, tooltip = T_MSG)
i_sxMsgTP1 = input.string (O_SXMSGA ,'Short TP1' , group = G_MSG, tooltip = T_MSG)
i_sxMsgTP2 = input.string (O_SXMSGB ,'Short TP2' , group = G_MSG, tooltip = T_MSG)
i_sxMsgTP3 = input.string (O_SXMSGC ,'Short TP3' , group = G_MSG, tooltip = T_MSG)
i_sxMsg = input.string (O_SXMSGX ,'Short Exit' , group = G_MSG, tooltip = T_MSG)
i_src = close
G_DISPLAY = 'Display'
//
i_alertOn = input.bool (true, 'Alert Labels On/Off' , group = G_DISPLAY)
i_barColOn = input.bool (true, 'Bar Color On/Off' , group = G_DISPLAY)
// ———————————
// @function Calculate the Take Profit line, and the crossover or crossunder
f_tp(_condition, _conditionValue, _leTrigger, _seTrigger, _src, _lxLvlTP, _sxLvlTP)=>
var float _tpLine = 0.0
_topLvl = _src + (_src * (_lxLvlTP / 100))
_botLvl = _src - (_src * (_sxLvlTP / 100))
_tpLine := _condition != _conditionValue and _leTrigger ? _topLvl :
_condition != -_conditionValue and _seTrigger ? _botLvl :
nz(_tpLine )
// @function Similar to "ta.crossover" or "ta.crossunder"
f_cross(_scr1, _scr2, _over)=>
_cross = _over ? _scr1 > _scr2 and _scr1 < _scr2 :
_scr1 < _scr2 and _scr1 > _scr2
// ———————————
//
var float condition = 0.0
var float slLine = 0.0
var float entryLine = 0.0
//
entryLine := leTrigger and condition <= 0.0 ? close :
seTrigger and condition >= 0.0 ? close : nz(entryLine )
//
slTopLvl = i_src + (i_src * (i_lxLvlSL / 100))
slBotLvl = i_src - (i_src * (i_sxLvlSL / 100))
slLine := condition <= 0.0 and leTrigger ? slBotLvl :
condition >= 0.0 and seTrigger ? slTopLvl : nz(slLine )
slLong = f_cross(low, slLine, false)
slShort = f_cross(high, slLine, true )
//
= f_tp(condition, 1.2,leTrigger, seTrigger, i_src, i_lxLvlTP3, i_sxLvlTP3)
= f_tp(condition, 1.1,leTrigger, seTrigger, i_src, i_lxLvlTP2, i_sxLvlTP2)
= f_tp(condition, 1.0,leTrigger, seTrigger, i_src, i_lxLvlTP1, i_sxLvlTP1)
tp3Long = f_cross(high, tp3Line, true )
tp3Short = f_cross(low, tp3Line, false)
tp2Long = f_cross(high, tp2Line, true )
tp2Short = f_cross(low, tp2Line, false)
tp1Long = f_cross(high, tp1Line, true )
tp1Short = f_cross(low, tp1Line, false)
switch
leTrigger and condition <= 0.0 => condition := 1.0
seTrigger and condition >= 0.0 => condition := -1.0
tp3Long and condition == 1.2 => condition := 1.3
tp3Short and condition == -1.2 => condition := -1.3
tp2Long and condition == 1.1 => condition := 1.2
tp2Short and condition == -1.1 => condition := -1.2
tp1Long and condition == 1.0 => condition := 1.1
tp1Short and condition == -1.0 => condition := -1.1
slLong and condition >= 1.0 => condition := 0.0
slShort and condition <= -1.0 => condition := 0.0
lxTrigger and condition >= 1.0 => condition := 0.0
sxTrigger and condition <= -1.0 => condition := 0.0
longE = leTrigger and condition <= 0.0 and condition == 1.0
shortE = seTrigger and condition >= 0.0 and condition == -1.0
longX = lxTrigger and condition >= 1.0 and condition == 0.0
shortX = sxTrigger and condition <= -1.0 and condition == 0.0
longSL = slLong and condition >= 1.0 and condition == 0.0
shortSL = slShort and condition <= -1.0 and condition == 0.0
longTP3 = tp3Long and condition == 1.2 and condition == 1.3
shortTP3 = tp3Short and condition == -1.2 and condition == -1.3
longTP2 = tp2Long and condition == 1.1 and condition == 1.2
shortTP2 = tp2Short and condition == -1.1 and condition == -1.2
longTP1 = tp1Long and condition == 1.0 and condition == 1.1
shortTP1 = tp1Short and condition == -1.0 and condition == -1.1
// ——————————— {
//
if strategy.position_size <= 0 and longE and barstate.isconfirmed
strategy.entry(
'Long',
strategy.long,
alert_message = i_leMsg,
comment = 'LE')
if strategy.position_size > 0 and condition == 1.0
strategy.exit(
id = 'LXTP1',
from_entry = 'Long',
qty_percent = i_lxQtyTP1,
limit = tp1Line,
stop = slLine,
comment_profit = 'LXTP1',
comment_loss = 'SL',
alert_profit = i_lxMsgTP1,
alert_loss = i_lxMsgSL)
if strategy.position_size > 0 and condition == 1.1
strategy.exit(
id = 'LXTP2',
from_entry = 'Long',
qty_percent = i_lxQtyTP2,
limit = tp2Line,
stop = slLine,
comment_profit = 'LXTP2',
comment_loss = 'SL',
alert_profit = i_lxMsgTP2,
alert_loss = i_lxMsgSL)
if strategy.position_size > 0 and condition == 1.2
strategy.exit(
id = 'LXTP3',
from_entry = 'Long',
qty_percent = i_lxQtyTP3,
limit = tp3Line,
stop = slLine,
comment_profit = 'LXTP3',
comment_loss = 'SL',
alert_profit = i_lxMsgTP3,
alert_loss = i_lxMsgSL)
if longX
strategy.close(
'Long',
alert_message = i_lxMsg,
comment = 'LX')
//
if strategy.position_size >= 0 and shortE and barstate.isconfirmed
strategy.entry(
'Short',
strategy.short,
alert_message = i_leMsg,
comment = 'SE')
if strategy.position_size < 0 and condition == -1.0
strategy.exit(
id = 'SXTP1',
from_entry = 'Short',
qty_percent = i_sxQtyTP1,
limit = tp1Line,
stop = slLine,
comment_profit = 'SXTP1',
comment_loss = 'SL',
alert_profit = i_sxMsgTP1,
alert_loss = i_sxMsgSL)
if strategy.position_size < 0 and condition == -1.1
strategy.exit(
id = 'SXTP2',
from_entry = 'Short',
qty_percent = i_sxQtyTP2,
limit = tp2Line,
stop = slLine,
comment_profit = 'SXTP2',
comment_loss = 'SL',
alert_profit = i_sxMsgTP2,
alert_loss = i_sxMsgSL)
if strategy.position_size < 0 and condition == -1.2
strategy.exit(
id = 'SXTP3',
from_entry = 'Short',
qty_percent = i_sxQtyTP3,
limit = tp3Line,
stop = slLine,
comment_profit = 'SXTP3',
comment_loss = 'SL',
alert_profit = i_sxMsgTP3,
alert_loss = i_sxMsgSL)
if shortX
strategy.close(
'Short',
alert_message = i_sxMsg,
comment = 'SX')
// ———————————
c_tp = leTrigger or seTrigger ? na :
condition == 0.0 ? na : color.green
c_entry = leTrigger or seTrigger ? na :
condition == 0.0 ? na : color.blue
c_sl = leTrigger or seTrigger ? na :
condition == 0.0 ? na : color.red
p_tp1Line = plot (
condition == 1.0 or
condition == -1.0 ? tp1Line : na,
title = "TP Line 1",
color = c_tp,
linewidth = 1,
style = plot.style_linebr)
p_tp2Line = plot (
condition == 1.0 or
condition == -1.0 or
condition == 1.1 or
condition == -1.1 ? tp2Line : na,
title = "TP Line 2",
color = c_tp,
linewidth = 1,
style = plot.style_linebr)
p_tp3Line = plot (
condition == 1.0 or
condition == -1.0 or
condition == 1.1 or
condition == -1.1 or
condition == 1.2 or
condition == -1.2 ? tp3Line : na,
title = "TP Line 3",
color = c_tp,
linewidth = 1,
style = plot.style_linebr)
p_entryLine = plot (
condition >= 1.0 or
condition <= -1.0 ? entryLine : na,
title = "Entry Line",
color = c_entry,
linewidth = 1,
style = plot.style_linebr)
p_slLine = plot (
condition == 1.0 or
condition == -1.0 or
condition == 1.1 or
condition == -1.1 or
condition == 1.2 or
condition == -1.2 ? slLine : na,
title = "SL Line",
color = c_sl,
linewidth = 1,
style = plot.style_linebr)
fill(
p_tp3Line, p_entryLine,
color = leTrigger or seTrigger ? na :color.new(color.green, 90))
fill(
p_entryLine, p_slLine,
color = leTrigger or seTrigger ? na :color.new(color.red, 90))
//
plotshape(
i_alertOn and longE,
title = 'Long',
text = 'Long',
textcolor = color.white,
color = color.green,
style = shape.labelup,
size = size.tiny,
location = location.belowbar)
plotshape(
i_alertOn and shortE,
title = 'Short',
text = 'Short',
textcolor = color.white,
color = color.red,
style = shape.labeldown,
size = size.tiny,
location = location.abovebar)
plotshape(
i_alertOn and (longX or shortX) ? close : na,
title = 'Close',
text = 'Close',
textcolor = color.white,
color = color.gray,
style = shape.labelup,
size = size.tiny,
location = location.absolute)
l_tp = i_alertOn and (longTP1 or shortTP1) ? close : na
plotshape(
l_tp,
title = "TP1 Cross",
text = "TP1",
textcolor = color.white,
color = color.olive,
style = shape.labelup,
size = size.tiny,
location = location.absolute)
plotshape(
i_alertOn and (longTP2 or shortTP2) ? close : na,
title = "TP2 Cross",
text = "TP2",
textcolor = color.white,
color = color.olive,
style = shape.labelup,
size = size.tiny,
location = location.absolute)
plotshape(
i_alertOn and (longTP3 or shortTP3) ? close : na,
title = "TP3 Cross",
text = "TP3",
textcolor = color.white,
color = color.olive,
style = shape.labelup,
size = size.tiny,
location = location.absolute)
plotshape(
i_alertOn and (longSL or shortSL) ? close : na,
title = "SL Cross",
text = "SL",
textcolor = color.white,
color = color.maroon,
style = shape.labelup,
size = size.tiny,
location = location.absolute)
//
plot(
na,
title = "─── ───",
editable = false,
display = display.data_window)
plot(
condition,
title = "condition",
editable = false,
display = display.data_window)
plot(
strategy.position_size * 100,
title = ".position_size",
editable = false,
display = display.data_window)
//#endregion }
// ——————————— <↑↑↑ G_RISK ↑↑↑>
//#region ———— <↓↓↓ G_SCRIPT02 ↓↓↓> {
// @function Queues a new element in an array and de-queues its first element.
f_qDq(_array, _val) =>
array.push(_array, _val)
_return = array.shift(_array)
_return
var line a_slLine = array.new_line(1)
var line a_entryLine = array.new_line(1)
var line a_tp3Line = array.new_line(1)
var line a_tp2Line = array.new_line(1)
var line a_tp1Line = array.new_line(1)
var label a_slLabel = array.new_label(1)
var label a_tp3label = array.new_label(1)
var label a_tp2label = array.new_label(1)
var label a_tp1label = array.new_label(1)
var label a_entryLabel = array.new_label(1)
newEntry = longE or shortE
entryIndex = 1
entryIndex := newEntry ? bar_index : nz(entryIndex )
lasTrade = bar_index >= entryIndex
l_right = 10
line.delete(
f_qDq(a_slLine,
line.new(
entryIndex,
slLine,
last_bar_index + l_right,
slLine,
style = line.style_solid,
color = c_sl)))
line.delete(
f_qDq(a_entryLine,
line.new(
entryIndex,
entryLine,
last_bar_index + l_right,
entryLine,
style = line.style_solid,
color = color.blue)))
line.delete(
f_qDq(a_tp3Line,
line.new(
entryIndex,
tp3Line,
last_bar_index + l_right,
tp3Line,
style = line.style_solid,
color = c_tp)))
line.delete(
f_qDq(a_tp2Line,
line.new(
entryIndex,
tp2Line,
last_bar_index + l_right,
tp2Line,
style = line.style_solid,
color = c_tp)))
line.delete(
f_qDq(a_tp1Line,
line.new(
entryIndex,
tp1Line,
last_bar_index + l_right,
tp1Line,
style = line.style_solid,
color = c_tp)))
label.delete(
f_qDq(a_slLabel,
label.new(
last_bar_index + l_right,
slLine,
'SL: ' + str.tostring(slLine, '##.###'),
style = label.style_label_left,
textcolor = color.white,
color = c_sl)))
label.delete(
f_qDq(a_entryLabel,
label.new(
last_bar_index + l_right,
entryLine,
'Entry: ' + str.tostring(entryLine, '##.###'),
style = label.style_label_left,
textcolor = color.white,
color = color.blue)))
label.delete(
f_qDq(a_tp3label,
label.new(
last_bar_index + l_right,
tp3Line,
'TP3: ' + str.tostring(tp3Line, '##.###'),
style = label.style_label_left,
textcolor = color.white,
color = c_tp)))
label.delete(
f_qDq(a_tp2label,
label.new(
last_bar_index + l_right,
tp2Line,
'TP2: ' + str.tostring(tp2Line, '##.###'),
style = label.style_label_left,
textcolor = color.white,
color = c_tp)))
label.delete(
f_qDq(a_tp1label,
label.new(
last_bar_index + l_right,
tp1Line,
'TP1: ' + str.tostring(tp1Line, '##.###'),
style = label.style_label_left,
textcolor = color.white,
color = c_tp)))
// ———————————
//
if longE or shortE or longX or shortX
alert(message = 'Any Alert', freq = alert.freq_once_per_bar_close)
if longE
alert(message = 'Long Entry', freq = alert.freq_once_per_bar_close)
if shortE
alert(message = 'Short Entry', freq = alert.freq_once_per_bar_close)
if longX
alert(message = 'Long Exit', freq = alert.freq_once_per_bar_close)
if shortX
alert(message = 'Short Exit', freq = alert.freq_once_per_bar_close)
//#endregion }
// ——————————— <↑↑↑ G_SCRIPT03 ↑↑↑>
Swing trend Pro Buy and Sell Alerts Bu AMit NamdeoThis script, "Swing Pro ", is a complete Trend Following system designed for Swing Trading. It moves away from the complexity of needing all 3 EMAs to align perfectly and instead uses a simpler, more robust logic that filters out noise using a "Base Support" concept.
Here is a breakdown of exactly how it works:
1. The Strategy Logic (The Core)
The script combines Momentum (Crossovers) with Location (Base Support) to generate high-probability signals.
The Trigger (Entry):
It watches for a crossover between the Fast EMA (20) and Medium EMA (50).
Buy Trigger: 20 EMA crosses Above 50 EMA.
Sell Trigger: 20 EMA crosses Below 50 EMA.
The Filter (Location):
Signals are only valid if they happen on the correct side of the Slow EMA (200) (The Blue Line).
For Buys: The price must be ABOVE the Blue 200 EMA. This ensures you are buying in a long-term uptrend where the 200 EMA acts as a floor/support.
For Sells: The price must be BELOW the Blue 200 EMA. This ensures you are selling in a downtrend where the 200 EMA acts as a ceiling/resistance.
ADX Filter:
It checks the ADX (Average Directional Index). If the ADX is below 20 (default), the market is considered "Choppy/Sideways," and the signal is ignored. This saves you from entering false breakouts.
2. Risk Management (Automated)
Once a trade is entered, the script automatically handles the risk math for you based on the ATR (Average True Range).
Stop Loss (SL):
Initial SL: Placed at 1.5x ATR away from the entry price.
Trailing SL: As the price moves in your favor, the Orange SL line automatically moves up (for buys) or down (for sells). It acts as a ratchet—it never moves backwards, locking in your profit.
Take Profits (TP):
TP1: 2.0x ATR (Conservative target).
TP2: 3.5x ATR (Standard swing target).
TP3: 5.0x ATR (Extended trend target).
3. Visuals & Layout
Modern Badges: Bright Green "BUY" and Red "SELL" buttons appear directly on the chart candles.
Dynamic Lines:
Orange Line: Your Trailing Stop Loss. It disappears when the trade is over.
Blue Dashed Lines: Your TP1, TP2, and TP3 targets.
EMA Colors:
Green Line: Fast EMA (20).
Orange Line: Medium EMA (50).
Thick Blue Line: Slow EMA (200 / Base Support).
Bar Coloring: The candles turn bright Green or Red during an active trade to help you instantly see the trend state.
4. How to Trade with It
The Buy Setup:
Wait for the price to be floating above the Thick Blue Line (200 EMA).
Wait for the Green Line (20) to cross up through the Orange Line (50).
A "BUY" badge appears.
Action: Enter the trade. Set your physical Stop Loss at the price shown by the Orange SL line.
The Sell Setup:
Wait for the price to be below the Thick Blue Line (200 EMA).
Wait for the Green Line (20) to cross down through the Orange Line (50).
A "SELL" badge appears.
Action: Enter Short. Follow the Orange SL line down as price drops.
5. Settings Menu
You can customize almost everything in the indicator settings:
Lengths: Change the EMA lengths (e.g., to 9/21/200 if you prefer faster scalping).
Risk: Change the ATR multipliers to make the Stop Loss tighter (e.g., 1.0) or wider (e.g., 2.0).
Visuals: Change the badge sizes (Small/Normal/Large) and colors to fit your dark/light theme.
Volume-Weighted FVG (Fixed)1. The Core Concept: Identifying "Institutional Footprints"
FVG (Fair Value Gap): These are "gaps" or "voids" in price created by rapid movement. The market has a natural tendency to return and "fill" these gaps.
The Volume Filter: Unlike standard FVGs, this tool highlights zones created with high trading volume (Strong FVG). These represent the "footprints" of institutional traders—the "Big Money" that truly moves the market.
2. Trading the "Wall": Rejection and Reversal
The Rejection (Bounce): A Strong FVG acts as a powerful "wall." When price returns to this zone, unfilled orders often trigger, causing the price to bounce back (reject).
The Reversal (Breakout): If this "wall" is completely breached, it triggers a cascade of stop-losses from those who bet on the bounce. This results in a violent move in the opposite direction, known as a reversal.
The Retest: Once a "wall" is broken, its role flips (e.g., support becomes resistance). Trading the first retest of a broken Strong FVG is one of the highest-probability setups in scalping.
3. The Execution: High-Precision Entry
To achieve a Profit Factor (PF) of 5.0+, we combine three elements:
Structure: Confirm the trend using Multi-Timeframe (MTF) HH/HL (Higher Highs/Higher Lows).
The Zone: Price enters a Strong FVG (Darker color).
The Trigger: Enter when an Engulfing Candle breaks through the BB20 Middle Line, confirmed by an RCI 9 reversal.
SMC + Dual UT Bot buy and sell AlertsMise a jour avec un EMA 20/50 et vwap
his script is a composite indicator for TradingView (Pine Script v5) that merges Smart Money Concepts (SMC) with a Dual-instance UT Bot. It has been styled with a high-contrast "Neon Cyberpunk" theme (Cyan/Pink) and is fully compliant with the CC BY-NC-SA 4.0 license.
Here is a breakdown of its two main components:
1. Smart Money Concepts (SMC)
This portion, originally by LuxAlgo, is designed to identify institutional price levels and structural market shifts. It provides a detailed map of market structure rather than simple entry/exit signals.
Market Structure (BOS & CHoCH):
BOS (Break of Structure): Marks trend continuation (e.g., breaking a higher high in an uptrend).
CHoCH (Change of Character): Marks potential trend reversals (e.g., the first time a higher low is broken in an uptrend).
Order Blocks (OB):
Highlights specific candles where institutional buying or selling likely occurred. These act as high-probability support/resistance zones.
Neon Blue/Cyan for Bullish OBs.
Neon Pink for Bearish OBs.
Fair Value Gaps (FVG):
Identifies imbalances (gaps) in price action where the market often returns to "fill" orders.
Neon Mint for Bullish FVGs.
Neon Red for Bearish FVGs.
Premium/Discount Zones: Automatically plots the range equilibrium (50% level) to help you buy in "Discount" (low) and sell in "Premium" (high) areas.
Liquidity (EQH/EQL): Automatically detects "Equal Highs" and "Equal Lows," which are magnets for price as they represent liquidity pools (stop losses).
2. Dual UT Bot Alerts
This portion provides the actual Entry Signals. It runs two separate instances of the "UT Bot" strategy simultaneously with different sensitivity settings to filter noise.
Instance 1 (Buy Only):
Settings: Key Value = 4, ATR Period = 10 (Faster, more sensitive).
Visual: Plots a Neon Cyan "Buy" label.
Function: Looks for bullish reversals earlier to catch the start of a move.
Instance 2 (Sell Only):
Settings: Key Value = 7, ATR Period = 20 (Slower, smoother).
Visual: Plots a Neon Pink "Sell" label.
Function: Uses a wider ATR band to avoid getting shaken out of shorts too early, focusing on major downtrends.
How to Use It
The strength of this script is confluence.
Wait for a Signal: Look for a UT Bot "Buy" or "Sell" tag.
Confirm with SMC: Check if the signal aligns with SMC concepts.
Example Buy: Did the UT Bot give a "Buy" signal while price was bouncing off a Bullish Order Block?
Example Buy: Did price just sweep Liquidity (EQL) before the Buy signal?
Example Sell: Is the "Sell" signal happening inside a Premium Zone or a Bearish Fair Value Gap?
avant-hier
Notes de version
1. "Pro" Badge Buy/Sell Labels
The standard text signals have been replaced with modern, professional Badge Labels that provide more information at a glance.
Visuals: Instead of simple text, the script now uses label.new to create high-visibility badges.
BUY: A Neon Cyan badge with a Rocket icon (🚀).
SELL: A Neon Pink badge with a Chart icon (📉).
Price Details: Each badge displays the exact Entry Price directly on the label.
Tooltips: If you hover your mouse over a Buy or Sell badge, a tooltip will appear showing the exact Take Profit (TP) and Stop Loss (SL) prices calculated for that trade.
2. Dynamic Take Profit (TP)
The script now automatically calculates a profit target for every trade the moment a signal is generated.
Calculation: It measures the distance between your Entry Price and the initial Stop Loss (the ATR Trailing Stop).
Risk:Reward: It multiplies that distance by your chosen Risk:Reward Ratio (default is 1.5) to project a TP target.
Visual Line: A Green Line is drawn on the chart at the TP level. It remains active until price hits it or the stop loss.
3. Active Trailing Stop Loss (SL)
The Stop Loss is no longer static; it is now "alive" and manages the trade for you.
Trailing Logic: If Use Trailing SL? is enabled (default), the SL line will automatically move up (for longs) or move down (for shorts) as the trend continues in your favor. It locks in profit by following the UT Bot's ATR trailing band.
Visual Line: A Red Line is drawn at the SL level. You can see it physically step up or down on the chart as the trend progresses.
4. Real-Time Trade Simulation
The script now simulates the lifecycle of a trade directly on the chart:
Active State: When a trade is live, the TP and SL lines extend to the right of the current candle (bar_index + 1), showing you exactly where your exit points are in real-time.
Closed State: Once the price hits either the Green TP line or the Red SL line, the script detects the "Exit." The lines stop extending and turn dotted, indicating that the trade is closed and waiting for the next signal.
Summary of New Settings
You will find a new group in the settings panel called "UT Bot: Trade Management":
TP Risk:Reward Ratio: Adjust this to change how far the Green TP line is placed (e.g., set to 2.0 for 2x return).
Use Trailing SL?: Uncheck this if you want the Red SL line to stay fixed at the initial entry risk level.
avant-hier
Notes de version
1. Live Strategy Performance Dashboard (Backtester)
Since this is an indicator, TradingView does not automatically calculate PnL (Profit and Loss). I have built a custom Simulation Engine inside the script that tracks every UT Bot signal as if you had taken the trade.
Location: Bottom Right of your chart.
Win Rate: Displays the percentage of trades that hit the Take Profit target versus the Stop Loss.
Trades (W/L): Shows the total number of signals generated, broken down by Wins and Losses.
Net Profit (R): Calculates your theoretical profit in "R-Multiples" (Risk Units).
Example: If you set your Risk:Reward to 2.0, every win adds +2R, and every loss subtracts -1R.
Dynamic Colors: The Win Rate and Profit cells turn Neon Cyan if positive (>50% or >0R) and Neon Pink if negative.
2. Multi-Timeframe Trend Dashboard
A new panel at the Top Right gives you an instant "Market Bias" reading so you don't have to scan the whole chart.
SMC Trend: Reads the Smart Money structure (Break of Structure/Change of Character) to determine if the high-level timeframe is BULLISH or BEARISH.
UT Bot Status: Displays the current active signal state:
BUY (Active): You are currently in a Long trade.
SELL (Active): You are currently in a Short trade.
NEUTRAL: No active signal or the last trade hit TP/SL.
3. Integrated Alert System
I have connected the visual lines to the alert system. You can now set a single alert on this indicator, and it will trigger for:
Entry Signals: "UT Long Entry" / "UT Short Entry"
Exits: "Take Profit Hit" / "Stop Loss Hit"
4. Consolidated Settings
To make the script easier to manage, I organized the settings into clear groups:
Dashboards: Toggle the visibility of the new panels or move the Performance Panel to a different corner.
UT Bot: Trade Management: Quickly adjust your Risk:Reward Ratio (e.g., change from 1.5 to 2.0) to see how it affects your Win Rate in real-time on the dashboard.
avant-hier
Notes de version
1. Multi-Timeframe (MTF) Trend Scanner
I have replaced the basic "Market Bias" panel with a comprehensive MTF Trend Dashboard located at the Top Right of your chart.
What it tracks: It simultaneously monitors the trend direction on 5 distinct timeframes:
15 Minute
1 Hour
4 Hour
Daily
Weekly
How it works: It runs a background calculation (using UT Bot settings Key=5, ATR=15) on these higher timeframes without you needing to switch charts.
Visuals:
BULLISH: Highlighted in Neon Cyan.
BEARISH: Highlighted in Neon Pink.
2. Strategic Confluence (How to use it)
This new dashboard transforms the script from a simple "signal generator" into a complete trading system by allowing you to filter trades based on the bigger picture.
The "All-Green" Rule: If you are scalping on a 5-minute chart and you get a BUY signal, check the dashboard. If the 1H, 4H, and Daily are all Neon Cyan (Bullish), that trade has a significantly higher probability of success.
Avoid Counter-Trend Trades: If your main chart says BUY, but the dashboard shows the 4H and Daily are Neon Pink (Bearish), you are trading against the major trend. You might want to skip that trade or reduce your risk size.
3. Summary of Dashboards
You now have two professional-grade panels on your screen:
Bottom Right (Performance): Shows the past results of the strategy on your current timeframe (Win Rate, Profit Factor).
Top Right (Trend): Shows the current state of the market across all timeframes.
Big Move Predictor ProThis indicator uses support, resistance and EMA lines to predict accurately which way the market will go and will give you buy or sell signals. With backtest results of 67.5% this indicator is one the best free indicators you can use right now.
Engulfing + EMA + WMA + ICT Alejandradetector de velas engulfing
7 emas disponibles
wma
detector de bos y choch
Linear Regression Market State IndexStandard Deviation Market Structure Indicator
A Comprehensive Multi-Timeframe Market Analysis Tool
🎯 Overview
The Standard Deviation Market Structure (SDMS) indicator is a sophisticated technical analysis tool that integrates multiple proven methodologies to identify market structure, trend direction, and potential reversal zones. By combining price action, statistical analysis, and momentum indicators across multiple timeframes, SDMS provides traders with a comprehensive view of market dynamics.
✨ Key Features
Multi-Timeframe Integration
Primary analysis on current timeframe
1-hour statistical confirmation for support/resistance levels
Order block extension across 500 future bars
Comprehensive Technical Suite
RSI with Deviation Analysis
Dynamic Order Block Detection
Gaussian Filter Channels
Linear Regression with Statistical Bands
Standard deviation to detect price outliers
Directional Movement Index (DMI/ADX)
Bollinger Band % Analysis
Support/Resistance Line System
Visual Clarity
Color-coded signals and zones
Automatic level management
Clean, intuitive display
📊 Core Components Explained
1. Order Block System
What Are Order Blocks?
Order blocks are price zones where institutional activity has occurred, creating future support or resistance levels. SDMS automatically detects these critical zones.
Detection Logic:
Bullish Order Blocks: Form when price breaks above recent highs following bearish candles
Bearish Order Blocks: Form when price breaks below recent lows following bullish candles
Visual Identification:
Green boxes with "BuOB" labels (support zones)
Red boxes with "BeOB" labels (resistance zones)
Each block shows its boundary price for easy reference
Dynamic Management:
Automatically extends 300 bars into the future
Self-cleaning: removes blocks when price breaches their boundaries
Real-time adjustment to changing market structure
2. Statistical Support/Resistance System
How It Works:
SDMS creates support and resistance lines based on statistical extremes confirmed on the 1-hour timeframe.
Trigger Conditions:
Support Lines (Green): Trigger when 1H Bollinger Band % crosses above 0 and bearish momentum subsides.
Resistance Lines (Red): Trigger when 1H Bollinger Band % crosses below 1 and bullish momentum subsides
The Science Behind BB%:
BB% = (Price - Lower Band) / (Upper Band - Lower Band)
BB% <= 0: Price at statistical oversold extreme; also indicated by white candles.
BB% > 1: Price at statistical overbought extreme; also indicated by white candles.
Line Management:
Maximum of 15 active lines
Oldest lines automatically removed
Lines extend across chart for ongoing reference
3. Trend Analysis Suite
Hull Moving Average (HMA):
55-period smoothed trend indicator
Color-coded: Green = bullish, Red = bearish
Visual band shows trend acceleration/deceleration
Gaussian Channel:
Advanced filtering of market noise
Dynamic channel based on true range volatility
Helps identify mean reversion opportunities
Form a yellow band when price is overbought or oversold zones.
Linear Regression System:
Statistical price modeling
Multiple standard deviation bands (up to 3SD)
Regression-based candlestick visualization
Candles turn white when in overbought zones. Yellow candles indicate extremely overbought zones. Blue candles indicate a bullish trend with high volume.
Bearish candles are bluish-purple when volume is high and red when the volume is within normal ranges or low.
4. Momentum & Oscillator Integration
RSI with Deviation Tracking:
21-period RSI with 30-period smoothing
Tracks deviation from moving average based off linear regression
Identifies momentum divergences
Directional Movement Index:
Multi-period DMI/ADX analysis
Used to detect overbought and oversold zones within the indicator calculations.
Combines with RSI for enhanced signals
Momentum confirmation for all entries/exits
🎯 Trading Signals & Alerts
Buy Signals (Yellow "Buy" Labels)
Multi-Condition Confirmation Required:
RSI Oversold Reversal: RSI crosses above 30
Trend Alignment: HMA showing bullish structure
Momentum Confirmation: DMI alignment
Statistical Support: Price at or near support zones
Risk Management: Multiple confirming indicators
Strong Buy Conditions:
Confluence of order block support + BB% support line
Multiple timeframe alignment
Volume confirmation at key levels
Sell Signals (Red/Yellow "Sell" Labels)
Multi-Condition Confirmation Required:
RSI Overbought Reversal: RSI crosses below 70
Trend Exhaustion: HMA showing bearish structure
Momentum Divergence: DMI bearish alignment
Statistical Resistance: Price at or near resistance zones
Timeframe Confirmation: 1H BB% bearish signals
Strong Sell Conditions:
Confluence of order block resistance + BB% resistance line
Multiple timeframe distribution
Volume surge at resistance
Additional Alerts
RSI Divergence Signals: Triangles showing momentum shifts
Extreme Price Alerts: Circles at statistical extremes
Structure Breaks: Visual cues for order block violations
🎨 Visual System Guide
Color Coding System
Green: Bullish conditions, support zones, rising trends
Red: Bearish conditions, resistance zones, falling trends
Blue: Statistical channels, neutral zones
Yellow: Alert conditions, extreme signals
White: Transition zones, neutral signals
Zone Identification
Buying Pressure Zones: Green/blue tinted areas below price or white candles with white dots within the moving average center line
Selling Pressure Zones: Red tinted areas above price with white dots within the moving average center line
Standard Deviation Zones: Gradient colors showing statistical extremes
⚙️ Customization Options
Adjustable Parameters
RSI Settings: Period, oversold/overbought levels, sensitivity
Order Block Detection: Lookback period, ATR multiplier, extension
Statistical Settings: Gaussian filter poles, regression periods
Support/Resistance: Maximum lines, BB% settings
Visual Preferences: Colors, band displays, alert styles
Input Groups
RSI Trading Strategy
Order Block Configuration
Gaussian Channel Settings
Linear Regression Parameters
DMI/ADX Configuration
Bollinger Band % Settings
📈 Practical Trading Applications
For Swing Traders
Identify Key Levels: Use order blocks + BB% lines for entry/exit planning
Trend Confirmation: HMA + Gaussian channel for trend direction
Risk Management: Standard deviation bands for stop placement
Timing Entries: RSI/DMI alignment for optimal entry timing
For Day Traders
Intraday Levels: Order blocks provide immediate S/R for day trading
Momentum Signals: Real-time RSI/DMI signals for quick moves
Statistical Edges: Gaussian channel for mean reversion plays
Breakout Confirmation: Order block breaks with volume
For Position Traders
Higher Timeframe Structure: 1H BB% lines for major levels
Trend Persistence: HMA for long-term trend identification
Accumulation/Distribution Zones: Order blocks show institutional activity
Multi-Timeframe Alignment: Confirmation across timeframes
🔍 How to Use SDMS Effectively
Step 1: Market Structure Assessment
Identify active order blocks (green/red boxes)
Note BB% support/resistance lines (horizontal lines)
Assess HMA and moving average trend direction (color)
Check Gaussian channel position (preferably outside 2SD)
Step 2: Signal Confirmation
Wait for multiple indicator alignment
look for doji candles.
Confirm with green (bullish) or red (bearish) candles
Confirm with volume if available
Check for confluence of levels
Assess risk/reward based on nearby levels
Step 3: Trade Management
Enter at confirmed support/resistance
Place stops beyond opposite levels
Take profits at next statistical level
Monitor for structure changes
Step 4: Risk Management
Use standard deviation bands for volatility assessment
Never risk more than 1-2% per trade
Adjust position size based on confluence strength
Have predefined exit rules
💡 Advanced Strategies
Strategy 1: Confluence Trading
Setup: Order block + BB% line at same level
Entry: Price tests confluence zone with RSI signal
Stop: Beyond the confluence zone
Target: Next statistical level
Strategy 2: Breakout Trading
Setup: Price approaching order block boundary
Entry: Break with volume + RSI/DMI confirmation
Stop: Re-entry into order block
Target: Next BB% line extension
Strategy 3: Mean Reversion
Setup: Price at Gaussian channel extremes
Entry: RSI reversal signal at channel boundary
Stop: Beyond channel extreme
Target: Channel midline or opposite boundary
⚠️ Important Considerations
Best Market Conditions
Trending Markets: Excellent performance in clear trends
Breakout Scenarios: Strong identification of break levels
Range Markets: Works well with defined ranges
Limitations
Choppy Markets: May give false signals in consolidation
News Events: Fundamental shocks can override technical levels
Timeframe Specific: Optimal on 15-minute to daily charts
Risk Management Rules
Always use stops
Never rely on single signals
Consider market context
Adjust for volatility changes
Keep position sizes consistent
🔧 Technical Specifications
Maximum Lines: 500
Maximum Bars Back: 1000
Maximum Boxes: 500
Calculation Efficiency: Optimized for real-time use
🏆 Why SDMS Stands Out
Unique Advantages
Integrated Approach: Combines multiple methodologies into one tool
Self-Adjusting: Automatically adapts to market changes
Multi-Timeframe: Provides both immediate and higher timeframe context
Visual Clarity: Clean, intuitive display of complex data
Professional Grade: Institutional-level analysis accessible to all traders
Educational Value: Learn how different indicators interact
Understand market structure development
See institutional order flow patterns
Develop disciplined trading habits
📚 Learning Resources
Recommended Study Approach
Start Simple: Focus on order blocks and BB% lines first
Add Complexity: Gradually incorporate other indicators
Paper Trade: Practice without risk
Keep Journal: Document setups and outcomes
Review Regularly: Analyze both wins and losses
Common Pitfalls to Avoid
Overtrading: Wait for high-quality setups
Ignoring Context: Consider overall market conditions
Chasing Signals: Enter at planned levels, not after moves
Risk Mismanagement: Always know your risk before entering
Confirmation Bias: Be objective about signals
🤝 Community & Support
Getting the Most from SDMS
Start with Defaults: Use default settings initially
Adjust Gradually: Make small changes as you understand the tool
Combine with Fundamentals: Use for timing within fundamental context
Stay Disciplined: Follow your trading plan consistently
Continuous Improvement
SDMS is designed for continuous learning. As you use the indicator, you'll develop insights into:
Market microstructure
Institutional trading patterns
Statistical edge identification
Risk management optimization
Risk management is more important than signal accuracy
Patience is required for high-quality setups
Success Factors
Discipline: Following your plan consistently
Patience: Waiting for proper setups
Risk Management: Protecting your capital
Continuous Learning: Improving your skills over time
🌟 Final Thoughts
The Standard Deviation Market Structure indicator represents a sophisticated approach to technical analysis, combining the best elements of price action, statistical analysis, and momentum indicators. While powerful, remember that no indicator guarantees success. SDMS is a tool – your skill, discipline, and risk management determine your trading results.
Use SDMS as part of a comprehensive trading plan, combine it with proper risk management, and continue developing your trading skills. The markets are always teaching – stay humble, stay disciplined, and trade well.
Disclaimer: This indicator is for educational purposes only. Past performance does not guarantee future results. Trading involves risk of loss. Always consult with a qualified financial professional before making investment decisions.
eBacktesting - Learning: Liquidity GrabseBacktesting - Learning: Liquidity Grabs highlights moments when price pushes just beyond a recent swing high or swing low (where many stops tend to sit) and then quickly returns back inside the level. This behavior is often called a stop run, sweep, or liquidity grab.
Traders study these events because they can reveal:
- Where liquidity is “resting” (obvious highs/lows)
- A quick sweep and rejection (often a wick)
- When a breakout attempt is actually a trap
- A full candle close through the level, followed by an immediate reversal back inside (classic breakout trap)
- Potential areas where price may reverse or accelerate after stops are taken
Use it as a training tool to build pattern recognition and improve your patience around key levels, especially during active sessions where sweeps happen frequently.
These indicators are built to pair perfectly with the eBacktesting extension, where traders can practice these concepts step-by-step. Backtesting concepts visually like this is one of the fastest ways to learn, build confidence, and improve trading performance.
Educational use only. Not financial advice.
RSI-RS StrategyRSI-RS Strategy: Smart Trend Following 🚀
Overview
This strategy combines Multi-Timeframe RSI with Mansfield Relative Strength to identify high-momentum breakouts in strong stocks. Unlike standard RSI strategies, it features a "Smart Trailing Stop" that tightens when momentum weakens but respects key RSI 50 support levels to avoid shaking you out of winning trades.
Key Features ✨
1. 🎯 High-Probability Entries
Multi-Confirmations: Requires Monthly RSI > 60 and Weekly RSI > 60 (Trend is Up).
Dual Trigger: Enters on a Daily RSI Breakout (>60) OR a Weekly RSI Catch-up, ensuring you don't miss late moves.
RS Filter: Only buys stocks outperforming the Index (RS > 0).
New Listing Safe: Automatically skips Monthly checks for new IPOs lacking history.
2. 🛡️ Advanced "Hybrid" Stop Loss
This strategy solves the "Wick Out" problem:
Confirmation Exit: If price drops below the Stop Loss, it waits for the Next Candle to confirm the breakdown. It ignores intraday wicks!
Crash Protection: Includes a "Panic Button" (Default 3% buffer). If price crashes rapidly intraday, it exits immediately to save capital.
Smart Trailing: The Stop Loss moves UP when RSI shows weakness (<60), locking in profits.
3. 🧠 Smart Support Buffer
Wait for 50: Uniquely detects when RSI is resting on 50 Support (Zone 50-55).
Patience: It ignores minor weakness signals in this zone, waiting for a bounce instead of exiting prematurely.
4. 🧹 Clean Visuals
Minimalist Labels: Transparent Entry/Exit labels that don't declutter the chart.
Setup Watch: Visually signals "Watch > " before the trade triggers.
Transparency: "SL Update" diamonds prove exactly why the stop moved (showing the RSI value).
Settings Guide ⚙️
Confirmation Window: How many bars the breakout remains valid (Default: 2).
RSI Support Buffer: The "Safe Zone" range above 50 (Default: 5).
Crash Buffer %: Distance below SL for immediate emergency exit (Default: 3.0%).
Visuals: Toggle Setup Labels and SL Diamonds on/off to keep your chart clean.
How to Trade It
Green Background: You are in a trade.
Red Line: Your Hard Stop Loss (Closing Basis).
Maroon Dotted Line: Your Crash Limit (Intraday Danger Zone).
Orange Diamond: Warning! RSI Weakness detected, SL has tightened.
Disclaimer
Backtested on Indian Equities (NSE). Designed for Swing Trading on Daily Timeframe. Always manage your own risk.
eBacktesting - Learning: Buy/Sell-side LiquidityeBacktesting - Learning: Buy/Sell-side Liquidity
Buy-side and sell-side liquidity are some of the most important “magnets” in day trading. When price forms obvious swing highs and swing lows, stop-loss orders often build up just above those highs (buy-side liquidity) and just below those lows (sell-side liquidity). Markets frequently move into these areas to “take” that liquidity before making the next meaningful move.
This indicator helps you spot those potential liquidity pools and highlights when price reaches them. Use it to study:
- where stops are likely resting above highs / below lows
- how often price sweeps those areas before reversing
- how liquidity runs can trigger the next expansion or trend continuation
These indicators are built to pair perfectly with the eBacktesting extension, where traders can practice these concepts step-by-step. Backtesting concepts visually like this is one of the fastest ways to learn, build confidence, and improve trading performance.
Educational use only. Not financial advice.
Aura Squeeze Projections [Pineify]Pineify - Aura Squeeze Projections
This indicator combines the volatility compression detection of the TTM Squeeze methodology with an innovative "aura glow" visualization, offering traders a clear and aesthetically distinct way to identify low-volatility consolidation phases and anticipate breakout directions. By merging Bollinger Bands, Keltner Channels, and linear regression momentum analysis, the Aura Squeeze Projections provides actionable squeeze signals with directional bias.
Key Features
Visual "aura glow" effect highlighting squeeze zones and momentum shifts
Squeeze detection combining Bollinger Bands and Keltner Channels
Linear regression-based momentum for directional bias
Dynamic candle coloring reflecting current market state
Squeeze start and release signal markers
How It Works
The core logic identifies volatility compression by comparing Bollinger Bands to Keltner Channels. When the Bollinger Bands contract inside the Keltner Channel boundaries (BB upper < KC upper AND BB lower > KC lower), the market enters a "squeeze" state — a period of low volatility that often precedes significant price movement.
Momentum direction is calculated using a linear regression slope of the difference between price and its moving average. A positive slope indicates bullish momentum; negative indicates bearish momentum. This determines the anticipated breakout direction when the squeeze releases.
How Multiple Indicators Work Together
Bollinger Bands measure statistical volatility through standard deviation, expanding during high volatility and contracting during consolidation. Keltner Channels use Average True Range (ATR) for a smoother volatility envelope. When BB fits entirely within KC, volatility has compressed below normal levels — the squeeze condition.
The linear regression momentum component adds directional intelligence. Rather than simply detecting compression, it forecasts the likely breakout direction by analyzing the trend slope of price deviation from its mean. This synergy transforms a binary squeeze signal into an actionable directional setup.
Unique Aspects
The "aura glow" visualization creates gradient fills between the trend midline and Keltner boundaries, providing an intuitive heat-map style view of market conditions. Colors transition dynamically: gray during squeeze (consolidation), green for bullish momentum, and red for bearish momentum. This makes market state immediately recognizable at a glance.
How to Use
Watch for the gray squeeze state indicating volatility compression
Note the circle marker appearing above bars when squeeze begins
Observe when the diamond marker appears below bars — squeeze release
The color at release (green/red) indicates anticipated breakout direction
Use candle coloring for confirmation of momentum alignment
Customization
Lookback Length : Adjusts sensitivity (shorter = more signals, longer = fewer but stronger)
BB/KC Multipliers : Fine-tune squeeze detection threshold
Use EMA : Toggle between EMA (smoother) or SMA for the midline basis
Aura Transparency : Control visual intensity of the glow effect
Conclusion
Aura Squeeze Projections offers a refined approach to squeeze-based trading by combining proven volatility compression detection with momentum-based directional analysis and distinctive visual presentation. The indicator helps traders identify consolidation periods and prepare for breakouts with directional confidence. Best used alongside price action analysis and support/resistance levels for confirmation.
eBacktesting - Learning: Equal Highs & LowseBacktesting - Learning: Equal Highs & Lows helps you spot Equal Highs (EQH) and Equal Lows (EQL) — price areas where the market has paused or reacted multiple times at nearly the same level.
These zones often act like “magnets” because many traders place stops and pending orders around them. When price returns, it can lead to a quick grab (a sweep) and reversal, or it can break through and continue. Learning to recognize EQH/EQL can improve your timing, help you anticipate where volatility may appear, and give you clearer areas for invalidation and targets.
These indicators are built to pair perfectly with the eBacktesting extension, where traders can practice these concepts step-by-step. Backtesting concepts visually like this is one of the fastest ways to learn, build confidence, and improve trading performance.
Educational use only. Not financial advice.
Market State Fear & Greed Bubble Index V1Market State Fear & Greed Bubble Index V1
📊 Comprehensive Market Sentiment Analyzer
This advanced indicator measures market psychology through a multi-dimensional scoring system, combining demand/supply pressure, trend momentum, and statistical extremes to identify fear/greed cycles and trading opportunities.
🎯 Core Features
Five-Factor Fear & Greed Score
Weighted sentiment analysis:
Demand/Supply (25%): Real-time buying/selling pressure
RSI (25%): Momentum extremes
KDJ (20%): Overbought/oversold detection
Bollinger Band % (20%): Statistical positioning
ADX Trend (10%): Trend strength confirmation
Multi-Layer Market State Detection
Extreme Fear/Greed: Statistical bubble identification
Trend Bias: Bullish/Bearish/Neutral classification
Confidence Scoring: Setup reliability assessment
Reversal Alerts: Early trend change signals
Visual Dashboard
Top-right information panel displays:
Fear & Greed Score (0-100)
Market State Classification
Trend Bias & Confidence
Signal Quality & Alerts
📈 Key Components
Fear & Greed Gauge
0-30: Extreme Fear (buying opportunities)
30-47: Fear (accumulation zones)
47-70: Neutral (consolidation)
70-90: Greed (caution zones)
90-100: Extreme Greed (selling opportunities)
Deviation Zones
Red Zone (±17.065): Critical reversal areas
Yellow Zone (±34.135): Warning levels
Blue Zone (±47.72): Statistical extremes where reversals are highly likely. These occur when asset prices are in a bubble that's about to pop.
Signal Types
Buy/Sell Labels: Primary entry/exit signals
Scalp Signals: Short-term opportunities
Bottom/Top Detectors: Extreme reversal zones
Whale Indicators: Institutional activity markers
🚀 Trading Applications
Extreme Fear Setups Conditions:
Fear & Greed Score < 34.135
BB% < 0 or < J-inverted line
RSI < 34.135
Confidence score > 68%
Bullish divergence present
Action: Accumulation positions, scaled entries
Extreme Greed Setup Conditions:
Fear & Greed Score > 68.2
BB% > 100 or > 80 with divergence
RSI > 68.2
ADX showing trend exhaustion
Multiple timeframe resistance
Action: Profit-taking, protective stops
Trend Following
Bullish Conditions:
Sentiment score rising from fear zones
DMI+ above DMI- and rising
Confidence > 75%
Volume supporting moves
Bearish Conditions:
Sentiment declining from greed zones
DMI- above DMI+ and rising
Distribution patterns
Multiple resistance failures
⚙️ Customization Options
Adjustable Parameters:
DMI Settings: DI lengths, ADX smoothing
KDJ Periods: Customizable sensitivity
BB% Range: Statistical band adjustments
Smoothing Options: Demand/Supply filtering
Alert Thresholds: Custom signal levels
Visual Customization:
Color schemes for different market states
Line thickness and style preferences
Information panel display options
Alert sound/visual preferences
📊 Signal Interpretation
Primary Signals:
Green 'B': Strong buy opportunity
Red 'S': Strong sell opportunity
White 'Scalp': Short-term trade
Trade Area: Accumulation/distribution zones
Visual Markers:
🔥: Bullish momentum building
🐻: Bear exhaustion building
🐳: Whale/institutional activity
Color-coded fills: Market state visualization
Confidence Levels:
≥80%: High reliability setups
60-79%: Moderate confidence
<60%: Low confidence, avoid or reduce size
⚠️ Risk Management Guidelines
Critical Rules:
Never trade against extreme sentiment (Extreme Fear → buy, Extreme Greed → sell)
Require multiple confirmation signals
Use confidence scores for position sizing
Avoid When:
Conflicting signals between components
Low volume participation
Confidence score < 50%
Major news events pending
Extreme volatility conditions
💡 Advanced Strategies
Sentiment Cycle Trading
Identify sentiment extremes
Wait for confirmation reversals
Enter with trend confirmation
Exit at opposite sentiment extreme
Use confidence scores and fear & greed scores to scale:
Fear & greed scores < 30 = buy area
Fear & greed score > 60 = sell area
Trend Momentum
Exit: At extreme greed with divergence
Enter: At extreme fear with divergence
📊 Market State Classification
Five Primary States:
EXTREME FEAR (BB% <0, RSI <34, Score <34)
FEAR (Score 34-47, bearish momentum)
NEUTRAL (Score 47-70, consolidation)
GREED (Score 70-90, bullish momentum)
EXTREME GREED (Score >90, BB% >100)
State Transitions:
Fear → Neutral: Early accumulation
Neutral → Greed: Trend development
Greed → Extreme Greed: Distribution
Extreme → Reversal: Trend change
🔍 Information Panel Guide
Real-Time Metrics:
FEAR & GREED: Current sentiment score
Market State: Classification and bias
Trend Bias: Bullish/Bearish/Neutral
Confidence: Setup reliability percentage
Momentum: Current directional strength
Volatility: Market condition assessment
Signal Quality: Trade recommendation
Reversal Imminent: Early warning alerts
🌟 Unique Advantages
Psychological Edge:
Quantifies market emotion through multiple indicators
Identifies bubbles before they pop
Provides statistical confidence for each setup
Combines technical extremes with sentiment analysis
Offers clear visual cues for decision making
Professional Features:
Multi-timeframe sentiment analysis
Real-time confidence scoring
Comprehensive alert system
Institutional activity detection
Clear risk/reward visualization
📚 Educational Value
This indicator teaches:
Market psychology cycles
Statistical extreme identification
Multi-indicator confirmation
Risk quantification methods
Professional trade management
Perfect for traders seeking to understand and profit from market sentiment cycles.
Disclaimer: For educational purposes. Trading involves risk. Past performance doesn't guarantee future results.
T3 MACD BB flow What this script does – in plain words
Smoothes the MACD with a special T3 filter, turning the raw MACD into a smoother line so short‑term noise is reduced.
Draws Bollinger‑style bands around that smoothed MACD, giving a “mid line” and upper/lower envelopes that show how far the line is from its recent average.
Colors the main line green when it’s rising and red when it’s falling, helping you see the trend at a glance.
Adds a bold zero line plus light gray markers on the bands so you can spot crossovers easily.
Includes a translucent blue fill between the upper and lower bands for visual emphasis.
This gives a clear, color‑coded view of MACD momentum plus volatility bands—all on the same indicator pane.
Hyperfork Matrix🔱 Hyperfork Matrix 🔱 A manual Andrews Pitchfork tool with action/reaction propagation lines and lattice matrix functionality. This indicator extends Dr. Alan Andrews' and Patrick Mikula's median line methodology by automating the projection of reaction and action lines at equidistant intervals, creating a time-price grid that highlights where pivot levels intersect the matrix.
Three pitchfork variants are supported: Original, Schiff, and Modified Schiff. Each variant adjusts the anchor point position to accommodate different trend angles.
═══════════════════════════════════════════════════════════════
█ THE METHOD
Andrews Pitchfork
Dr. Alan Andrews developed the pitchfork as a trend channel tool. The core principle: price tends to return to the median line roughly 80% of the time. When it fails to reach the median, a reversal may be developing.
A pitchfork requires three pivot points:
• Point A — The anchor (starting pivot)
• Point B — First swing in the opposite direction
• Point C — Second swing, same direction as A
The median line runs from Point A through the midpoint of B-C. Parallel lines through B and C form the channel boundaries.
Action/Reaction Principle
Based on Newton's third law ("action and reaction are equal and opposite"), this principle suggests that price movements elicit proportional reactions in the future. By projecting lines at equal intervals along the pitchfork's slope, we anticipate where these reactions may occur.
Lattice Matrix
The lattice squares pivot price levels to the matrix structure. A horizontal from your selected pivot intersects the pitchfork and propagation lines, with verticals drawn at each intersection. These verticals mark time points where price-time geometry converges—potential areas to watch for trend changes.
═══════════════════════════════════════════════════════════════
█ HOW THE INDICATOR WORKS
This section explains the calculation flow from your inputs to the final drawing.
Step 1 — Pivot Selection
You click on the chart to select three timestamps. The indicator retrieves the high or low price at each timestamp based on your starting pivot type selection:
• Starting with "Low" creates a Low-High-Low pattern
• Starting with "High" creates a High-Low-High pattern
Step 2 — Anchor Calculation
The anchor position depends on your pitchfork variant:
• Original — Anchor stays at Point A
• Schiff — Anchor shifts 50% toward B in price (Y-axis only)
• Modified Schiff — Anchor shifts 50% toward B in both time and price
Step 3 — Median Line
A line is drawn from the anchor through the midpoint of the B-C segment. This median line defines the channel's slope and center.
Step 4 — Parallel Tines
Parallel lines are drawn through Points B and C, maintaining the median line's slope. These form the upper and lower channel boundaries.
Step 5 — Extra Parallels
If configured, additional parallel lines are drawn at equal spacing beyond B and C. The spacing equals the distance from the median to each tine.
Step 6 — Handle Length
The "handle" is the segment from the anchor to the B-C midpoint. This length becomes the unit of measurement for propagation.
Step 7 — Propagation Points
Points are placed along the median line at handle-length intervals:
• Forward points extend into the future
• Backward points extend into the past
Step 8 — Reaction Lines
Through each propagation point, a line is drawn parallel to B-C (the transversal slope). These reaction lines mark time-price zones based on the original swing rhythm, where trend changes may occur.
Step 9 — Action Lines
Through each propagation point, a line is drawn parallel to A-B (the initial move slope). These action lines project the original momentum into future price zones.
Step 10 — Lattice Grid
If enabled, a horizontal line is drawn at the price level of your selected pivot. Vertical lines are then drawn at every intersection between this horizontal and the selected line type (pitchfork, reaction, or action lines).
Step 11 — Alert Monitoring
On each bar, the indicator checks if the price has crossed any of the drawn lines. Crossings trigger alerts based on your configuration.
═══════════════════════════════════════════════════════════════
█ PITCHFORK VARIANTS
Original (Andrews)
The classic pitchfork. The anchor remains at Point A. Best suited for strong trending markets where price respects steep channels.
Schiff
Named after Jerome Schiff, a student of Andrews. The anchor shifts halfway toward Point B in price only—same time position as A, but price is the midpoint of A and B.
This produces a less steep channel, better suited for:
• Shallow trends
• Corrective phases
• Markets where the original pitchfork angle is too aggressive
Modified Schiff
The anchor shifts halfway toward Point B in both time and price—positioned at the midpoint of the A-B segment.
This creates an even gentler slope than the standard Schiff variant. Use when:
• Trends are weak or ranging
• Price doesn't respect steeper channel angles
• You need a middle ground between Original and Schiff
═══════════════════════════════════════════════════════════════
█ ACTION & REACTION LINES
Reaction Lines
These run parallel to the B-C segment (the "transversal"). They represent the market's response rhythm—the swing from B to C sets a pattern that may repeat at predictable intervals.
Action Lines
These run parallel to the A-B segment (the initial impulse). They project the original momentum forward, suggesting where similar price movements may begin or end.
Forward vs Backward
• Forward Lines — Project into the future beyond the B-C midpoint
• Backward Lines — Project into the past before Point A
Most analysis focuses on forward lines, but backward lines can reveal historical confluence with past pivots.
Propagation Spacing
Lines are spaced at equal intervals defined by the handle length (anchor to B-C midpoint). This creates a rhythmic structure where each segment equals the original pitchfork's core measurement.
Action Lines
Reaction Lines
Extra Parallels with/ both Action & Reactions Line extended within the grid
═══════════════════════════════════════════════════════════════
█ LATTICE MATRIX
The lattice creates a grid overlay within the pitchfork structure.
Horizontal Line
A horizontal line is drawn at the price level of your selected pivot (A, B, or C). This squares the pivot's price level to find where it aligns with the matrix structure. These confluences may represent higher-probability reaction points in time.
Vertical Lines
Vertical lines are drawn at every point where the horizontal intersects your selected line source. These verticals mark time points—potential areas to watch for trend changes.
• Pitchfork & Parallels — Intersections with median and all parallel tines
• Action Lines — Intersections with action transversals
• Reaction Lines — Intersections with reaction transversals
• Action & Reaction — Both types combined
Envelope Clamping
Lattice lines are automatically clamped to stay within the pitchfork's channel envelope (bounded by the outermost parallels). This keeps the grid visually clean and focused on relevant areas.
═══════════════════════════════════════════════════════════════
█ ALERTS
The indicator monitors price crossings and triggers alerts when the price moves through any drawn line type.
Available Alert Types
• Pitchfork Lines — Crossing the median or any parallel
• Action Lines — Crossing any action transversal (when action lines are drawn)
• Reaction Lines — Crossing any reaction transversal (when reaction lines are drawn)
• Lattice Horizontal — Crossing the horizontal price level (when lattice is enabled)
• Any Line Crossing — Combined alert for all of the above
Setting Up Alerts
1. Right-click on the indicator or use the alert menu
2. Select "Create Alert."
3. Choose the desired condition from the dropdown
4. Configure notification preferences (pop-up, email, webhook, etc.)
Alert Timing
Alerts trigger once per bar close when a crossing is detected between the previous and current bar's close prices.
═══════════════════════════════════════════════════════════════
█ HOW TO USE
Basic Setup
1. Add the indicator to your chart
2. When prompted, click on three pivot points in sequence: A, B, C
3. Choose starting pivot type: Auto (detects pattern), Low (LHL), or High (HLH)
4. The pitchfork draws automatically
Adjusting the Pitchfork
• Change the variant (Original/Schiff/Modified Schiff) if the angle doesn't suit your trend
• Add extra parallel levels to see where price might react beyond the main channel
• Disable or Adjust price range min/max to hide parallels outside your focus area
Adding Propagation Lines
• Adjust forward offset to add/remove lines beyond auto-extend (0 = to current bar)
• Choose which line types to display: Reaction Only, Action Only, or Both
• Customize colors to distinguish line types visually
Using the Lattice
• Enable "Draw Lattice" in the Lattice settings group
• Select which pivot's price level to use for the horizontal
• Choose the intersection source that matches your analysis style
• Look for time zones where verticals cluster—these may be significant dates
Log Scale Charts
If your chart uses logarithmic scale, enable "Logarithmic Scale" in Pitchfork Settings. This ensures all calculations transform correctly for log price axes.
═══════════════════════════════════════════════════════════════
█ SETTINGS REFERENCE
1. Pivot Points
• Starting Pivot Type — Auto (detect pattern), Low (force LHL), or High (force HLH)
• Pivot A/B/C Time — Timestamps for your three pivots (click to select)
• Show Pivot Labels — Display A, B, C labels at pivot locations
• Pivot Colors — Customize high/low label colors
• Label Size — Tiny, Small, Normal, or Large
2. Pitchfork Settings
• Logarithmic Scale — Enable for log charts
• Pitchfork Type — Original, Schiff, or Modified Schiff
• Extra Parallel Levels — Additional parallels beyond B and C
• Line styling (color, width, style)
• Extend Direction — Right only or Both directions
• Enable Price Range Filter — Toggle filtering of extra parallels
• Price Range Min/Max — Hide extra parallels outside this range
3. Action / Reaction Lines
• Draw Type — None, Reaction Only, Action Only, or Both
• Forward Lines Offset — Adjust from auto-extend (0 = to current bar, positive adds more)
• Backward Lines Count — Number of lines projected before Point A
• Separate styling for reaction and action lines
4. Lattice
• Draw Lattice — Master toggle
• Select Pivot for Horizontal — A, B, or C price level
• Intersection Source — Which lines to use for vertical placement
• Lattice styling
═══════════════════════════════════════════════════════════════
█ LIMITATIONS
• Maximum 500 lines — TradingView limits line objects; complex setups with many parallels and propagation lines may approach this limit
• Manual pivot selection — Pivots must be selected manually via timestamp inputs; no auto-detection
• Log scale requires toggle — You must enable "Logarithmic Scale" manually if your chart uses log axes
• Minor visual drift — Action/Reaction lines may shift slightly when toggling between odd and even extra parallel counts (cosmetic only)
• Backward lines visibility — When adding backward propagation lines, you may need to scroll the chart left for them to render
═══════════════════════════════════════════════════════════════
█ FURTHER READING
For deeper study of pitchfork analysis and action/reaction methodology:
• Patrick Mikula's "The Best Trendline Methods of Alan Andrews and Five New Trendline Techniques"
No affiliation implied. Referenced for educational context only.
═══════════════════════════════════════════════════════════════
█ RELATED
For a video walkthrough of the Super Pitchfork methodology that inspired this indicator:
How to Build a Super Pitchfork with Reaction & Trigger Lines
This tutorial covers manual pitchfork construction, reaction line projection, and timing techniques.
Liquidity Zones (Pivot-based) Buyside/SellsideDescription
This indicator highlights potential liquidity zones based on confirmed swing highs and swing lows (pivot-based logic).
Buyside liquidity zones are drawn above swing highs, where short stops and breakout liquidity are likely to rest.
Sellside liquidity zones are drawn below swing lows, where long stops are typically clustered.
Zones are sized dynamically using ATR-based thickness, extended forward in time, and automatically removed once price trades through them (wick-based or close-based, configurable).
The script is designed to help traders:
Visualize areas where liquidity is likely to be targeted
Anticipate stop hunts and liquidity grabs
Improve timing around reversals, continuations, and range extremes
This tool is not a liquidation heatmap and does not rely on exchange or order book data.
Instead, it provides a price-action–based proxy for liquidity, fully compatible with ICT / SMC-style market structure analysis.
Key features :
-Pivot-based buyside & sellside liquidity zones
-ATR-adjusted zone thickness
-Automatic extension and cleanup of zones
-Adjustable sensitivity and zone limits
-Works on any market and timeframe
Delta Hedging Pressure📊 COT Delta Hedging Pressure – Institutional Sentiment Indicator
This indicator visualizes institutional hedging pressure by aggregating delta-style positioning into a clean, session-aware sentiment framework.
Instead of guessing direction, it shows who is likely hedging vs. pressing, helping traders align intraday execution with higher-timeframe positioning.
🔍 What This Indicator Does
Calculates cumulative hedging pressure using price-based delta logic
Classifies market state into:
Bullish (positive hedge pressure)
Bearish (negative hedge pressure)
Neutral (balanced flow)
Resets cleanly by session or user-defined period
Visualizes sentiment using:
Background shading
Labels
Cumulative plots
🧠 How Traders Use It
Directional bias filter (trade only with sentiment)
Context for FVGs, liquidity raids, and pullbacks
Avoids chop by identifying neutral hedge conditions
Pairs especially well with:
XAUUSD
Index CFDs
Futures / CFD hybrids
⚙️ Key Features
Session-aware cumulative logic
Adjustable sensitivity and lookback
Clean visual design (no clutter)
Non-repainting calculations
Works on 1m → HTF
⚠️ Important Notes
This is a context tool, not a signal generator
Best used alongside price structure and risk management
Designed for discipline and alignment, not overtrading
🎯 Ideal For
Scalpers & intraday traders
Traders using:
Fair Value Gaps (FVG)
Liquidity sweeps
Session-based models
Traders transitioning from prop logic to personal capital
🧩 Final Thought
This indicator answers one question:
“Is the market hedging or pressing — and should I be aggressive or patient?”
If you trade with structure, this keeps you on the right side.
MoneyMakers Scalping Signals1-5 min frame, a versatile market indicator designed to highlight emerging trends and structural shifts in crypto price action before they fully develop. By combining price dynamics, momentum behavior and market context into a clean visual output, it helps traders make more informed decisions without noise or lag. Suitable for both short- and mid-term analysis, the indicator offers a clearer view of potential reversal zones, trend continuations and key market cycles.
eBacktesting - Learning: Cup & HandleeBacktesting - Learning: Cup & Handle
The Cup & Handle is a classic continuation pattern that often appears during strong trends. It shows a market that “cools off” (the cup), then does a smaller pullback (the handle), and may be ready for another push in the original direction.
This indicator helps you spot:
- Potential Cup & Handle formations as they develop
- When a handle forms (the final “pause” before continuation)
- The breakout moment, when price pushes above the rim level
It’s designed to support structured practice: you can replay charts and train your eyes to recognize the pattern, understand the context around it, and build consistent execution rules.
These indicators are built to pair perfectly with the eBacktesting extension, where traders can practice these concepts step-by-step. Backtesting concepts visually like this is one of the fastest ways to learn, build confidence, and improve trading performance.
Educational use only. Not financial advice.
Range Indicator Golden Pocket, Liquidity, FairValueGapOverview
This indicator is a comprehensive institutional market structure toolkit. It is designed to identify high-probability reversal zones by merging three powerful technical analysis concepts: Fibonacci Golden Pockets (61.8% - 65%), Liquidity Pool Analysis (Swing Failure Patterns), and Fair Value Gaps (FVG). By automating the detection of price inefficiencies and "stop runs," it helps traders navigate complex price action with objective, rule-based confirmation.
What the Script Does
The script continuously monitors a user-defined lookback period to define a trading range. Within this range, it dynamically plots:
Golden Pockets: High-confluence retracement zones (calculated as 0.35 - 0.382 internal range levels).
Liquidity Zones: Highlighted regions at the absolute high and low (Top/Bottom 5%) where institutional orders and retail stops are typically concentrated.
Swing Failure Patterns (SFP): Real-time detection of liquidity grabs where price breaches a range extreme but fails to close outside, signaling a potential trap.
Fair Value Gaps (FVG): Visualizes 3-candle price imbalances, showing areas of aggressive buying or selling that often act as future magnets or support/resistance.
2-Candle Confirmation: A momentum-based filter requiring a candle-close confirmation before a reversal signal is generated.
For Whom is it?
Smart Money Concepts (SMC) & ICT Students: Traders looking for automated liquidity sweeps and market inefficiencies.
Fibonacci & Mean Reversion Traders: Those seeking a clean, professional visualization of the Golden Pocket across multiple timeframes.
Systematic Day Traders: Who require strict price-action confirmation (SFP and 2-candle rules) to remove emotional bias from their entries.
Functions and Input Options
1. Market Structure & Visuals
Lookback Period (Default: 100): Defines the window for calculating the range extremes.
Box Offset Right (Default: 50): Extends all zones into the future for better anticipatory trading.
Show Price Lines & Labels: Displays the exact price for every zone boundary on the right axis for precise execution.
2. Fair Value Gap (FVG) Settings
Show Fair Value Gaps: A toggle to enable/disable the plotting of price imbalances.
FVG Extension (Default: 10): Determines how many bars into the future the FVG box remains visible.
Custom Colors: Separate color inputs for Bullish (Gap Up) and Bearish (Gap Down) inefficiencies.
3. Professional Alert System
The script includes five specific alert conditions:
GP Touch: Early warning when price enters a Golden Pocket.
2-Candle Pattern: Confirmed momentum shift within a Golden Pocket.
SFP Long/Short: Alerts when a Liquidity Grab (Swing Failure) is confirmed at the range high or low.
Transparency and Compliance (Moderator Info)
Non-Repainting Logic: All signals (SFP, 2-Candle, and FVG) are calculated and triggered based on confirmed candle closes. Drawings use barstate.islast purely for visual efficiency without altering historical data integrity.
Educational Context: The script visualizes well-known market principles (Fibonacci, SFPs, and FVGs) to aid traders in their analysis; it does not provide automated financial advice or "black-box" buy/sell signals.
Resource Management: Optimized for Pine Script v5, using efficient array and box handling to ensure smooth performance even on lower timeframes.
VIX Option Hedge Monitor# VIX Option Hedge Monitor
Inspired by Cem Karsan
The VIX Option Hedge Monitor is a specialized indicator designed to detect unusual hedging activity in VIX call options that may signal impending market volatility or potential market crashes. By monitoring deep out-of-the-money (OTM) VIX calls that are 1-2weeks out—typically 150-170% OTM with premiums around $0.05-$0.10—this indicator identifies when institutional players are aggressively hedging for tail risk events.
## What It Does
This indicator tracks the intraday percentage change of a specific VIX option contract from its daily opening price and provides two distinct alert levels:
- **🟠 Orange Alert (200%+ increase)**: "Increased Hedging" - Indicates elevated hedging activity
- **🔴 Red Alert (400%+ increase)**: "Crash Imminent" - Suggests extreme hedging behavior often seen before major market dislocations
## Why This Matters
Deep OTM VIX calls are typically used by institutional investors as insurance against severe market crashes. When these options suddenly spike in price, it often indicates that sophisticated market participants are positioning for significant volatility. Historically, extreme spikes in these types of options have preceded major market corrections.
## How to Use
### Initial Setup
1. **Add the Indicator**
- Open TradingView and click on "Indicators" at the top of your chart
- Search for "VIX Option Hedge Monitor"
- Click to add it to your chart
2. **Find Your VIX Option Ticker**
- Go to VIX options chain in TradingView
- Find an expiration date that is more than 1 week out but less than 4 weeks out
- Locate a call strike approximately 168% OTM (these typically trade at $0.05-$0.10)
- Note the exact option ticker symbol (e.g., VIX260121C37.0)
3. **Configure the Indicator**
- Click on the gear icon next to "VIX Option Hedge Monitor" in your indicator list
- In the "VIX Option Symbol" field, paste your option ticker
- Adjust thresholds if desired (default: 200% orange, 400% red)
- Click "OK"
### Setting Up Alerts (Recommended)
1. Click the three dots (⋮) next to the indicator name
2. Select "Add alert on VIX Option Hedge Monitor"
3. Choose your alert condition:
- "Increased Hedging Alert" for the 200% threshold
- "Crash Hedge Behavior Alert" for the 400% threshold
4. Configure how you want to receive alerts (popup, email, SMS, etc.)
5. Click "Create"
### Ongoing Maintenance
**Rolling to New Expiration:**
When your current option is within 7 days of expiration, you'll need to update to a new option:
1. Find a new VIX call option meeting the criteria (1-3 weeks out, ~168% OTM)
2. Open the indicator settings (gear icon)
3. Update the "VIX Option Symbol" field with the new ticker
4. Click "OK"
The indicator will immediately begin tracking the new option.
## Understanding the Display
### Info Table (Top Right)
- **Option**: Current option ticker being monitored
- **Current Price**: Real-time option price
- **Day Open**: Option's opening price for the current trading day
- **% Change**: Percentage increase from day open
- **Status**: Current alert level (Normal, Increased Hedging, or Crash Imminent)
### Chart Elements
- **Blue Line**: Option price movement
- **White Line**: Percentage change from daily open
- **Orange Dashed Line**: 200% threshold marker
- **Red Dashed Line**: 400% threshold marker
- **Triangle Markers**: Appear when thresholds are crossed
- **Background Color**: Changes to orange or red when alerts are triggered
## Settings & Customization
### Adjustable Parameters
**VIX Option Symbol** (Required)
- The exact ticker of the VIX option you want to monitor
- Must be updated manually when rolling to new expirations
- Example: VIX250131C00055000
**Orange Alert Threshold** (Default: 200%)
- Percentage increase from day open to trigger "Increased Hedging" alert
- Adjust higher for fewer false positives or lower for earlier warnings
**Red Alert Threshold** (Default: 400%)
- Percentage increase from day open to trigger "Crash Imminent" alert
- Represents extreme hedging behavior
**Show % Change Line** (Default: On)
- Toggle visibility of the percentage change line
**Show Price Line** (Default: On)
- Toggle visibility of the option price line
## Trading Strategy Considerations
### This Indicator Is:
- A early warning system for potential market volatility
- A tool to monitor institutional hedging behavior
- Most effective when combined with other technical and fundamental analysis
### This Indicator Is NOT:
- A standalone trading signal
- A guarantee of market crashes
- A timing tool (alerts may come hours or days before events)
### Best Practices:
1. **Don't trade solely on this indicator** - Use it as one input among many
2. **Monitor throughout the day** - Set alerts but also check manually
3. **Consider market context** - High VIX environments may see more false signals
4. **Roll options weekly** - Keep your monitored option in the 1-3 week window
5. **Track multiple strikes** - Consider monitoring 2-3 different strikes for confirmation
## Technical Notes
- The indicator uses daily open as the baseline for percentage calculations
- Price data refreshes based on your chart timeframe
- Works best on intraday timeframes (1min - 15min) for quick alerts
- Requires TradingView access to options data for the ticker you specify
## Interpretation Guide
**Normal Operation** (0-199% increase)
- Market functioning normally
- Standard hedging activity
- No action required
**Increased Hedging** (200-399% increase)
- Heightened caution warranted
- Consider reviewing portfolio hedges
- Monitor closely for further escalation
- May indicate near-term volatility concerns
**Crash Imminent** (400%+ increase)
- Extreme hedging activity detected
- Institutional players positioning for severe downside
- Consider defensive positioning
- Review stop losses and portfolio allocation
- Historical precedent suggests elevated crash risk
## Limitations
- Requires manual option ticker updates
- Cannot automatically select optimal strikes
- Low liquidity options may show erratic price movements
- False signals possible during high volatility periods
- Past performance does not guarantee future results
## Support & Updates
For questions, suggestions, or to report issues, please leave a comment on the indicator page.
## Disclaimer
This indicator is for informational and educational purposes only. It does not constitute financial advice, investment recommendations, or trading signals. Always conduct your own research and consult with a qualified financial advisor before making investment decisions. Options trading carries significant risk and may not be suitable for all investors.
---
**Version**: 1.0
**Last Updated**: January 2026
**Compatible With**: TradingView Pine Script v5
eBacktesting - Learning: Head & ShoulderseBacktesting - Learning: Head & Shoulders
Head & Shoulders is one of the most recognizable reversal patterns in day trading. It helps you spot moments when a trend may be losing strength and a turn becomes more likely—often around a “neckline” level where the market either breaks and continues the reversal, or holds and keeps trending.
This indicator highlights both:
- Head & Shoulders (bearish): potential shift from bullish strength to bearish reversal
- Inverse Head & Shoulders (bullish): potential shift from bearish strength to bullish reversal
It marks the structure on the chart (left shoulder, head, right shoulder) and flags the moment the pattern is confirmed, so you can practice reading the story behind price action instead of guessing.
These indicators are built to pair perfectly with the eBacktesting extension, where traders can practice these concepts step-by-step. Backtesting concepts visually like this is one of the fastest ways to learn, build confidence, and improve trading performance.
Educational use only. Not financial advice.






















