Professional Documents
Culture Documents
Liquidity Swings (LuxAlgo)
Liquidity Swings (LuxAlgo)
0 International (CC
BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © LuxAlgo
//@version=5
, overlay = true
, max_lines_count = 500
, max_labels_count = 500
, max_boxes_count = 500)
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
area = input.string('Wick Extremity', 'Swing Area', options = ['Wick Extremity', 'Full Range'])
//Style
//-----------------------------------------------------------------------------}
//Functions
//-----------------------------------------------------------------------------{
n = bar_index
var count = 0
var vol = 0.
if condition
count := 0
vol := 0.
else
if intraPrecision
if n > length
if array.size(v[length]) > 0
vol += array.get(l[length], index) < top and array.get(h[length], index) > btm ?
element : 0
else
if ta.crossover(target, filterValue)
, style = lbl_style
, size = label_size
, color = #00000000
, textcolor = css)
if condition
if target[1] < filterValue[1]
line.delete(lvl[1])
line.set_x2(lvl, n - length)
, color = na)
if not crossed[1]
line.set_x2(lvl, n+3)
line.set_x2(lvl, n)
line.set_style(lvl, line.style_dashed)
line.set_color(lvl, css)
var box bx = na
if ta.crossover(target, filterValue)
, border_color = na
, bgcolor = css)
//-----------------------------------------------------------------------------}
//Global variables
//-----------------------------------------------------------------------------{
//Pivot high
var ph_x1 = 0
, border_color = na)
//Pivot low
var pl_x1 = 0
, border_color = na)
//-----------------------------------------------------------------------------}
//-----------------------------------------------------------------------------{
ph = ta.pivothigh(length, length)
//Get ph counts
if ph and showTop
ph_top := high[length]
ph_x1 := n - length
ph_crossed := false
else
if ph_crossed
box.set_right(ph_bx, ph_x1)
else
box.set_right(ph_bx, n+3)
if showTop
//Set ph zone
//Set ph level
//Set ph label
//-----------------------------------------------------------------------------}
//Display pivot low levels/blocks
//-----------------------------------------------------------------------------{
pl = ta.pivotlow(length, length)
//Get pl counts
if pl and showBtm
pl_btm := low[length]
pl_x1 := n - length
pl_crossed := false
else
if pl_crossed
box.set_right(pl_bx, pl_x1)
else
box.set_right(pl_bx, n+3)
if showBtm
//Set pl zone
//Set pl labels
//-----------------------------------------------------------------------------}