ml_levels Level-quality gates & structure classifiers

The small shared decisions that separate a REAL level event from noise: sweep-vs-break, displacement-confirmed impulse, retest-holds, volume validation, and nearest-level proximity. One vocabulary so “swept”, “broke”, “retested and held” and “validated pivot” mean the same thing across every SMC / order-block / support-resistance script.
Design: pure classifications over the bar geometry / volume you pass — no drawing, no persistent object state (level DETECTION and its box/line lifecycle stay host-side; this library judges the events). Nothing repaints: every read is a function of closed-bar values. Pair each event with a forward test before trusting it.
Concept credit: liquidity sweeps / stop-hunts, break-of-structure, order-block displacement and flip-then-retest are public Smart-Money-Concepts / price-action ideas — this is an original, dependency-free Pine v6 packaging of them. Educational; not financial advice.
Library "ml_levels"
sweepOrBreak(h, l, c, level, side)
Parameters:
h (float)
l (float)
c (float)
level (float)
side (int)
isSweep(h, l, c, level, side)
Parameters:
h (float)
l (float)
c (float)
level (float)
side (int)
isBreak(h, l, c, level, side)
Parameters:
h (float)
l (float)
c (float)
level (float)
side (int)
displacement(o, c, atr, mult)
Parameters:
o (float)
c (float)
atr (float)
mult (simple float)
volValidated(v, smaLen, k)
Parameters:
v (float)
smaLen (simple int)
k (simple float)
retestHolds(h, l, c, level, role, tol)
Parameters:
h (float)
l (float)
c (float)
level (float)
role (int)
tol (float)
nearestLevel(levels, price)
Parameters:
levels (array<float>)
price (float)
nearestDist(levels, price)
Parameters:
levels (array<float>)
price (float)
Design: pure classifications over the bar geometry / volume you pass — no drawing, no persistent object state (level DETECTION and its box/line lifecycle stay host-side; this library judges the events). Nothing repaints: every read is a function of closed-bar values. Pair each event with a forward test before trusting it.
Concept credit: liquidity sweeps / stop-hunts, break-of-structure, order-block displacement and flip-then-retest are public Smart-Money-Concepts / price-action ideas — this is an original, dependency-free Pine v6 packaging of them. Educational; not financial advice.
Library "ml_levels"
sweepOrBreak(h, l, c, level, side)
Parameters:
h (float)
l (float)
c (float)
level (float)
side (int)
isSweep(h, l, c, level, side)
Parameters:
h (float)
l (float)
c (float)
level (float)
side (int)
isBreak(h, l, c, level, side)
Parameters:
h (float)
l (float)
c (float)
level (float)
side (int)
displacement(o, c, atr, mult)
Parameters:
o (float)
c (float)
atr (float)
mult (simple float)
volValidated(v, smaLen, k)
Parameters:
v (float)
smaLen (simple int)
k (simple float)
retestHolds(h, l, c, level, role, tol)
Parameters:
h (float)
l (float)
c (float)
level (float)
role (int)
tol (float)
nearestLevel(levels, price)
Parameters:
levels (array<float>)
price (float)
nearestDist(levels, price)
Parameters:
levels (array<float>)
price (float)
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.