Combine
Combine
Combine
// Colors
green = color.new(#2BBC4D, 0)
red = color.new(#C51D0B, 0)
green2 = color.new(#00DD00, 0)
red2 = color.new(#DD0000, 0)
bullcolorr = color.rgb(0, 255, 8)
bearcolorr = color.rgb(255, 0, 0)
// Supertrend function
supertrend(_src, factor, atrLen, kel_length) =>
[upperKeltner, lowerKeltner] = keltner_channel(_src, kel_length)
rangec = upperKeltner - lowerKeltner
upperBand = _src + factor * rangec
lowerBand = _src - factor * rangec
prevLowerBand = nz(lowerBand[1])
prevUpperBand = nz(upperBand[1])
lowerBand := lowerBand > prevLowerBand or close[1] < prevLowerBand ?
lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or close[1] > prevUpperBand ?
upperBand : prevUpperBand
int direction = na
float superTrend = na
prevSuperTrend = superTrend[1]
if na(rangec[1])
direction := 1
else if prevSuperTrend == prevUpperBand
direction := close > upperBand ? -1 : 1
else
direction := close < lowerBand ? 1 : -1
superTrend := direction == -1 ? lowerBand : upperBand
[superTrend, direction]
[supertrend, direction] = supertrend(close, sensitivity, 11, 10)
bull = ta.crossover(close, supertrend)
bear = ta.crossunder(close, supertrend)
y1 = low - (ta.atr(30) * 2)
y2 = high + (ta.atr(30) * 2)
// Braid Filter
ma01 = ma(maType, close, 3)
ma02 = ma(maType, open, 7)
ma03 = ma(maType, close, 20)
max = math.max(math.max(ma01, ma02), ma03)
min = math.min(math.min(ma01, ma02), ma03)
dif = max - min
filter = ta.atr(14) * PipsMinSepPercent / 100
BraidColor = ma01 > ma02 and dif > filter ? color.green : ma02 > ma01 and dif >
filter ? color.red : color.gray
// EMAs
ema1 = ta.ema(high, 9)
ema2 = ta.ema(high, 12)
ema3 = ta.ema(high, 15)
ema4 = ta.ema(high, 18)
ema5 = ta.ema(high, 21)
ema6 = ta.ema(high, 24)
ema7 = ta.ema(high, 27)
ema8 = ta.ema(high, 30)
ema9 = ta.ema(high, 33)
ema10 = ta.ema(high, 36)
ema11 = ta.ema(high, 39)
ema12 = ta.ema(high, 42)
ema13 = ta.ema(high, 45)
ema14 = ta.ema(high, 48)
ema15 = ta.ema(high, 51)
emaEnergyColor(ma) =>
emaEnergy ? (close >= ma ? green : red) : color.new(na, 0)
// Alert conditions
alertcondition(buy or sell, title="BUY or SELL Signal", message="BUY or SELL Signal
Triggered")
// High Lows
y1B = low - ta.atr(30)
y2B = high + ta.atr(30)
trigger2 = bull ? 1 : 0
countBull = ta.barssince(bull)
countBear = ta.barssince(bear)
trigger = nz(countBull, bar_index) < nz(countBear, bar_index) ? 1 : 0
atrBand = ta.atr(atrLen) * atrRisk
atrStop = trigger == 1 ? low - atrBand : high + atrBand
stop_y = lastTrade(atrStop)
stop = levels ? label.new(time, close, "SL " + str.tostring(stop_y, decimals),
xloc.bar_time, yloc.price, red2, label.style_label_left, color.white,
size.normal) : na
label.set_x(stop, label.get_x(stop) + math.round(ta.change(time) * lvlDecimals))
label.set_y(stop, stop_y)
label.delete(stop[1])
if show_TPSL_SHORT
// Variables para las líneas horizontales
var line4 = line.new(x1=bar_index, y1=valorCelda4, x2=bar_index[1],
y2=valorCelda4, color=color.red, width=1, extend = extend.left)
var line5 = line.new(x1=bar_index, y1=valorCelda5, x2=bar_index[1],
y2=valorCelda5, color=color.green, width=1, extend = extend.left)
var labelSL_SHORT = label.new(x=na, y=na, text="SL", color=color.red,
textcolor=color.white,style=label.style_label_down)
var labelTP_SHORT = label.new(x=na, y=na, text="TP", color=color.green,
textcolor=color.white,style=label.style_label_up)
//====================colour bar=====================//
mysignal = ta.ema(close, 12) - ta.ema(close, 26)
barcolor(mysignal[0] > mysignal[1] ? color.green : color.red)
label.new(min_x1,min,'??',color=miss_pl_css,style=label.style_label_up,size=size.sm
all,
tooltip=str.tostring(min,'#.####'))
zigzag :=
line.new(px1,py1,min_x1,min,color=miss_ph_css,style=line.style_dashed)
px1 := min_x1,py1 := min
line.set_x2(ghost_level[1],px1)
ghost_level :=
line.new(px1,py1,px1,py1,color=color.new(reg_pl_css,50),width=2)
else if ph2 < max
label.new(max_x1,max,'??',color=miss_ph_css,style=label.style_label_down,size=size.
small,
tooltip=str.tostring(max,'#.####'))
label.new(follow_min_x1,follow_min,'??',color=miss_pl_css,style=label.style_label_u
p,size=size.small,
tooltip=str.tostring(min,'#.####'))
zigzag :=
line.new(px1,py1,max_x1,max,color=miss_pl_css,style=line.style_dashed)
px1 := max_x1,py1 := max
line.set_x2(ghost_level[1],px1)
ghost_level :=
line.new(px1,py1,px1,py1,color=color.new(reg_ph_css,50),width=2)
zigzag :=
line.new(px1,py1,follow_min_x1,follow_min,color=miss_ph_css,style=line.style_dashed
)
px1 := follow_min_x1,py1 := follow_min
line.set_x2(ghost_level,px1)
ghost_level :=
line.new(px1,py1,px1,py1,color=color.new(reg_pl_css,50),width=2)
if show_reg
label.new(n-
length2,ph2,'?',textcolor=label_css,color=reg_ph_css,style=label.style_label_down,s
ize=size.small,
tooltip=str.tostring(ph2,'#.####'))
zigzag := line.new(px1,py1,n-length2,ph2,color=miss_pl_css,style=ph2 < max
or os[1] == 1 ? line.style_dashed : line.style_solid)
py1 := ph2,px1 := n-length2,os := 1,max := ph2,min := ph2
if pl2
if show_miss
if os[1] == 0
label.new(max_x1,max,'??',color=miss_ph_css,style=label.style_label_down,size=size.
small,
tooltip=str.tostring(max,'#.####'))
zigzag :=
line.new(px1,py1,max_x1,max,color=miss_pl_css,style=line.style_dashed)
px1 := max_x1,py1 := max
line.set_x2(ghost_level[1],px1)
ghost_level :=
line.new(px1,py1,px1,py1,color=color.new(reg_ph_css,50),width=2)
else if pl2 > min
label.new(follow_max_x1,follow_max,'??',color=miss_ph_css,style=label.style_label_d
own,size=size.small,
tooltip=str.tostring(max,'#.####'))
label.new(min_x1,min,'??',color=miss_pl_css,style=label.style_label_up,size=size.sm
all,
tooltip=str.tostring(min,'#.####'))
zigzag :=
line.new(px1,py1,min_x1,min,color=miss_ph_css,style=line.style_dashed)
px1 := min_x1,py1 := min
line.set_x2(ghost_level[1],px1)
ghost_level :=
line.new(px1,py1,px1,py1,color=color.new(reg_pl_css,50),width=2)
zigzag :=
line.new(px1,py1,follow_max_x1,follow_max,color=miss_pl_css,style=line.style_dashed
)
px1 := follow_max_x1,py1 := follow_max
line.set_x2(ghost_level,px1)
ghost_level :=
line.new(px1,py1,px1,py1,color=color.new(reg_ph_css,50),width=2)
if show_reg
label.new(n-
length2,pl2,'?',textcolor=label_css,color=reg_pl_css,style=label.style_label_up,siz
e=size.small,
tooltip=str.tostring(pl2,'#.####'))
zigzag := line.new(px1,py1,n-length2,pl2,color=miss_ph_css,style=pl2 > min
or os[1] == 0 ? line.style_dashed : line.style_solid)
py1 := pl2,px1 := n-length2,os := 0,max := pl2,min := pl2
var label lbl = na
if barstate.islast
x = 0,y = 0.
prices = array.new_float(0)
prices_x = array.new_int(0)
for i = 0 to n-px1-1
array.push(prices,os==1?low[i]:high[i])
array.push(prices_x,n-i)
label.delete(lbl[1])
if os == 1
y := array.min(prices)
x := array.get(prices_x,array.indexof(prices,y))
if show_miss
lbl :=
label.new(x,y,'??',color=miss_pl_css,style=label.style_label_up,size=size.small,
tooltip=str.tostring(y,'#.####'))
else
y := array.max(prices)
x := array.get(prices_x,array.indexof(prices,y))
if show_miss
lbl :=
label.new(x,y,'??',color=miss_ph_css,style=label.style_label_down,size=size.small,
tooltip=str.tostring(y,'#.####'))
if show_miss
line.delete(line.new(px1,py1,x,y,color=os == 1 ? miss_ph_css :
miss_pl_css,style=line.style_dashed)[1])
line.delete(line.new(x,y,n,y,color = color.new(os == 1 ? miss_ph_css :
miss_pl_css,50),width=2)[1])
// Show buy/sell arrows and Draw the EMA ribbon and fractals
//------------------------------------------------------------------------------
// Settings
//-----------------------------------------------------------------------------{
lmTT = 'Presents liquidations on the price chart by measuring the highest leverage
value of longs and shorts that have been potentially liquidated on the last chart
bar.\n\n' +
'Liquidations meter allows traders to\n -gauge the momentum of the bar,\n
-identify the strength of the bulls and bears, and\n -identify probable
reversal/exhaustion points\n\n' +
'Here with liquidations, we refer to the process of forcibly closing a
trader\'s position in the market'
lmSH = input.bool(true, 'Liquidations Meter', group = 'Liquidations Meter',
tooltip = lmTT)
refPS = input.string("open", "Base Price", options = ["open", "close", "oc2",
"hl2", "ooc3", "occ3", "hlc3", "ohlc4", "hlcc4"], group = 'Liquidations Meter')
clTT = 'The liquidation price calculator is useful for leverage trading traders
who want to know how much risk they can take for each trade.\n\n' +
'This tool uses a formula to calculate the liquidation price based on the
entry price + leverage ratio.\n\n' +
'Other factors such as leveraged fees, position size, and other interest
payments have been excluded since they are variables that don’t directly affect the
level of liquidation of a leveraged position.\n\n' +
'This calculator also assumes that traders are using an isolated margin
for one single position and does not take into consideration the additional margin
they might have in their account.'
clSH = input.bool(true, 'Liquidation Price Calculator', group = clGR, tooltip =
clTT)
epTT = 'Defines the entry price.\nIf the entry price is set to 0, then the
selected \'Base Price\' value is assumed as entry price\n\n' +
'Tip: Before entering a trade, setting base price to \'close\' and entry
price to remain at 0 will allow the traders to easily evaluate the risk and reward
situation of any given setup'
clEP = input.float(0., 'Entry Price', group = clGR, tooltip = epTT)
lrTT = 'Leverage allows traders to borrow funds in order to enter a position
larger than their own funds permit\n\n' +
'the higher the leverage ratio the higher the risk.\n\nIt is important to
be aware that when the leverage ratio is increased, the liquidation price moves
closer to the entry price, meaning a higher risk trader\'s position will have'
clLR = input.float(10., 'Leverage', minval = 0, group = clGR, tooltip = lrTT)
dbTT = 'The bar statistics option enables measuring and presenting trading
activity, volatility, and probable liquidations for the last chart bar'
dbSH = input.bool(true, 'Show Bar Statistics', group = 'Dashboard', tooltip =
dbTT)
//-----------------------------------------------------------------------------}
// User Defined Types
//-----------------------------------------------------------------------------{
type bar
float o = open
float h = high
float l = low
float c = close
float v = volume
int i = bar_index
//-----------------------------------------------------------------------------}
// Variables
//-----------------------------------------------------------------------------{
bar b = bar.new()
vST = ''
//-----------------------------------------------------------------------------}
// Functions/methods
//-----------------------------------------------------------------------------{
f_gSZ(_s) =>
switch _s
'Tiny' => size.tiny
'Small' => size.small
=> size.normal
f_gSRC(_s) =>
switch _s
"open" => open
"close" => close
"oc2" => math.avg(open, close)
"hl2" => hl2
"ooc3" => math.avg(open, open , close)
"occ3" => math.avg(open, close, close)
"hlc3" => hlc3
"ohlc4" => ohlc4
"hlcc4" => hlcc4
//-----------------------------------------------------------------------------}
// Calculations
//-----------------------------------------------------------------------------{
nzV = nz(b.v)
lSZ = f_gSZ(lcLS)
refP = f_gSRC(refPS)
if aLQ.size() > 0
for i = 1 to aLQ.size()
box.delete(aLQ.shift())
off = lpSH ? 7 : 0
for i = 1 to 7
if (refP - b.l) > 0 and refP / (refP - b.l) < lev.get(i - 1)
aLQ.push(box.new(b.i + lcOF + off, refP * (1 - 1. / lev.get(i - 1)),
b.i + lcOF + off + 2, refP * (1 - 1. / lev.get(i)), border_color = color(na),
bgcolor = color.new(color.teal, trans.get(i)), text =
str.tostring(lev.get(i)) + 'x', text_color = chart.fg_color, text_valign =
text.align_bottom))
tSZ = f_gSZ(lcDS)
if barstate.islast
if dbSH
table.cell(calc, 0, 0, "BAR STATISTICS\n", text_color = color.white,
text_size = tSZ, bgcolor = #2962FF)
table.merge_cells(calc, 0, 0, 2, 0)
if nzV > 0
table.cell(calc, 0, 1, "Activity", text_color = color.white, text_size
= tSZ, text_halign = text.align_left)
table.merge_cells(calc, 0, 1, 1, 1)
table.cell(calc, 2, 1, vDB, text_color = color.white, text_size = tSZ)
if clSH
table.cell(calc, 0, 4, "CALCULATOR\n", text_color = color.white, text_size
= tSZ, bgcolor = #2962FF)
table.merge_cells(calc, 0, 4, 2, 4)
tip = 'Liquidation price is the distance from trader\'s entry price to the
price where trader\'s leveraged position gets liquidated due to a loss.\n\n' +
'If a trader wants to enter a $1.000 trade with ' +
str.tostring(clLR) + 'x leverage, then $' + str.tostring(1000/clLR, '#.##') +
' is the initial margin (the amount of money coming from the traders
pocket) and the remaining $' + str.tostring(1000 - 1000/clLR, '#.##') + ' are
borrowed funds\n\n' +
'When a trader\'s account falls below the required margin level,
exchanges or brokerage platforms cannot allow a trader to lose borrowed funds and
therefore the trader\'s positions will be forcibly closed as soon as position
losses reach the initial margin.\n\n' +
'The liquidation prices presented below are approximate values of
both long and short liquidation prices. It is important to note that the exchanges
will taken into consideration the trader\'s open positions when calculating the
liquidation price. Unrealized PNL and maintenance margin of the trader\'s open
position will affect the calculation of liquidation price'
if lpSH
if aCL.size() > 0
for i = 1 to aCL.size()
box.delete(aCL.shift())
//-----------------------------------------------------------------------------}
//============================= CREDITOS
=================================================//
credit = input.text_area(title="", defval="VIP Trading Signal Generator es un
conjunto de las mejores herramientas que permiten al operador determinar posibles
entradas en Long y Short aumentando la efectividad al operar en un 95%.\nSiga
siempre las instrucciones que le fueron dadas y recuerde siempre operar con
cuidado!\n\nCreado por CSBender_\nUltima verificacion: 03-Nov-2023.", group =
'Informacion General')
//============================= CREDITOS ====================================//