Liquidity Pin
Liquidity Pin
0 at
https://mozilla.org/MPL/2.0/
// © LeviathanCapital
//@version=5
// Inputs
// Conditions
pnoid = input.string('/', 'Only Swings With', options = ['Positive OI Delta', 'Negative OI Delta', '/'],
group='Conditions')
// Appearance inputs
boxStyle = input.string('TYPE 1', '', options=['TYPE 1', 'TYPE 2'], inline='xx', group='Appearance')
labelsize = input.string('Size: Tiny', 'Text Style ', options = ['Size: Normal','Size: Large',
'Size: Small', 'Size: Tiny', 'Size: Auto' ], inline='txt', group = 'Appearance' )
// OI Data
bitmex2 = input.bool(true, 'BitMEX USDT.P ', inline = 'src3', group = 'Open Interest')
MSPD = 24 * 60 * 60 * 1000
//Pivot calculations
int prevHighIndex= na, int prevLowIndex= na, bool highActive= false, bool lowActive= false, bool h=
false, bool l= false
h := true
if not na(pivLo)
l := true
// Getting OI data
vol = volume[swingSizeR]
// Styles
boxStyle(x) =>
switch x
lineStyle(x) =>
switch x
switchtextsize(textsize) =>
switch textsize
switchhalign(texthalign) =>
switch texthalign
array.push(levelBoxes, hBox)
array.push(levelLines, hLine)
if l and inRange and showhighs and oitreshcond and voltreshcond and oicond
array.push(levelBoxes, lBox)
array.push(levelLines, lLine)
// Looping over the full array of lines and updating them, and deleting them if they have been
touched
size = array.size(levelBoxes)
if size > 0
for i = 0 to size - 1
j = size - 1 - i
box = array.get(levelBoxes, j)
line = array.get(levelLines, j)
level = line.get_y2(line)
array.remove(levelLines, j)
array.remove(levelBoxes, j)
continue
box.set_right(box, bar_index+1)
line.set_x2(line, bar_index+1)
array.remove(levelLines, j)
array.remove(levelBoxes, j)
line.delete(line)
box.delete(box)
array.remove(levelLines, j)
array.remove(levelBoxes, j)
continue
box.set_right(box, bar_index[0]+4)
line.set_x2(line, bar_index[0]+4)
int i = 0
box = array.get(levelBoxes, i)
line = array.get(levelLines, i)
box.delete(box)
line.delete(line)
array.remove(levelBoxes, i)
array.remove(levelLines, i)
i += 1
plotshape(showlows and showBubbles and l and oitreshcond and voltreshcond and oicond ?
low[swingSizeR] : na, style=shape.circle, location = location.absolute, offset = -swingSizeR,
color=buycolB, size = size.tiny)