AlgebraLibrary "Algebra"
line_fromXy(x1, y1, x2, y2)
Get line slope and y-intercept from coordinates
Parameters:
x1 (int) : x coordinate 1 (int - bar index)
y1 (float) : y coordinate 1 (float - price/value)
x2 (int) : x coordinate 2 (int - bar index)
y2 (float) : y coordinate 2 (float - price/value)
Returns: of line
line_getPrice(x, slope, yInt)
Get price at X coordinate, given line slope and y-intercept
Parameters:
x (int) : x coordinate to solve for y (int - bar index)
slope (float) : slope of line (float)
yInt (float) : y-intercept of line (float)
Returns: y (price/value)
line_getPrice_fromXy(x, x1, y1, x2, y2)
Get price at X coordinate, given two points on a line
Parameters:
x (int) : x coordinate to solve for y (int - bar index)
x1 (int) : x coordinate 1 (int - bar index)
y1 (float) : y coordinate 1 (float - price/value)
x2 (int) : x coordinate 2 (int - bar index)
y2 (float) : y coordinate 2 (float - price/value)
Returns: y (price/value)
line_getRtSides(x1, y1, x2, y2, l)
Get length of sides of a right triangle formed by a given line
Parameters:
x1 (int) : x coordinate 1 (int - optional, required if argument l is not specified)
y1 (float) : y coordinate 1 (float - optional, required if argument l is not specified)
x2 (int) : x coordinate 2 (int - optional, required if argument l is not specified)
y2 (float) : y coordinate 2 (float - optional, required if argument l is not specified)
l (line) : line object (line - optional, required if x1, y1, x2, y2 agruments are not specified)
Returns:
line_length(x1, y1, x2, y2, l)
Get length of line, given a line object or two sets of coordinates
Parameters:
x1 (int) : x coordinate 1 (int - optional, required if argument l is not specified)
y1 (float) : y coordinate 1 (float - optional, required if argument l is not specified)
x2 (int) : x coordinate 2 (int - optional, required if argument l is not specified)
y2 (float) : y coordinate 2 (float - optional, required if argument l is not specified)
l (line) : line object (line - optional, required if x1, y1, x2, y2 agruments are not specified)
Returns: length of line (float)
指標和策略
FibonacciLibrary "Fibonacci"
General Fibonacci functions. Get fib numbers, ratios, etc.
fib_derived(f, precision)
Get the precise Fibonacci ratio, to the specified number of decimal places
Parameters:
f (float) : Fibonacci ratio (string, in form #.###)
precision (simple int) : Number of decimal places (optional int, dft = 16, max = 32)
Returns: Precise Fibonacci ratio (float)
* Deprecated (use fib_precise() instead), but keeping it here for science / experimenting with derivations
fib_precise(f, precision)
Get the precise Fibonacci ratio, to the specified number of decimal places
Parameters:
f (float) : Fibonacci ratio (string, in form #.###)
precision (simple int) : Number of decimal places (optional int, dft = 16, max = 16)
Returns: Precise Fibonacci ratio (float)
fib_from_string(r)
Get fib ratio value from string
Parameters:
r (string) : Fib ratio string (e.g. ".618")
Returns: Fibonacci ratio value (float)
fib_n(n)
Calculate the Nth number in the Fibonacci sequence
Parameters:
n (int) : Index/number in sequence (int)
Returns: Fibonacci number (int)
UtilitiesLibrary "Utilities"
General utilities
print_series(s, skip_na, position, show_index, from_index, to_index)
Print series values
Parameters:
s (string) : Series (string)
skip_na (simple bool) : Flag to skip na values (optional bool, dft = false)
position (simple string) : Position to print the Table (optional string, dft = position.bottom_center)
show_index (simple bool) : Flag to show series indices (optional bool, dft = true)
from_index (int) : First index to print (optional int, dft = 0)
to_index (int) : Last index to print (optional int, dft = last_bar_index)
Returns: Table object, if series was printed
print(v, position, at_index)
Print value
Parameters:
v (string) : Value (string)
position (simple string) : Position to print the Table (optional string, dft = position.bottom_center)
at_index (int) : Index at which to print (optional int, dft = bar_index)
Returns: Table object, if value was printed
print(v, position, at_index)
Print value
Parameters:
v (int) : Value (int)
position (simple string) : Position to print the Table (optional string, dft = position.bottom_center)
at_index (int) : Index at which to print (optional int, dft = bar_index)
Returns: Table object, if value was printed
print(v, position, at_index)
Print value
Parameters:
v (float) : Value (float)
position (simple string) : Position to print the Table (optional string, dft = position.bottom_center)
at_index (int) : Index at which to print (optional int, dft = bar_index)
Returns: Table object, if value was printed
print(v, position, at_index)
Print value
Parameters:
v (bool) : Value (bool)
position (simple string) : Position to print the Table (optional string, dft = position.bottom_center)
at_index (int) : Index at which to print (optional int, dft = bar_index)
Returns: Table object, if value was printed
boolToIntArr(a)
return array of offsets (int) of true values
Parameters:
a (array)
intToBoolArr(a, n)
Parameters:
a (array)
n (int)
ارتداد من القاع فلتر ارتداد من القاع مع ملاحظة انه يعمل كتنبيه في القائمة
Bottom bounce filter, note that it works as an alert in the menu
EV/FCFThis script in the 6 version of Pine brings you the most accurate multiple of "fundamental valuation" in my opinion. EV/FCF gives you a real metric of how profitable is the company in this exact moment and also if the company is overvaluated or undervaluated.
Confluence AutoEntry (1m/5m/15m) for Alertatron//@version=5
indicator("Confluence AutoEntry (1m/5m/15m) for Alertatron", overlay=true, max_lines_count=500, max_labels_count=500)
// =========================
// 参数
// =========================
tf1 = input.timeframe("1", "周期-1")
tf2 = input.timeframe("5", "周期-2")
tf3 = input.timeframe("15", "周期-3")
ema1 = input.int(10, "EMA1")
ema2 = input.int(30, "EMA2")
ema3 = input.int(60, "EMA3")
rLen = input.int(14, "RSI 长度")
thr1 = input.int(60, "阈值-周期1 (0~100)", minval=0, maxval=100)
thr2 = input.int(60, "阈值-周期2 (0~100)", minval=0, maxval=100)
thr3 = input.int(60, "阈值-周期3 (0~100)", minval=0, maxval=100)
// 下单资金(USDT)
usdtPerTrade = input.float(500, "每次下单金额(USDT)", step=5)
// 下单类型(市价/限价)
orderType = input.string("market", "下单类型", options= , tooltip="market=市价;limit=限价(使用 entry 作为限价)")
// 两步延续触发
useTwoStep = input.bool(true, "启用两步延续触发", tooltip="收盘仅“武装”,下一根或后续“延续突破”才真正发单;关闭=收盘即发一次信号")
bufferPct = input.float(0.08, "延续触发缓冲(%)", step=0.01, tooltip="突破需要超过武装价的百分比")
armBars = input.int(1, "武装有效bar数", minval=1, tooltip="超时未触发则自动取消武装")
// 可选:在 JSON 中附带 token
attachToken = input.bool(false, "在 JSON 中附带 token 字段")
longToken = input.string("", "多头 token(可留空)")
shortToken = input.string("", "空头 token(可留空)")
// 图形显示
showShapes = input.bool(true, "图表显示三角/武装/触发标记")
showTriggerLabel = input.bool(true, "触发时显示【入场/TP/SL/Qty】标签")
// 「平衡」展示用 TP/SL 百分比(仅用于标签展示,不发到 Alertatron)
tpPct = input.float(2.0, "展示用:TP百分比(%)")
slPct = input.float(1.0, "展示用:SL百分比(%)")
// =========================
// 工具函数
// =========================
f_score(tf) =>
_c = request.security(syminfo.tickerid, tf, close, barmerge.gaps_off, barmerge.lookahead_off)
_e1 = request.security(syminfo.tickerid, tf, ta.ema(close, ema1), barmerge.gaps_off, barmerge.lookahead_off)
_e2 = request.security(syminfo.tickerid, tf, ta.ema(close, ema2), barmerge.gaps_off, barmerge.lookahead_off)
_e3 = request.security(syminfo.tickerid, tf, ta.ema(close, ema3), barmerge.gaps_off, barmerge.lookahead_off)
_r = request.security(syminfo.tickerid, tf, ta.rsi(close, rLen), barmerge.gaps_off, barmerge.lookahead_off)
_m = request.security(syminfo.tickerid, tf, ta.sma(ta.change(close), 5), barmerge.gaps_off, barmerge.lookahead_off)
_ok1 = _c > _e1 ? 1 : 0
_ok2 = _e1 >= _e2 ? 1 : 0
_ok3 = _e2 >= _e3 ? 1 : 0
_ok4 = _r > 50 ? 1 : 0
_ok5 = _m >= 0 ? 1 : 0
(_ok1 + _ok2 + _ok3 + _ok4 + _ok5) / 5.0 * 100.0
// 价格按最小跳动取整
tickRound(x) =>
syminfo.mintick > 0 ? math.round(x / syminfo.mintick) * syminfo.mintick : x
// 数字 -> 价格串
sPrice(x) =>
str.tostring(x, format.mintick)
// 小数点四舍五入(用于数量展示)
roundN(x, n) =>
_f = math.pow(10.0, n)
math.round(x * _f) / _f
sQty(x) =>
str.tostring(roundN(x, 6))
// 去掉交易所前缀和 .P 后缀,得到 BASEQUOTE(如 ETHUSDC)
cleanSymbol() =>
_s = syminfo.ticker
_arr = str.split(_s, ":")
_last = array.get(_arr, array.size(_arr) - 1)
str.replace_all(_last, ".P", "")
// =========================
// 多周期评分 -> 一致方向
// =========================
score1 = f_score(tf1)
score2 = f_score(tf2)
score3 = f_score(tf3)
dir1 = score1 >= thr1 ? 1 : -1
dir2 = score2 >= thr2 ? 1 : -1
dir3 = score3 >= thr3 ? 1 : -1
conf_long = dir1 == 1 and dir2 == 1 and dir3 == 1
conf_short = dir1 == -1 and dir2 == -1 and dir3 == -1
// =========================
// 两步法:收盘“武装” + 下一根/后续“延续触发”
// =========================
var bool armLong = false
var float armLongPx = na
var int armLongUntil = na
var bool armShort = false
var float armShortPx = na
var int armShortUntil = na
if barstate.isconfirmed
if conf_long
armLong := true
armLongPx := close
armLongUntil := bar_index + armBars
if conf_short
armShort := true
armShortPx := close
armShortUntil := bar_index + armBars
longTrigPrice = armLong ? armLongPx * (1 + bufferPct/100.0) : na
shortTrigPrice = armShort ? armShortPx * (1 - bufferPct/100.0) : na
triggerLong = useTwoStep ? (armLong and high >= longTrigPrice) : (barstate.isconfirmed and conf_long)
triggerShort = useTwoStep ? (armShort and low <= shortTrigPrice) : (barstate.isconfirmed and conf_short)
// 触发后立刻卸载武装;超时未触发亦卸载
if triggerLong
armLong := false
if triggerShort
armShort := false
if bar_index > armLongUntil
armLong := false
if bar_index > armShortUntil
armShort := false
// =========================
// 发单用价位(在触发时会被使用)
// =========================
float entryL = tickRound(useTwoStep ? longTrigPrice : close)
float entryS = tickRound(useTwoStep ? shortTrigPrice : close)
float tpL = tickRound(entryL * (1 + tpPct/100.0))
float slL = tickRound(entryL * (1 - slPct/100.0))
float tpS = tickRound(entryS * (1 - tpPct/100.0))
float slS = tickRound(entryS * (1 + slPct/100.0))
// —— 展示标签直接使用上面算好的 entryL/entryS/tpL/slL/tpS/slS
if showTriggerLabel and barstate.isconfirmed
if triggerLong
_txt = "LONG Entry: " + sPrice(entryL) + " TP: " + sPrice(tpL) + " SL: " + sPrice(slL) + " EstQty: " + sQty(usdtPerTrade/entryL)
label.new(bar_index, low, text=_txt, style=label.style_label_up, textcolor=color.white, color=color.new(color.lime, 0))
if triggerShort
_txt = "SHORT Entry: " + sPrice(entryS) + " TP: " + sPrice(tpS) + " SL: " + sPrice(slS) + " EstQty: " + sQty(usdtPerTrade/entryS)
label.new(bar_index, high, text=_txt, style=label.style_label_down, textcolor=color.white, color=color.new(color.red, 0))
// ============ 构造 JSON(按方向用不同 signal 名,所有数值写入) ============
buildMsg(_side, _entry, _tp, _sl) =>
_sig = _side == "buy" ? "open_long" : "open_short"
_token = attachToken ? ',"token":"' + (_side == "buy" ? longToken : shortToken) + '"' : ""
_msg = '{"signal":"' + _sig + '"'
_msg := _msg + ',"side":"' + _side + '"'
_msg := _msg + ',"symbol":"' + cleanSymbol() + '"'
_msg := _msg + ',"order_type":"market"'
_msg := _msg + ',"usdt_per_trade":' + str.tostring(usdtPerTrade)
_msg := _msg + ',"entry":' + sPrice(_entry)
_msg := _msg + ',"tp":' + sPrice(_tp)
_msg := _msg + ',"sl":' + sPrice(_sl)
_msg := _msg + _token + "}"
_msg
msgLong = buildMsg("buy", entryL, tpL, slL)
msgShort = buildMsg("sell", entryS, tpS, slS)
// =========================
// 报警 & 发单(在 TradingView 里选择 Any alert() function call;Webhook 填机器人 URL;Message 留空)
// =========================
alertcondition(triggerLong, title="多仓开仓(…)", message="LONG")
alertcondition(triggerShort, title="空仓开仓(…)", message="SHORT")
if barstate.isconfirmed
if triggerLong
alert(message = msgLong, freq = alert.freq_once_per_bar_close)
if triggerShort
alert(message = msgShort, freq = alert.freq_once_per_bar_close)
// =========================
// 可视化:形态+触发线
// =========================
plotshape(showShapes and conf_long and barstate.isconfirmed, title="收盘-多武装", style=shape.triangleup, color=color.new(color.green, 0), size=size.tiny, text="ARM L", location=location.belowbar)
plotshape(showShapes and conf_short and barstate.isconfirmed, title="收盘-空武装", style=shape.triangledown, color=color.new(color.red, 0), size=size.tiny, text="ARM S", location=location.abovebar)
plotshape(showShapes and triggerLong, title="触发-开多", style=shape.labelup, color=color.new(color.lime, 0), text="▶ LONG", location=location.belowbar, size=size.tiny)
plotshape(showShapes and triggerShort, title="触发-开空", style=shape.labeldown, color=color.new(color.maroon,0), text="▶ SHORT", location=location.abovebar, size=size.tiny)
plot(useTwoStep and armLong ? armLongPx : na, "武装价-L", color=color.new(color.green, 70), style=plot.style_circles, linewidth=1)
plot(useTwoStep and armShort ? armShortPx : na, "武装价-S", color=color.new(color.red, 70), style=plot.style_circles, linewidth=1)
plot(useTwoStep ? longTrigPrice : na, "触发线-L", color=color.new(color.lime, 0), style=plot.style_linebr, linewidth=1)
plot(useTwoStep ? shortTrigPrice : na, "触发线-S", color=color.new(color.maroon, 0), style=plot.style_linebr, linewidth=1)
// =========================
// 可视化:触发时弹出【入场/TP/SL/Qty】标签(仅展示用)
// =========================
if showTriggerLabel and barstate.isconfirmed
if triggerLong
_qtyL = usdtPerTrade > 0 and entryL > 0 ? (usdtPerTrade / entryL) : na
_txtL = "LONG Entry: " + sPrice(entryL) + " TP: " + sPrice(tpL) + " SL: " + sPrice(slL) + " EstQty: " + sQty(_qtyL)
label.new(bar_index, low, text=_txtL, style=label.style_label_up, textcolor=color.white, color=color.new(color.lime, 0))
if triggerShort
_qtyS = usdtPerTrade > 0 and entryS > 0 ? (usdtPerTrade / entryS) : na
_txtS = "SHORT Entry: " + sPrice(entryS) + " TP: " + sPrice(tpS) + " SL: " + sPrice(slS) + " EstQty: " + sQty(_qtyS)
label.new(bar_index, high, text=_txtS, style=label.style_label_down, textcolor=color.white, color=color.new(color.red, 0))
Macros Kill Zones Fusionadas (:20 - :40) / :50 - :10)//@version=6
indicator("Macros Kill Zones Fusionadas (:20 - :40) / :50 - :10)", overlay=true, max_lines_count=500, max_labels_count=500, max_boxes_count=500)
// =======================
// === CONFIGURACIÓN ===
showLines = input.bool(true, "Mostrar líneas verticales")
showShading = input.bool(false, "Sombreado opcional")
shadeColor = input.color(color.new(color.gray, 85), "Color sombreado")
lineColor = color.new(color.gray, 50)
lineWidth = input.int(1, "Grosor líneas", 1, 3)
lookbackBars = input.int(200, "Lookback", 20, 2000)
// Calcular extremos del gráfico
ht = ta.highest(high, lookbackBars)
lt = ta.lowest(low, lookbackBars)
yTop = ht * 1.02
yBot = lt * 0.98
// Hora local en minutos
local_min = hour * 60 + minute
// =======================
// === MACROS ACTIVAS POR DEFECTO ===
m0 = input.bool(false,"12:20am a 12:40am")
m1 = input.bool(false,"1:20am a 1:40am")
m2 = input.bool(true, "2:20am a 2:40am")
m3 = input.bool(true, "3:20am a 3:40am")
m4 = input.bool(true, "4:20am a 4:40am")
m5 = input.bool(false,"5:20am a 5:40am")
m6 = input.bool(false,"6:20am a 6:40am")
m7 = input.bool(true, "7:20am a 7:40am")
m8 = input.bool(true, "8:20am a 8:40am")
m9 = input.bool(true, "9:20am a 9:40am")
m10 = input.bool(true, "10:20am a 10:40am")
m11 = input.bool(false,"11:20am a 11:40am")
m12 = input.bool(false,"12:20pm a 12:40pm")
m13 = input.bool(false,"1:20pm a 1:40pm")
m14 = input.bool(false,"2:20pm a 2:40pm")
m15 = input.bool(false,"3:20pm a 3:40pm")
m16 = input.bool(false,"4:20pm a 4:40pm")
m17 = input.bool(false,"5:20pm a 5:40pm")
m18 = input.bool(false,"6:20pm a 6:40pm")
m19 = input.bool(false,"7:20pm a 7:40pm")
m20 = input.bool(false,"8:20pm a 8:40pm")
m21 = input.bool(false,"9:20pm a 9:40pm")
m22 = input.bool(false,"10:20pm a 10:40pm")
m23 = input.bool(false,"11:20pm a 11:40pm")
// =======================
// === FUNCIÓN DE DIBUJO AJUSTADA ===
f_drawLines(on, startHour) =>
startMin = startHour * 60 + 20
endMin = startHour * 60 + 40
inRange = local_min >= startMin and local_min <= endMin // incluir minuto :40
if on and showLines
if local_min == startMin or local_min == endMin // dibujar línea exacta inicio y fin
line.new(bar_index, yTop, bar_index, yBot, xloc=xloc.bar_index, color=lineColor, width=lineWidth)
inRange
// =======================
// === CHEQUEO DE MACROS ACTIVAS ===
in_any_macro = f_drawLines(m0,0) or f_drawLines(m1,1) or f_drawLines(m2,2) or f_drawLines(m3,3) or
f_drawLines(m4,4) or f_drawLines(m5,5) or f_drawLines(m6,6) or f_drawLines(m7,7) or
f_drawLines(m8,8) or f_drawLines(m9,9) or f_drawLines(m10,10) or f_drawLines(m11,11) or
f_drawLines(m12,12) or f_drawLines(m13,13) or f_drawLines(m14,14) or f_drawLines(m15,15) or
f_drawLines(m16,16) or f_drawLines(m17,17) or f_drawLines(m18,18) or f_drawLines(m19,19) or
f_drawLines(m20,20) or f_drawLines(m21,21) or f_drawLines(m22,22) or f_drawLines(m23,23)
// =======================
// === SOMBREADO OPCIONAL ===
bgcolor(showShading and in_any_macro ? shadeColor : na)
// =======================
// === INDICADOR 2: Macro :50 - :10 ===
// =======================
//#region
var line EXT = array.new_line()
var label LBL = array.new_label()
oneDayMS = 86400000
oneBarMS = time_close - time
noColor = color.new(#ffffff, 100)
// Ajuste de línea sobre vela
one = ta.highest(timeframe.in_seconds("15") / timeframe.in_seconds(timeframe.period)) + syminfo.mintick * 10
y_btm_Line1 = one
y_top_Line1 = one + syminfo.mintick * 5
//#region
_macroC = input.color(color.new(color.gray, 60), title="Macro Color", inline='main')
_mode = input.string("On Chart", title="", inline='main', options= )
_showL = input.bool(true, title="Macro Label?", inline='sh')
_mTxt = input.bool(true, title="Show Time?", inline='sh')
_extt = input.bool(false, title="Macro Projections?", inline='sh')
_bgm = input.color(color.new(#4caf50, 70), title="Macro Color", inline='bc')
//#endregion
//#region
time_isMacro(int H_start, int M_start, int H_end, int M_end) =>
h = hour(time, "America/New_York")
m = minute(time, "America/New_York")
h == H_start ? (H_start != H_end ? m >= M_start : m >= M_start and m < M_end) : (h > H_start ? (h == H_end ? m < M_end : h < H_end) : false)
_controlMacroLine(line _lines, label _lbl, bool _time) =>
if _time
_lbl.last().set_x(math.round(math.avg(_lines.get(_lines.size() - 2).get_x1(), time)))
if high > _lines.last().get_y2() - syminfo.mintick * 10
_lines.get(_lines.size() - 2).set_y2(high + (syminfo.mintick * 10))
_lines.last().set_y1(high + (syminfo.mintick * 10))
_lines.last().set_y2(high + (syminfo.mintick * 10))
LBL.last().set_y(high + (syminfo.mintick * 10))
if na(_lines.last().get_x2()) or _lines.last().get_x2() == time
_lines.last().set_x2(time + oneBarMS)
method memoryCleanLine(line A) =>
if A.size() > 300
for i = 0 to 3
A.shift().delete()
method memoryCleanLabel(label A) =>
if A.size() > 100
A.shift().delete()
macroOC(line LINES, bool _time, string _kzTime, bool _friday) =>
dly = _friday ? oneDayMS * 3 : oneDayMS
_txt = _mTxt ? _kzTime : ""
if not _time and _time
_vline1 = line.new(time, y_btm_Line1, time, y_top_Line1, xloc=xloc.bar_time, color=_macroC, width=1)
LINES.push(_vline1)
_hline = line.new(time, y_top_Line1, time + oneBarMS, y_top_Line1, xloc=xloc.bar_time, color=_macroC, width=1)
LINES.push(_hline)
if _extt
EXT.push(line.new(time, high, time, _vline1.get_y2(), xloc=xloc.bar_time, color=_macroC, style=line.style_dotted))
if _mode == "On Chart"
LBL.push(label.new(time,
LINES.get(LINES.size() - 2).get_y2(),
_showL ? _txt : "",
xloc=xloc.bar_time,
style=label.style_label_down,
color=noColor,
textcolor=_macroC,
size=size.small))
if _time and not _time and LINES.size() > 0
_vline2 = line.new(time, y_btm_Line1, time, y_top_Line1, xloc=xloc.bar_time, color=_macroC, width=1)
LBL.last().set_x(math.round(math.avg(LINES.get(LINES.size() - 2).get_x1(), time)))
if y_top_Line1 > LINES.get(LINES.size() - 2).get_y2()
LINES.get(LINES.size() - 2).set_y2(y_top_Line1)
LINES.last().set_y1(y_top_Line1)
LINES.last().set_y2(y_top_Line1)
LBL.last().set_y(y_top_Line1)
else if y_top_Line1 < LINES.get(LINES.size() - 2).get_y2()
_vline2.set_y2(LINES.get(LINES.size() - 2).get_y2())
if _extt
EXT.push(line.new(time, high, time, _vline2.get_y2(), xloc=xloc.bar_time, color=_macroC, style=line.style_dotted))
LINES.push(_vline2)
if LINES.size() > 0 and LBL.size() > 0
_controlMacroLine(LINES, LBL, _time)
//#endregion
//#region
// Declaración de los 24 intervalos cronológicos
var line _LINES1 = array.new_line()
var line _LINES2 = array.new_line()
var line _LINES3 = array.new_line()
var line _LINES4 = array.new_line()
var line _LINES5 = array.new_line()
var line _LINES6 = array.new_line()
var line _LINES7 = array.new_line()
var line _LINES8 = array.new_line()
var line _LINES9 = array.new_line()
var line _LINES10 = array.new_line()
var line _LINES11 = array.new_line()
var line _LINES12 = array.new_line()
var line _LINES13 = array.new_line()
var line _LINES14 = array.new_line()
var line _LINES15 = array.new_line()
var line _LINES16 = array.new_line()
var line _LINES17 = array.new_line()
var line _LINES18 = array.new_line()
var line _LINES19 = array.new_line()
var line _LINES20 = array.new_line()
var line _LINES21 = array.new_line()
var line _LINES22 = array.new_line()
var line _LINES23 = array.new_line()
var line _LINES24 = array.new_line()
// Inputs de activación
show1 = input.bool(false, title="00:50 - 01:10")
show2 = input.bool(false, title="01:50 - 02:10")
show3 = input.bool(true, title="02:50 - 03:10")
show4 = input.bool(true, title="03:50 - 04:10")
show5 = input.bool(false, title="04:50 - 05:10")
show6 = input.bool(false, title="05:50 - 06:10")
show7 = input.bool(false, title="06:50 - 07:10")
show8 = input.bool(true, title="07:50 - 08:10")
show9 = input.bool(true, title="08:50 - 09:10")
show10 = input.bool(true, title="09:50 - 10:10")
show11 = input.bool(false, title="10:50 - 11:10")
show12 = input.bool(false, title="11:50 - 12:10")
show13 = input.bool(false, title="12:50 - 13:10")
show14 = input.bool(false, title="13:50 - 14:10")
show15 = input.bool(false, title="14:50 - 15:10")
show16 = input.bool(false, title="15:50 - 16:10")
show17 = input.bool(false, title="16:50 - 17:10")
show18 = input.bool(false, title="17:50 - 18:10")
show19 = input.bool(false, title="18:50 - 19:10")
show20 = input.bool(false, title="19:50 - 20:10")
show21 = input.bool(false, title="20:50 - 21:10")
show22 = input.bool(false, title="21:50 - 22:10")
show23 = input.bool(false, title="22:50 - 23:10")
show24 = input.bool(false, title="23:50 - 00:10")
// Tiempos
time1 = time_isMacro(0,50,1,10)
time2 = time_isMacro(1,50,2,10)
time3 = time_isMacro(2,50,3,10)
time4 = time_isMacro(3,50,4,10)
time5 = time_isMacro(4,50,5,10)
time6 = time_isMacro(5,50,6,10)
time7 = time_isMacro(6,50,7,10)
time8 = time_isMacro(7,50,8,10)
time9 = time_isMacro(8,50,9,10)
time10 = time_isMacro(9,50,10,10)
time11 = time_isMacro(10,50,11,10)
time12 = time_isMacro(11,50,12,10)
time13 = time_isMacro(12,50,13,10)
time14 = time_isMacro(13,50,14,10)
time15 = time_isMacro(14,50,15,10)
time16 = time_isMacro(15,50,16,10)
time17 = time_isMacro(16,50,17,10)
time18 = time_isMacro(17,50,18,10)
time19 = time_isMacro(18,50,19,10)
time20 = time_isMacro(19,50,20,10)
time21 = time_isMacro(20,50,21,10)
time22 = time_isMacro(21,50,22,10)
time23 = time_isMacro(22,50,23,10)
time24 = time_isMacro(23,50,0,10)
//#region
plotMacro(_show, _LINES, _time, _lbl) =>
if _show
macroOC(_LINES, _time, _lbl, dayofweek(time) == dayofweek.friday and syminfo.type != 'crypto')
plotMacro(show1, _LINES1, time1, "00:50 - 01:10")
plotMacro(show2, _LINES2, time2, "01:50 - 02:10")
plotMacro(show3, _LINES3, time3, "02:50 - 03:10")
plotMacro(show4, _LINES4, time4, "03:50 - 04:10")
plotMacro(show5, _LINES5, time5, "04:50 - 05:10")
plotMacro(show6, _LINES6, time6, "05:50 - 06:10")
plotMacro(show7, _LINES7, time7, "06:50 - 07:10")
plotMacro(show8, _LINES8, time8, "07:50 - 08:10")
plotMacro(show9, _LINES9, time9, "08:50 - 09:10")
plotMacro(show10, _LINES10, time10, "09:50 - 10:10")
plotMacro(show11, _LINES11, time11, "10:50 - 11:10")
plotMacro(show12, _LINES12, time12, "11:50 - 12:10")
plotMacro(show13, _LINES13, time13, "12:50 - 13:10")
plotMacro(show14, _LINES14, time14, "13:50 - 14:10")
plotMacro(show15, _LINES15, time15, "14:50 - 15:10")
plotMacro(show16, _LINES16, time16, "15:50 - 16:10")
plotMacro(show17, _LINES17, time17, "16:50 - 17:10")
plotMacro(show18, _LINES18, time18, "17:50 - 18:10")
plotMacro(show19, _LINES19, time19, "18:50 - 19:10")
plotMacro(show20, _LINES20, time20, "19:50 - 20:10")
plotMacro(show21, _LINES21, time21, "20:50 - 21:10")
plotMacro(show22, _LINES22, time22, "21:50 - 22:10")
plotMacro(show23, _LINES23, time23, "22:50 - 23:10")
plotMacro(show24, _LINES24, time24, "23:50 - 00:10")
//#endregion
//#region
_LINES1.memoryCleanLine()
_LINES2.memoryCleanLine()
_LINES3.memoryCleanLine()
_LINES4.memoryCleanLine()
_LINES5.memoryCleanLine()
_LINES6.memoryCleanLine()
_LINES7.memoryCleanLine()
_LINES8.memoryCleanLine()
_LINES9.memoryCleanLine()
_LINES10.memoryCleanLine()
_LINES11.memoryCleanLine()
_LINES12.memoryCleanLine()
_LINES13.memoryCleanLine()
_LINES14.memoryCleanLine()
_LINES15.memoryCleanLine()
_LINES16.memoryCleanLine()
_LINES17.memoryCleanLine()
_LINES18.memoryCleanLine()
_LINES19.memoryCleanLine()
_LINES20.memoryCleanLine()
_LINES21.memoryCleanLine()
_LINES22.memoryCleanLine()
_LINES23.memoryCleanLine()
_LINES24.memoryCleanLine()
EXT.memoryCleanLine()
LBL.memoryCleanLabel()
//#endregion
ATRThis script displays the Average True Range (ATR) value and the ATR as a percentage of the current closing price directly on the main chart as a clean table, with no lines or plots. It allows users to easily monitor both absolute volatility and its relative magnitude, making comparisons across different assets intuitive. The display position is customizable, offering flexibility for personal chart layouts. Ideal for traders seeking quick volatility insights, risk management guidance, or portfolio-wide comparisons.
Quantum Portfolio vs NASDAQ (Base: May 2, 2021)This custom Pine Script indicator tracks and compares the cumulative performance of a multi-asset “Quantum Portfolio” against the NASDAQ 100 benchmark, rebased to a common starting point on May 2, 2021.
Both series are normalized to a base value of 100 on that date, allowing direct visual comparison of percentage growth or decline over time.
Thematic Portfolio: Quantum Computing & Core TechThis indicator tracks the aggregated performance of a curated thematic portfolio representing the Quantum Computing & Core Technology sector.
It combines leading equities and ETFs with predefined weights to reflect a diversified exposure across quantum hardware, AI infrastructure, and semiconductor backbones.
Composition:
Stocks: Rigetti (RGTI), IonQ (IONQ), D-Wave (QBTS), Palantir (PLTR), Intel (INTC), Arqit (ARQQ)
ETFs: BUG, QTUM, SOXX, IHAK
Methodology:
Each component’s normalized performance is weighted according to its strategic importance within the theme (R&D intensity, infrastructure leverage, and hardware dependence). The indicator dynamically aggregates the weighted series to visualize the cumulative return of the quantum computing ecosystem versus traditional benchmarks.
Intended use:
Compare thematic returns vs. S&P 500 or NASDAQ
Identify macro inflection points in the quantum tech narrative
Backtest thematic exposure strategies or structure twin-win / delta-one certificates
Note: This script is for analytical and educational purposes only and does not constitute financial advice.
Simple Moving AveragesIn Pine Script v6, the standard method for plotting indicators is still the plot function, and it should be recognized. However, if you are getting an "Undeclared identifier 'plot'" error, double-check these points:
Make sure your script is still using indicator() (not study()) at the top.
The script must not use indentation or syntax errors that break context.
Confirm Pine Script version is set correctly with //@version=6.
Here is a fully corrected Pine Script v6 template for your moving averages scenario using
3C FractalsIts based on Williams Fractals indicator, but instead of using 5 candles to mark the fractals, it uses only 3.
Momentum Breakout Filter + ATR ZonesMomentum Breakout Filter + ATR Zones - User Guide
What This Indicator Does
This indicator helps you with your MACD + volume momentum strategy by:
Filtering out fake breakouts - Shows ⚠️ warnings when breakouts lack confirmation
Showing clear entry signals - 🚀 LONG and 🔻 SHORT labels when all conditions align
Automatic stop loss & profit targets - Based on ATR (Average True Range)
Visual trend confirmation - Background color + EMA alignment
Signal Types
🚀 LONG Entry Signal (Green Label)
Appears when ALL conditions met:
✅ MACD crosses above signal line
✅ Volume > 1.5× average
✅ Price > EMA 9 > EMA 21 > EMA 200 (bullish trend)
✅ Price closes above recent 20-bar high
🔻 SHORT Entry Signal (Red Label)
Appears when ALL conditions met:
✅ MACD crosses below signal line
✅ Volume > 1.5× average
✅ Price < EMA 9 < EMA 21 < EMA 200 (bearish trend)
✅ Price closes below recent 20-bar low
⚠️ FAKE Breakout Warning (Orange Label)
Appears when price breaks high/low BUT lacks confirmation:
❌ Low volume (below 1.5× average), OR
❌ Wick break only (didn't close through level), OR
❌ MACD not aligned with direction
Hover over the warning label to see what's missing!
ATR Stop Loss & Targets
When you get a signal, colored lines automatically appear:
Long Position
Red solid line = Stop Loss (Entry - 1.5×ATR)
Green dashed lines = Profit Targets:
Target 1: Entry + 2×ATR
Target 2: Entry + 3×ATR
Target 3: Entry + 4×ATR
Short Position
Red solid line = Stop Loss (Entry + 1.5×ATR)
Green dashed lines = Profit Targets:
Target 1: Entry - 2×ATR
Target 2: Entry - 3×ATR
Target 3: Entry - 4×ATR
The lines move with each bar until you exit the position.
Chart Elements
Moving Averages
Blue line = EMA 9 (fast)
Orange line = EMA 21 (medium)
White line = EMA 200 (trend filter)
Volume
Yellow bars = High volume (above threshold)
Gray bars = Normal volume
Background Color
Light green = Bullish trend (all EMAs aligned up)
Light red = Bearish trend (all EMAs aligned down)
No color = Neutral/mixed
MACD (Bottom Pane)
Green/Red columns = MACD Histogram
Blue line = MACD Line
Orange line = Signal Line
Info Dashboard (Bottom Right)
ItemWhat It ShowsVolumeCurrent volume vs average (✓ HIGH or ✗ Low)MACDDirection (BULLISH or BEARISH)TrendEMA alignment (BULL, BEAR, or NEUTRAL)ATRCurrent ATR value in dollarsPositionCurrent position (LONG, SHORT, or NONE)R:RRisk-to-Reward ratio (shows when in position)
How To Use It
Basic Workflow
Wait for setup
Watch for MACD to approach signal line
Volume should be building
Price should be near EMA structure
Get confirmation
Wait for 🚀 LONG or 🔻 SHORT label
Check dashboard shows "✓ HIGH" volume
Verify trend is aligned (green or red background)
Enter the trade
Enter when signal appears
Note your stop loss (red line)
Note your targets (green dashed lines)
Manage the trade
Exit at first target for partial profit
Move stop to breakeven
Trail remaining position
What To Avoid
❌ Don't trade when you see:
⚠️ FAKE labels (wait for confirmation)
Neutral background (no clear trend)
"✗ Low" volume in dashboard
MACD and Trend not aligned
Settings You Can Adjust
Volume Sensitivity
High Volume Threshold: Default 1.5×
Increase to 2.0× for cleaner signals (fewer trades)
Decrease to 1.2× for more signals (more trades)
Fake Breakout Filters
You can toggle these ON/OFF:
Volume Confirmation: Requires high volume
Close Through: Requires candle close, not just wick
MACD Alignment: Requires MACD direction match
Tip: Turn all three ON for highest quality signals
ATR Stop/Target Multipliers
Default settings (conservative):
Stop Loss: 1.5×ATR
Target 1: 2×ATR (1.33:1 R:R)
Target 2: 3×ATR (2:1 R:R)
Target 3: 4×ATR (2.67:1 R:R)
Aggressive traders might use:
Stop Loss: 1.0×ATR
Target 1: 2×ATR (2:1 R:R)
Target 2: 4×ATR (4:1 R:R)
Conservative traders might use:
Stop Loss: 2.0×ATR
Target 1: 3×ATR (1.5:1 R:R)
Target 2: 5×ATR (2.5:1 R:R)
Example Trade Scenarios
Scenario 1: Perfect Long Setup ✅
Stock consolidating near EMA 21
MACD curling up toward signal line
Volume bar turns yellow (high volume)
🚀 LONG label appears
Red stop line and green target lines appear
Result: High probability trade
Scenario 2: Fake Breakout Avoided ✅
Price breaks above resistance
Volume is normal (gray bar)
⚠️ FAKE label appears (hover shows "Low volume")
No entry signal
Price falls back below breakout level
Result: Avoided losing trade
Scenario 3: Premature Entry ❌
MACD crosses up
Volume is high
BUT trend is NEUTRAL (no background color)
No signal appears (trend filter blocks it)
Result: Avoided choppy/sideways market
Quick Reference
Entry Checklist
🚀 or 🔻 label on chart
Dashboard shows "✓ HIGH" volume
Dashboard shows aligned MACD + Trend
Colored background (green or red)
ATR lines visible
No ⚠️ FAKE warning
Exit Strategy
Target 1 (2×ATR): Take 50% profit, move stop to breakeven
Target 2 (3×ATR): Take 25% profit, trail stop
Target 3 (4×ATR): Take remaining profit or trail aggressively
Stop Loss: Exit entire position if hit
Alerts
Set up these alerts:
Long Entry: Fires when 🚀 LONG signal appears
Short Entry: Fires when 🔻 SHORT signal appears
Fake Breakout Warning: Fires when ⚠️ appears (optional)
Tips for Success
Use on 5-minute charts for day trading momentum plays
Only trade high volume stocks ($5-20 range works best)
Wait for full confirmation - don't jump early
Respect the stop loss - it's calculated based on volatility
Scale out at targets - don't hold for home runs
Avoid trading first 15 minutes - let market settle
Best during 10am-11am and 2pm-3pm - peak momentum times
Common Questions
Q: Why didn't I get a signal even though MACD crossed?
A: All conditions must be met - check dashboard for what's missing (likely volume or trend alignment)
Q: Can I use this on any timeframe?
A: Yes, but it's designed for 5-15 minute charts. On daily charts, adjust ATR multipliers higher.
Q: The stop loss seems too tight, can I widen it?
A: Yes, increase "Stop Loss (×ATR)" from 1.5 to 2.0 or 2.5 in settings.
Q: I keep seeing FAKE warnings but price keeps going - what gives?
A: The filter is conservative. You can disable some filters in settings, but expect more false signals.
Q: Can I use this for swing trading?
A: Yes, but use larger timeframes (1H or 4H) and adjust ATR multipliers up (3× for stops, 6-9× for targets).
Volume Surge by MashrabThe "Volume Surge" indicator is like a simple market health checkup. It looks at how much of an asset (like a stock or crypto) is being traded right now and compares it to the recent past. Think of it as a way to quickly see if interest in that asset is suddenly spiking, fading, or staying the same.
The indicator shows this information in an easy-to-read table right on your chart.
How it works:
The indicator keeps track of two main things for you:
Current Volume: The total trading volume over the last "N" days (or whatever time period you choose).
Previous Volume: The total trading volume over the period right before that
Then, it gives you a summary:
The "Ratio" tells you how many times bigger or smaller the current volume is.
The "Percent Change" shows the percentage jump in volume.
How to use it:
This indicator helps you see when something interesting might be happening. Here are a few ways traders use it:
Confirm Breakouts: If a stock breaks above a key price level and the indicator shows a huge volume surge, it’s a stronger signal that the move is real and not a false alarm.
Spot Reversals: If a stock has been trending up but the volume starts to drop off, it could mean the trend is losing steam. A sudden, massive volume surge on a down day might indicate panic selling, which can sometimes happen right before the price turns around.
Check Trend Strength: A healthy trend usually has increasing volume going in the same direction. For example, if a stock is in an uptrend, you want to see lots of volume on the days it goes up.
This indicator isn't a crystal ball, but it's a great tool for understanding the "who" and "how much" behind a price move. It helps you see when a price change is backed by a lot of market activity, which often makes the move more trustworthy.
PDB - RSI Based Buy/Sell signals with 4 MARSI Based Buy/Sell Signals on Price chart + 4 MA System
This indicator plots RSI-based Buy & Sell signals directly on the price chart , combined with a 4-Moving-Average trend filter (20/50/100/200) for higher accuracy and cleaner trade timing.
The signal triggers when RSI reaches user-defined overbought/oversold levels, but unlike a standard RSI, this version plots the signals **on the chart**, not in the RSI window — making entries and exits easier to see in real time.
RSI Levels Are Fully Customizable
The default RSI thresholds are 30 (oversold) and 70 (overbought).
However, you can adjust these to fit your trading style. For example:
> When day trading on the 5–15 min timeframe, I personally use 35 (oversold) and 75 (overbought) to catch moves earlier.
> The example shown in the preview image uses 10-minute timeframe settings.
You can change the RSI levels to trigger signals from **any value you choose**, allowing you to tailor the indicator to scalping, day trading, or swing trading.
4 Moving Averages Included:
20, 50, 100, 200 MAs act as dynamic trend filters so you can:
✔ trade signals only in the direction of trend
✔ avoid false reversals
✔ identify momentum shifts more clearly
Works on all markets and timeframes — crypto, stocks, FX, indices.
5-Year Returns Chart BTCvsSPXvsGOLDvsNVDACompare between thes 4 assets:
BTC
NVDA
SPX
GOLD
With an initial 1000$ investment in the last 5 years each return
Liquidity Grab + RSI Divergence═══════════════════════════════════════════════════════════════
LIQUIDITY GRAB + RSI DIVERGENCE INDICATOR
═══════════════════════════════════════════════════════════════
📌 OVERVIEW
This indicator identifies high-probability reversals by combining:
• Liquidity sweeps (stop hunts)
• RSI divergence confirmation
• Filters false breakouts automatically
═══════════════════════════════════════════════════════════════
🟢 BUY SIGNAL (Green Triangle Up)
REQUIRES BOTH CONDITIONS:
1. Liquidity Grab Below Previous Low
• Price breaks BELOW recent low
• Candle CLOSES ABOVE that low
• Traps sellers who shorted the breakdown
2. Bullish RSI Divergence
• Price: Lower Low (LL)
• RSI: Higher Low (HL)
• Shows weakening downward momentum
➜ Result: Potential bullish reversal
═══════════════════════════════════════════════════════════════
🔴 SELL SIGNAL (Red Triangle Down)
REQUIRES BOTH CONDITIONS:
1. Liquidity Grab Above Previous High
• Price breaks ABOVE recent high
• Candle CLOSES BELOW that high
• Traps buyers who bought the breakout
2. Bearish RSI Divergence
• Price: Higher High (HH)
• RSI: Lower High (LH)
• Shows weakening upward momentum
➜ Result: Potential bearish reversal
═══════════════════════════════════════════════════════════════
📊 VISUAL INDICATORS
Main Signals:
🔺 Large Green Triangle = BUY (Liq Grab + Bullish Div)
🔻 Large Red Triangle = SELL (Liq Grab + Bearish Div)
Reference Levels:
━ Red Line = Previous High Level
━ Green Line = Previous Low Level
Additional Markers (Optional):
○ Small Green Circle = Liquidity grab low only
○ Small Red Circle = Liquidity grab high only
✕ Small Blue Cross = Bullish divergence only
✕ Small Orange Cross = Bearish divergence only
═══════════════════════════════════════════════════════════════
⚙️ SETTINGS
1. Lookback Period (Default: 20)
• Range: 5-100
• Sets how far back to identify previous highs/lows
• Higher = fewer but stronger levels
• Lower = more frequent but weaker levels
2. RSI Length (Default: 14)
• Range: 5-50
• Standard RSI calculation period
• 14 is industry standard
3. RSI Divergence Lookback (Default: 5)
• Range: 3-20
• Controls pivot point sensitivity
• Higher = fewer divergence signals
• Lower = more divergence signals
4. Show Labels (Default: ON)
• Toggle BUY/SELL text labels
• Disable for cleaner chart view
═══════════════════════════════════════════════════════════════
💡 HOW TO USE
Step 1: WAIT FOR CONFIRMATION
• Only trade LARGE TRIANGLE signals
• Ignore small circles/crosses alone
Step 2: CHECK TIMEFRAME
• Best on: 15min, 1H, 4H, Daily
• Avoid: 1min, 5min (too noisy)
Step 3: CONFIRM CONTEXT
• Check overall market trend
• Identify key support/resistance
• Look for confluence with price action
Step 4: ENTRY & RISK MANAGEMENT
• Enter on signal candle close or pullback
• Stop loss below/above the liquidity grab wick
• Target: Previous swing high/low or key levels
• Risk/Reward: Minimum 1:2 ratio
Step 5: SET ALERTS
• Create alert for "BUY Signal"
• Create alert for "SELL Signal"
• Never miss opportunities
═══════════════════════════════════════════════════════════════
✅ BEST PRACTICES
DO:
✓ Use on multiple timeframes for confluence
✓ Combine with support/resistance zones
✓ Wait for both conditions (liq grab + divergence)
✓ Practice on demo account first
✓ Use proper position sizing
DON'T:
✗ Trade every small circle/cross
✗ Use on very low timeframes (<15min)
✗ Ignore overall market context
✗ Trade without stop loss
✗ Risk more than 1-2% per trade
═══════════════════════════════════════════════════════════════
⚠️ IMPORTANT NOTES
• This is a CONFIRMATION tool, not a holy grail
• No indicator is 100% accurate
• Combine with your trading strategy
• Backtest on your preferred instruments
• Adjust parameters for your trading style
• Higher timeframes = more reliable signals
• Always use risk management
═══════════════════════════════════════════════════════════════
🔔 ALERTS INCLUDED
Two alert conditions are built-in:
1. "BUY Signal" - Liquidity Grab + Bullish RSI Divergence
2. "SELL Signal" - Liquidity Grab + Bearish RSI Divergence
═══════════════════════════════════════════════════════════════
📈 RECOMMENDED SETTINGS BY TIMEFRAME
5-15 Min Charts:
• Lookback: 10-15
• RSI Length: 14
• RSI Div Lookback: 3-5
1H-4H Charts:
• Lookback: 20-30
• RSI Length: 14
• RSI Div Lookback: 5-7
Daily Charts:
• Lookback: 30-50
• RSI Length: 14
• RSI Div Lookback: 7-10
═══════════════════════════════════════════════════════════════
Good luck and trade safe! 🚀
Reverse RSI LevelsSimple reverse RSI calculation
As default RSI values 30-50-70 are calculated into price.
This can be used similar to a bollinger band, but has also multiple other uses.
70 RSI works as overbought/resistance level.
50 RSI works as both support and resistance depending on the trend.
30 RSI works as oversold/support level.
Keep in mind that RSI levels can go extreme, specially in Crypto.
I haven't made it possible to adjust the default levels, but I've added 4 more calculations where you can plot reverse RSI calculations of your desired RSI values.
If you're a RSI geek, you probably use RSI quite often to see how high/low the RSI might go before finding a new support or resistance level. Now you can just put the RSI level into on of the 4 slots in the settings and see where that support/resistance level might be on the chart.
Smart Money Concept: FVG Block Filter Smart Money Concept: FVG Block Filter (FVG Block Range vs N Range) with Candle Highlighter
Summary:
Smart Money Concept (SMC): An advanced indicator designed to visualize and filter Fair Value Gaps (FVG) blocks based on their size (Range) compared to the preceding N Range candle movement. It also includes a customizable Candle Highlighter function that marks the specific candle responsible for creating the FVG. The indicator allows full color customization for both blocks and the highlighter, and features clean, label-free charts by default.
Key Features:
FVG Block Detection: Automatically identifies and groups sequential FVG imbalances to form consolidated FVG blocks.
FVG Block Filtering (N Range): Filters blocks based on a user-defined rule, comparing the block's size (Range) to the range of the preceding N candles (e.g., requiring the FVG block to be larger than the range of the previous 6 candles).
Customizable Candle Highlighter: Marks the central candle (B) within the FVG structure (A-B-C) to highlight the source of the price imbalance. Highlighter colors are fully adjustable via inputs.
Visualization Control: Labels are turned OFF by default to keep the chart clean but can be easily enabled via the indicator settings.
Full Color Customization: Allows independent customization of Bullish and Bearish FVG Block colors, Block Transparency, and Bullish/Bearish Highlighter colors.
Keywords:
Smart Money Concept, SMC, Fair Value Gap, FVG, Imbalance, Block Filter, Candle Highlighter, Range.
Simple BOS ScannerThis is a Break of Structure Scanner
It checks whenever there is a break of structure and can be used on the Screener screen
FluxVector Liquidity Universal Trendline FluxVector Liquidity Trendline FFTL
Summary in one paragraph
FFTL is a single adaptive trendline for stocks ETFs FX crypto and indices on one minute to daily. It fires only when price action pressure and volatility curvature align. It is original because it fuses a directional liquidity pulse from candle geometry and normalized volume with realized volatility curvature and an impact efficiency term to modulate a Kalman like state without ATR VWAP or moving averages. Add it to a clean chart and use the colored line plus alerts. Shapes can move while a bar is open and settle on close. For conservative alerts select on bar close.
Scope and intent
• Markets. Major FX pairs index futures large cap equities liquid crypto top ETFs
• Timeframes. One minute to daily
• Default demo used in the publication. SPY on 30min
• Purpose. Reduce false flips and chop by gating the line reaction to noise and by using a one bar projection
• Limits. This is a strategy. Orders are simulated on standard candles only
Originality and usefulness
• Unique fusion. Directional Liquidity Pulse plus Volatility Curvature plus Impact Efficiency drives an adaptive gain for a one dimensional state
• Failure mode addressed. One or two shock candles that break ordinary trendlines and saw chop in flat regimes
• Testability. All windows and gains are inputs
• Portable yardstick. Returns use natural log units and range is bar high minus low
• Protected scripts. Not used. Method disclosed plainly here
Method overview in plain language
Base measures
• Return basis. Natural log of close over prior close. Average absolute return over a window is a unit of motion
Components
• Directional Liquidity Pulse DLP. Measures signed participation from body and wick imbalance scaled by normalized volume and variance stabilized
• Volatility Curvature. Second difference of realized volatility from returns highlights expansion or compression
• Impact Efficiency. Price change per unit range and volume boosts gain during efficient moves
• Energy score. Z scores of the above form a single energy that controls the state gain
• One bar projection. Current slope extended by one bar for anticipatory checks
Fusion rule
Weighted sum inside the energy score then logistic mapping to a gain between k min and k max. The state updates toward price plus a small flow push.
Signal rule
• Long suggestion and order when close is below trend and the one bar projection is above the trend
• Short suggestion and flip when close is above trend and the one bar projection is below the trend
• WAIT is implicit when neither condition holds
• In position states end on the opposite condition
What you will see on the chart
• Colored trendline teal for rising red for falling gray for flat
• Optional projection line one bar ahead
• Optional background can be enabled in code
• Alerts on price cross and on slope flips
Inputs with guidance
Setup
• Price source. Close by default
Logic
• Flow window. Typical range 20 to 80. Higher smooths the pulse and reduces flips
• Vol window. Typical range 30 to 120. Higher calms curvature
• Energy window. Typical range 20 to 80. Higher slows regime changes
• Min gain and Max gain. Raise max to react faster. Raise min to keep momentum in chop
UI
• Show 1 bar projection. Colors for up down flat
Properties visible in this publication
• Initial capital 25000
• Base currency USD
• Commission percent 0.03
• Slippage 5
• Default order size method percent of equity value 3%
• Pyramiding 0
• Process orders on close off
• Calc on every tick off
• Recalculate after order is filled off
Realism and responsible publication
• No performance claims
• Intrabar reminder. Shapes can move while a bar forms and settle on close
• Strategy uses standard candles only
Honest limitations and failure modes
• Sudden gaps and thin liquidity can still produce fast flips
• Very quiet regimes reduce contrast. Use larger windows and lower max gain
• Session time uses the exchange time of the chart if you enable any windows later
• Past results never guarantee future outcomes
Open source reuse and credits
• None
Lump Sum Favorability (SPX & NDX)This indicator provides a visual dashboard to gauge the statistical favorability of deploying a "Lump Sum" investment into the SPX (S&P 500) or NDX (Nasdaq 100).
The primary goal is not to time the exact market bottom, but to identify zones of significant pessimism or euphoria. Historically, periods of indiscriminate selling have represented high-probability entry points for long-term investors.
The dashboard consists of two parts:
1. The Favorability Gauge: A 12-segment gauge that moves from Red (Unfavorable) to Teal (Favorable).
2. The Summary Text: An optional text box (enabled in settings) that provides a plain-English summary of the current market breadth.
---
The Method: Market Breadth
This indicator is not based on the price of the index itself. Price-based indicators (like an RSI on the SPX) can be misleading. In a market-cap-weighted index, a few mega-cap stocks can hold the index price up while the vast majority of "average" stocks are already in a deep bear market.
This tool uses Market Breadth to measure the true, underlying health and participation of the entire market.
How It Works
1. Data Source: The indicator pulls the daily percentage of companies within the selected index (SPX or NDX) that are trading above their 200-day moving average. (Data tickers: S5TH for SPX, NDTH for NDX).
2. Smoothing: This raw data is volatile. To filter out daily noise and confirm a persistent trend, the indicator calculates a 5-day Simple Moving Average (SMA) of this percentage. This is the value used by the indicator.
3. Interpretation:
High Value (>= 50%): More than half of the stocks are above their long-term average. This signifies the market is "Overheated" or in a risk-on phase. The favorability for a new lump sum investment is considered Low.
Low Value (< 50%): Less than half of the stocks are above their long-term average. This signifies "Oversold" conditions or capitulation. These moments historically offer the best favorability for starting a new long-term investment.
---
How to Use the Indicator
1. The Favorability Gauge
The gauge is designed to be intuitive: Red means "Stop/Caution," and Teal means "Go/Opportunity."
Note: The gauge's logic is inverted from the data value to achieve this simplicity.
Red Zone (Left): UNFAVORABLE
This corresponds to a high percentage of stocks being above their 200d MA (>= 50%). The market is considered Overheated, and the favorability for a new lump sum investment is low.
Teal Zone (Right): FAVORABLE
This corresponds to a low percentage of stocks being above their 200d MA (< 50%). The market is considered Oversold, and the favorability for a new lump sum investment is high.
2. The Summary Text
When "Show Summary Text" is enabled in the settings, a box will appear at the top-center of your chart. This box provides a clear, data-driven summary, such as:
"Currently, only 22% of S&P 500 companies are above their 200-day MA. Market is Oversold."
The color of this text will automatically change to match the market state (Red for Overheated, Teal for Oversold), providing instant confirmation of the gauge's reading.
---
Settings
Market: Choose the index to analyze: SPX (S&P 500) or NDX (Nasdaq 100).
Gauge Position: Select where the gauge dashboard should appear on your chart (default is Bottom Right).
Show Summary Text: Toggle the descriptive text box on or off (default is On).
---
This indicator is a statistical and historical guide, not a financial advice or timing signal. It is designed to measure favorability based on past market behavior, not to provide certainty.
Extreme oversold conditions can persist, and markets can always go lower. This tool should be used as one component of a broader investment and risk-management framework. Past performance is not a guarantee of future results.






















