H / L / C+順序,連 open 同 volume 都唔使本席直接對 TradingView 官方開源腳本 Liquidity Sweeps [LuxAlgo](PUB;26391b932d3145879b67deca62305c9a,5,793 B)做詞法掃描,結果如下:
high(最高)、low(最低)、close(收市) 及 bar_index(K 線序號),就可以 100% 原樣復現計算。open(0 次)、volume(0 次)、time(0 次)、跨週期 request.security(0 次)、逐筆 Tick / Level-2 盤口 / 外部 API 均為 0 使用。OHLCV 已經綽綽有餘(只需 H/L/C 按時間順序連續排列,留足前段歷史根數以供 ta.pivothigh(5,5) 初始化)。| 變數/函數 | 輸入來源(邊度嚟) | 掃描次數 | 官方 Pine v5 源碼實際行號與用途 |
|---|---|---|---|
high | 普通 K 線最高價 | 5(含 ta.pivothigh 預設讀 high) | L86 ta.pivothigh(len,len)(2參數重載預設 source=high);L70 框頂;L102/L129 上影線穿刺 high > get.prc;L110 3-bar 點線。 |
low | 普通 K 線最低價 | 5(含 ta.pivotlow 預設讀 low) | L87 ta.pivotlow(len,len)(預設 source=low);L71 框底;L104 3-bar 點線;L109/L122 下影線穿刺 low < get.prc。 |
close | 普通 K 線收市價 | 10 | L97/L102/L107/L109、L117/L122/L127/L129 判真破定收回;L139/L141 判收盤是否穿破方框上下緣(bx.br := true)。 |
bar_index | K 線時間序號(第 N 根) | 3 | L33 n=bar_index;L90/L93 n-len 定位;L112/L132 淘汰 >2000 根舊樞軸;L137 限制方框最多延伸 maxB 根。 |
len, opt, extend, maxB | 靜態用戶設定參數 | L15-26 | len=5、opt='Only Wicks'、extend=true、maxB=300(非行情數據)。 |
open / volume / time / request.security | 無(不讀取) | 全部 0 次 | 整個 5,793 B 源碼零引用。 |
L 33: n = bar_index L 40: int bix // bar_index L 75: y1 = d == 1 ? high : get.prc L 76: y2 = d == 1 ? get.prc : low L 92: ph = ta.pivothigh(len, len) L 93: pl = ta.pivotlow (len, len) L105: if close > get.prc L111: if high > get.prc and close < get.prc L113: get.l(colBr2, 'dt'), lnDot(low, colBr) L116: if close < get.prc L118: if not oW and low < get.prc and close > get.prc L120: get.l(colBl2, 'ds'), lnDot(high, colBl) L130: if close < get.prc L136: if low < get.prc and close > get.prc L138: get.l(colBl2, 'dt'), lnDot(high, colBl) L141: if close > get.prc L143: if not oW and high > get.prc and close < get.prc L145: get.l(colBr2, 'ds'), lnDot(low, colBr) L154: bx.bx.set_right(bar_index) L155: if bx.dr == -1 and close < bx.bx.get_bottom() L157: if bx.dr == 1 and close > bx.bx.get_top ()
透過第三方鏡像 api.fxtwitter.com、cdn.syndication.twimg.com 及 r.jina.ai 實測讀回原帖 JSON/Markdown:
べーた(@foodloss_otoko,ID 1935277322825089024,簡介:「専業トレーダー、EA×裁量で生活してます。」)2026-11-19T17:00:19Z(瀏覽 36,445、讚 279、書籤 451、回覆數 3)entities={},無附圖表截圖或外鏈;結尾標示有續寫串文,但 X 登入牆封鎖回覆讀取,故 3 則回覆內容誠實標明未驗證。マジで全トレーダーに「Liquidity Sweeps」を使ってほしい。 「これブレイクじゃなくてダマシやん」って場所が一瞬で分かる。 俺もずっと使ってるけど、これだけで月+100万ならガチで初心者でもいけそう。 具体的な使い方なんだけど、、、
PUB;26391b932d3145879b67deca62305c9a)由 Wyckoff 的 Spring / Upthrust 與傳統 Swing Failure Pattern (SFP) 發展而來;在 ICT / Smart Money Concepts 中稱波段高點上方止損池為 Buy-Side Liquidity (BSL)、波段低點下方為 Sell-Side Liquidity (SSL)。LuxAlgo 於 2024-02-08 在 TradingView 開源發布 Liquidity Sweeps [LuxAlgo](Pine Script v5,CC BY-NC-SA 4.0),將其規則化為「分形樞軸水平+影線刺穿收回/破位回踩+Sweep Area 延伸方框」。
| 步驟 | 精確公式與條件(高點陣列 aPivH;低點 aPivL 完全鏡像) | 參數與狀態變更 |
|---|---|---|
| 輸入參數 | len = 5(左右各 5 根)、opt = 'Only Wicks'(可選 Outbreaks & Retest / 兩者並用)、extend = true、maxB = 300。 |
均為圖表內建預設值;len 決定流動性層級週期。 |
| Step 1 樞軸建水平 |
ph = ta.pivothigh(high, len, len)、pl = ta.pivotlow(low, len, len)。當 not na(ph),即 high[len] 嚴格高於前後各 5 根時,於 bix = bar_index - len 建立水平 prc = ph。 |
結構上須等右側 5 根收線始建線(無未來函數重繪)。 |
| Step 2A 未破位分支 ( not get.brk) |
① 若 close > P:Only Wicks 模式設 get.mit := true(水平退役);否則設 get.brk := true。② 若允許 Wick 且 not get.wic 且 high > P and close < P:判定看跌 Sweep!畫 [high, P] 紅框、點線、對側 low 處 3 根小點線。 |
aPivL 對稱:close < P 破位/low < P and close > P 判定看漲 Sweep(綠框)。 |
| Step 2B 破位回踩分支 ( get.brk) |
① 若 close < P:設 get.mit := true(回踩失敗)。② 若允許 Retest 且 low < P and close > P:畫 [P, low] 綠框、虛線、設 get.tak := true。 |
年齡 n - get.bix > 2000 或 mit 或 tak 即從活躍陣列移除。 |
| Step 3 方框延伸與結束 |
若 extend 且 not bx.br 且距起點 <= maxB (300):右緣延至 bar_index。終止條件:看漲框 close < box_bottom;看跌框 close > box_top。 |
表示該 Sweep Area 已被後市完全穿透失效。 |
| 核實項 | 結論與證據 |
|---|---|
| 「TeamViewer」名稱 | 應為「TradingView」之筆誤/誤聽(TeamViewer 為遠端桌面控制軟件,並無指標源碼庫)。 |
| 原帖與回覆串驗證界線 | 主帖 2123461381030834442 原文無出現 TeamViewer 或 TradingView 字樣;結尾「具体的な使い方なんだけど、、、」之後的 3 則回覆在 X 登入牆後,第三方鏡像讀不到,故作者喺回覆中係寫 TradingView、誤寫 TeamViewer 定貼咗 lin.ee/yx9eCqY,未驗證。 |
| 實際源碼喺邊度攞、咩形式 | 確實可在 TradingView 免費取得完整開源代碼(亦於 LuxAlgo Library / Vela 開放): • 網頁: https://www.tradingview.com/script/JRqryeJ5-Liquidity-Sweeps-LuxAlgo/(按 Source code 展開複製)• 本席實測由 TradingView 公開端點 pine-facade.tradingview.com/pine-facade/get/PUB%3B26391b932d3145879b67deca62305c9a/last 取得完整 Pine Script v5(5796 B,sha256=18be09f34ebf371e...,CC BY-NC-SA 4.0)。 |
5796 B)// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © LuxAlgo
//@version=5
indicator( 'Liquidity Sweeps [LuxAlgo]'
, 'LuxAlgo - Liquidity Sweeps'
, max_lines_count=500
, max_boxes_count=500
, overlay=true
)
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
len = input.int(5, 'Swings', minval=1, group='Liquidity Sweeps')
opt = input.string('Only Wicks', 'options'
, options=['Only Wicks', 'Only Outbreaks & Retest', 'Wicks + Outbreaks & Retest'], group='Liquidity Sweeps')
colBl = input.color(#089981, 'Bull ', group='Liquidity Sweeps', inline='c1')
colBr = input.color(#f23645, 'Bear' , group='Liquidity Sweeps', inline='c2')
colBl2 = input.color(#08998180, '' , group='Liquidity Sweeps', inline='c1')
colBr2 = input.color(#f2364580, '' , group='Liquidity Sweeps', inline='c2')
extend = input.bool(true, 'Extend', group='Sweep Area')
maxB = input.int(300, 'Max bars', minval=1, maxval=5000, group='Sweep Area')
colBl3 = input.color(#08998141, 'Bull ', group='Sweep Area')
colBr3 = input.color(#f2364541, 'Bear' , group='Sweep Area')
oW = opt == 'Only Wicks'
oO = opt == 'Only Outbreaks & Retest'
WO = opt == 'Wicks + Outbreaks & Retest'
n = bar_index
//-----------------------------------------------------------------------------}
//UDT's
//-----------------------------------------------------------------------------{
type piv
float prc // price
int bix // bar_index
bool brk // broken
bool mit // mitigated
bool tak // taken
bool wic // wick
line lin
type boxBr
box bx
line ln
bool br
int dr
//-----------------------------------------------------------------------------}
//Variables
//-----------------------------------------------------------------------------{
var array< piv >aPivH = array.new< piv >(1, piv.new ())
var array< piv >aPivL = array.new< piv >(1, piv.new ())
var array<boxBr>aBoxBr = array.new<boxBr>(1, boxBr.new())
//-----------------------------------------------------------------------------}
//Methods - functions
//-----------------------------------------------------------------------------{
method n(float piv) => bool out = not na(piv)
method p(piv piv, float val) => float out = (100 / piv.prc * val) - 100
method l(piv get, color c, string s='sd') =>
style = switch s
'dt' => line.style_dotted
'ds' => line.style_dashed
=> line.style_solid
line.new(get.bix, get.prc, n, get.prc, color=c, style = style)
method br(piv get, color c3, color c, int d) =>
y1 = d == 1 ? high : get.prc
y2 = d == 1 ? get.prc : low
boxBr.new(
box.new(n -1, y1, n +1, y2
, border_color
= color.new(
na, na )
, bgcolor=c3)
, line.new(n , y1, n, y2, color=c, width=3)
, false
, d)
lnDot(y, c) => line.new(n, y, n+3, y, color=c, style=line.style_dotted)
//-----------------------------------------------------------------------------}
//Execution
//-----------------------------------------------------------------------------{
ph = ta.pivothigh(len, len)
pl = ta.pivotlow (len, len)
if ph.n()
aPivH.unshift(piv.new(ph, n -len, false, false, false, false))
if pl.n()
aPivL.unshift(piv.new(pl, n -len, false, false, false, false))
for i = aPivH.size() -1 to 0
get = aPivH.get(i)
if not get.mit
if not get.brk
if close > get.prc
if not oW
get.brk := true
else
get.mit := true
if not oO and not get.wic
if high > get.prc and close < get.prc
aBoxBr.unshift(get.br(colBr3, colBr, 1))
get.l(colBr2, 'dt'), lnDot(low, colBr)
get.wic := true
else
if close < get.prc
get.mit := true
if not oW and low < get.prc and close > get.prc
aBoxBr.unshift(get.br(colBl3, colBl, -1))
get.l(colBl2, 'ds'), lnDot(high, colBl)
get.tak := true
if n - get.bix > 2000 or get.mit or get.tak
aPivH.remove(i).lin.delete()
for i = aPivL.size() -1 to 0
get = aPivL.get(i)
if not get.mit
if not get.brk
if close < get.prc
if not oW
get.brk := true
else
get.mit := true
if not oO and not get.wic
if low < get.prc and close > get.prc
aBoxBr.unshift(get.br(colBl3, colBl, -1))
get.l(colBl2, 'dt'), lnDot(high, colBl)
get.wic := true
else
if close > get.prc
get.mit := true
if not oW and high > get.prc and close < get.prc
aBoxBr.unshift(get.br(colBr3, colBr, 1))
get.l(colBr2, 'ds'), lnDot(low, colBr)
get.tak := true
if n - get.bix > 2000 or get.mit or get.tak
aPivL.remove(i).lin.delete()
if extend
for bx in aBoxBr
if not bx.br and n - bx.bx.get_left() -1 <= maxB
bx.bx.set_right(bar_index)
if bx.dr == -1 and close < bx.bx.get_bottom()
bx.br := true
if bx.dr == 1 and close > bx.bx.get_top ()
bx.br := true
//-----------------------------------------------------------------------------}