Lineas Pruebas
Lineas Pruebas
// Función para verificar si el tiempo actual está dentro de una franja horaria
específica
inTimeRange(startHour, startMinute, endHour, endMinute) =>
(currentHour > startHour or (currentHour == startHour and currentMinute >=
startMinute)) and (currentHour < endHour or (currentHour == endHour and
currentMinute <= endMinute))
// Función para obtener el alto y bajo dentro de las franjas horarias de un día
completo
var float highOfDay = na
var float lowOfDay = na
var int highBarIndex = na
var int lowBarIndex = na
adaaBarIndex := adaBarIndex
bdaaBarIndex := bdaBarIndex
adaBarIndex := addBarIndex
bdaBarIndex := bddBarIndex
addBarIndex := highBarIndex
bddBarIndex := lowBarIndex
if (not na(bddLow))
if (not na(bddLine))
line.set_xy1(bddLine, bddBarIndex, bddLow)
line.set_xy2(bddLine, bar_index + 500, bddLow) // Extender hasta 500 barras
en el futuro
label.set_xy(bddLabel, bar_index + 500, bddLow)
else
bddLine := line.new(x1=bddBarIndex, y1=bddLow, x2=bar_index + 500,
y2=bddLow, color=color.green, style=line.style_dashed, width=1,
xloc=xloc.bar_index, extend=extend.none)
bddLabel := label.new(x=bar_index + 500, y=bddLow, text="BDD",
color=color.green, textcolor=color.green, style=label.style_none, size=size.normal,
yloc=yloc.price)
if (not na(adaHigh))
if (not na(adaLine))
line.set_xy1(adaLine, adaBarIndex, adaHigh)
line.set_xy2(adaLine, bar_index + 500, adaHigh) // Extender hasta 500
barras en el futuro
label.set_xy(adaLabel, bar_index + 500, adaHigh)
else
adaLine := line.new(x1=adaBarIndex, y1=adaHigh, x2=bar_index + 500,
y2=adaHigh, color=color.blue, width=1, xloc=xloc.bar_index, extend=extend.none)
adaLabel := label.new(x=bar_index + 500, y=adaHigh, text="ADA",
color=color.blue, textcolor=color.blue, style=label.style_none, size=size.normal,
yloc=yloc.price)
if (not na(bdaLow))
if (not na(bdaLine))
line.set_xy1(bdaLine, bdaBarIndex, bdaLow)
line.set_xy2(bdaLine, bar_index + 500, bdaLow) // Extender hasta 500 barras
en el futuro
label.set_xy(bdaLabel, bar_index + 500, bdaLow)
else
bdaLine := line.new(x1=bdaBarIndex, y1=bdaLow, x2=bar_index + 500,
y2=bdaLow, color=color.blue, width=1, xloc=xloc.bar_index, extend=extend.none)
bdaLabel := label.new(x=bar_index + 500, y=bdaLow, text="BDA",
color=color.blue, textcolor=color.blue, style=label.style_none, size=size.normal,
yloc=yloc.price)
if (enableADAA_BDAA)
if (not na(adaaHigh))
if (not na(adaaLine))
line.set_xy1(adaaLine, adaaBarIndex, adaaHigh)
line.set_xy2(adaaLine, bar_index + 500, adaaHigh) // Extender hasta 500
barras en el futuro
label.set_xy(adaaLabel, bar_index + 500, adaaHigh)
else
adaaLine := line.new(x1=adaaBarIndex, y1=adaaHigh, x2=bar_index + 500,
y2=adaaHigh, color=color.orange, style=line.style_dotted, width=2,
xloc=xloc.bar_index, extend=extend.none)
adaaLabel := label.new(x=bar_index + 500, y=adaaHigh, text="ADAA",
color=color.orange, textcolor=color.orange, style=label.style_none,
size=size.normal, yloc=yloc.price)
if (not na(adaaLow))
if (not na(bdaaLine))
line.set_xy1(bdaaLine, bdaaBarIndex, adaaLow)
line.set_xy2(bdaaLine, bar_index + 500, adaaLow) // Extender hasta 500
barras en el futuro
label.set_xy(bdaaLabel, bar_index + 500, adaaLow)
else
bdaaLine := line.new(x1=bdaaBarIndex, y1=adaaLow, x2=bar_index + 500,
y2=adaaLow, color=color.orange, style=line.style_dotted, width=2,
xloc=xloc.bar_index, extend=extend.none)
bdaaLabel := label.new(x=bar_index + 500, y=adaaLow, text="BDAA",
color=color.orange, textcolor=color.orange, style=label.style_none,
size=size.normal, yloc=yloc.price)