ASTRA
ASTRA
if barstate.islast
float val = na
k = 0
A = array.new_float(0)
X = array.new_int(0)
for i = 0 to fcast * 2 + length by 1
array.push(A, src[i])
if cmode == 'Linreg'
array.push(X, n[i])
a = array.slice(A, 0, fcast - 1)
for i = 0 to length - 1 by 1
b = array.slice(A, fcast + i, fcast * 2 + i - 1)
r = array.covariance(a, b) / (array.stdev(a) * array.stdev(b))
if fmode == 'Similarity'
val := r >= nz(val, r) ? r : val
val
else
val := r <= nz(val, r) ? r : val
val
k := val == r ? i : k
k
prev = src
current = src
for i = 0 to fcast - 1 by 1
e = d[fcast + k + fcast - i - 1]
if cmode == 'Mean'
current := array.avg(a) + e
current
else if cmode == 'Linreg'
a = array.slice(A, 0, fcast)
x = array.slice(X, 0, fcast)
alpha = array.covariance(a, x) / array.variance(x)
beta = array.avg(a) - alpha * array.avg(x)
current := alpha * (n + i + 1) + beta + e
current
else
current += e
current
l = array.get(lines, i)
line.set_xy1(l, n + i, prev)
line.set_xy2(l, n + i + 1, current)
line.set_color(l, fcast_col)
prev := current
prev
if show_area
box.delete(box.new(n - length - fcast * 2 + 1, top, n - fcast + 1, btm,
border_color=na, bgcolor=eval_area)[1])
box.delete(box.new(n - fcast + 1, top, n, btm, border_color=na,
bgcolor=fcast_area)[1])
box.delete(box.new(n - k - fcast * 2 + 1, btm, n - k - fcast, top,
border_color=na, bgcolor=corr_area)[1])
lengthInput = 96
sourceInput = input.source(close, title="Source")
//FOMO
source = hlc3
type = 'SuperSmoother'
length666 = 200
innermult = 1
outermult = 2.55
drawchannel = input(defval=true, title='Draw FOMO')
displayzone = true
zonetransp = 90
//
***********************************************************************************
*************************
// Functions Start {
//
***********************************************************************************
*************************
var pi = 2 * math.asin(1)
var mult = pi * innermult
var mult2 = pi * outermult
var gradsize = 0.5
var gradtransp = zonetransp
//-----------------------
// Ehler SwissArmyKnife Function
//-----------------------
SAK_smoothing(_type, _src, _length666) =>
c0 = 1.0
c1 = 0.0
b0 = 1.0
b1 = 0.0
b2 = 0.0
a1 = 0.0
a2 = 0.0
alpha = 0.0
beta = 0.0
gamma = 0.0
cycle = 2 * pi / _length666
_Input = _src
_Output = 0.0
_Output := c0 * (b0 * _Input + b1 * nz(_Input[1]) + b2 * nz(_Input[2])) + a1 *
nz(_Output[1]) + a2 * nz(_Output[2]) - c1 * nz(_Input[_length666])
_Output
//-----------------------
// SuperSmoother Function
//-----------------------
supersmoother(_src, _length666) =>
s_a1 = math.exp(-math.sqrt(2) * pi / _length666)
s_b1 = 2 * s_a1 * math.cos(math.sqrt(2) * pi / _length666)
s_c3 = -math.pow(s_a1, 2)
s_c2 = s_b1
s_c1 = 1 - s_c2 - s_c3
ss = 0.0
ss := s_c1 * _src + s_c2 * nz(ss[1], _src[1]) + s_c3 * nz(ss[2], _src[2])
ss
//-----------------------
// Mean Reversion Channel Function
//-----------------------
get_mrc() =>
v_condition = 0
v_meanline = source
v_meanrange = supersmoother(ta.tr, length666)
if type != 'SuperSmoother'
v_meanline := SAK_smoothing(type, source, length666)
v_meanline
//
***********************************************************************************
*************************
// Calculate Channel
//
***********************************************************************************
*************************
//
***********************************************************************************
*************************
// Drawing Start {
//
***********************************************************************************
*************************
float p_meanline = drawchannel ? meanline : na
float p_upband1 = drawchannel ? upband1 : na
float p_loband1 = drawchannel ? loband1 : na
float p_upband2 = drawchannel ? upband2 : na
float p_loband2 = drawchannel ? loband2 : na
// Draw zone
//-----------------------
//---
var color1 = #005429
var color2 = #059500
var color3 = #05c102
var color4 = #00ff44
var color5 = #1f6e7f
var color6 = #1799ad
var color7 = #0dcae2
var color8 = #00ddff
//---
float upband2_1 = drawchannel and displayzone ? upband2 + meanrange * gradsize *
4.3 : na
float loband2_1 = drawchannel and displayzone ? loband2 - meanrange * gradsize *
4.3 : na
float upband2_2 = drawchannel and displayzone ? upband2 + meanrange * gradsize *
3 : na
float loband2_2 = drawchannel and displayzone ? loband2 - meanrange * gradsize *
3 : na
float upband2_3 = drawchannel and displayzone ? upband2 + meanrange * gradsize *
2 : na
float loband2_3 = drawchannel and displayzone ? loband2 - meanrange * gradsize *
2 : na
float upband2_4 = drawchannel and displayzone ? upband2 + meanrange * gradsize *
1 : na
float loband2_4 = drawchannel and displayzone ? loband2 - meanrange * gradsize *
1 : na
float upband2_5 = drawchannel and displayzone ? upband2 + meanrange * gradsize *
0 : na
float loband2_5 = drawchannel and displayzone ? loband2 - meanrange * gradsize *
0 : na
float upband2_6 = drawchannel and displayzone ? upband2 + meanrange * gradsize * -1
: na
float loband2_6 = drawchannel and displayzone ? loband2 - meanrange * gradsize * -1
: na
float upband2_7 = drawchannel and displayzone ? upband2 + meanrange * gradsize * -2
: na
float loband2_7 = drawchannel and displayzone ? loband2 - meanrange * gradsize * -2
: na
float upband2_8 = drawchannel and displayzone ? upband2 + meanrange * gradsize * -3
: na
float loband2_8 = drawchannel and displayzone ? loband2 - meanrange * gradsize * -4
: na
float upband2_9 = drawchannel and displayzone ? upband2 + meanrange * gradsize * -
4.3 : na
float loband2_9 = drawchannel and displayzone ? loband2 - meanrange * gradsize * -
4.3 : na
//---
plot_upband2_1 = plot(upband2_1, color=na, display=display.none, transp=100)
plot_loband2_1 = plot(loband2_1, color=na, display=display.none, transp=100)
plot_upband2_2 = plot(upband2_2, color=na, display=display.none, transp=100)
plot_loband2_2 = plot(loband2_2, color=na, display=display.none, transp=100)
plot_upband2_3 = plot(upband2_3, color=na, display=display.none, transp=100)
plot_loband2_3 = plot(loband2_3, color=na, display=display.none, transp=100)
plot_upband2_4 = plot(upband2_4, color=na, display=display.none, transp=100)
plot_loband2_4 = plot(loband2_4, color=na, display=display.none, transp=100)
plot_upband2_5 = plot(upband2_5, color=na, display=display.none, transp=100)
plot_loband2_5 = plot(loband2_5, color=na, display=display.none, transp=100)
plot_upband2_6 = plot(upband2_6, color=na, display=display.none, transp=100)
plot_loband2_6 = plot(loband2_6, color=na, display=display.none, transp=100)
plot_upband2_7 = plot(upband2_7, color=na, display=display.none, transp=100)
plot_loband2_7 = plot(loband2_7, color=na, display=display.none, transp=100)
plot_upband2_8 = plot(upband2_8, color=na, display=display.none, transp=100)
plot_loband2_8 = plot(loband2_8, color=na, display=display.none, transp=100)
plot_upband2_9 = plot(upband2_9, color=na, display=display.none, transp=100)
plot_loband2_9 = plot(loband2_9, color=na, display=display.none, transp=100)
//---
fill(plot_upband2_1, plot_upband2_2, color=color1, transp=gradtransp)
fill(plot_loband2_1, plot_loband2_2, color=color1, transp=gradtransp)
fill(plot_upband2_2, plot_upband2_3, color=color2, transp=gradtransp)
fill(plot_loband2_2, plot_loband2_3, color=color2, transp=gradtransp)
fill(plot_upband2_3, plot_upband2_4, color=color3, transp=gradtransp)
fill(plot_loband2_3, plot_loband2_4, color=color3, transp=gradtransp)
fill(plot_upband2_4, plot_upband2_5, color=color4, transp=gradtransp)
fill(plot_loband2_4, plot_loband2_5, color=color4, transp=gradtransp)
fill(plot_upband2_5, plot_upband2_6, color=color5, transp=gradtransp)
fill(plot_loband2_5, plot_loband2_6, color=color5, transp=gradtransp)
fill(plot_upband2_6, plot_upband2_7, color=color6, transp=gradtransp)
fill(plot_loband2_6, plot_loband2_7, color=color6, transp=gradtransp)
fill(plot_upband2_7, plot_upband2_8, color=color7, transp=gradtransp)
fill(plot_loband2_7, plot_loband2_8, color=color7, transp=gradtransp)
fill(plot_upband2_8, plot_upband2_9, color=color8, transp=gradtransp)
fill(plot_loband2_8, plot_loband2_9, color=color8, transp=gradtransp)
///////////////
// FUNCTIONS //
///////////////
////////////
// INPUTS //
////////////
// Calc Open
open_cur = 0.0
open_cur := is_newbar(pp_res) ? open : open_cur[1]
popen = 0.0
popen := is_newbar(pp_res) ? open_cur[1] : popen[1]
// Calc High
high_cur = 0.0
high_cur := is_newbar(pp_res) ? high : math.max(high_cur[1], high)
phigh = 0.0
phigh := is_newbar(pp_res) ? high_cur[1] : phigh[1]
// Calc Low
low_cur = 0.0
low_cur := is_newbar(pp_res) ? low : math.min(low_cur[1], low)
plow = 0.0
plow := is_newbar(pp_res) ? low_cur[1] : plow[1]
// Calc Close
pclose = 0.0
pclose := is_newbar(pp_res) ? close[1] : pclose[1]
////////////////////////////
// CALCULATE PIVOT POINTS //
////////////////////////////
PP = 0.0
R1 = 0.0
R2 = 0.0
R3 = 0.0
S1 = 0.0
S2 = 0.0
S3 = 0.0
if pp_type == 'Traditional'
PP := (phigh + plow + pclose) / 3
R1 := PP + PP - plow
S1 := PP - (phigh - PP)
R2 := PP + phigh - plow
S2 := PP - (phigh - plow)
R3 := phigh + 2 * (PP - plow)
S3 := plow - 2 * (phigh - PP)
S3
if pp_type == 'Fibonacci'
PP := (phigh + plow + pclose) / 3
R1 := PP + (phigh - plow) * 0.382
S1 := PP - (phigh - plow) * 0.382
R2 := PP + (phigh - plow) * 0.618
S2 := PP - (phigh - plow) * 0.618
R3 := PP + (phigh - plow) * 1.000
S3 := PP - (phigh - plow) * 1.000
S3
if pp_type == 'Woodie'
PP := (phigh + plow + 2 * popen) / 4
R1 := PP + PP - plow
S1 := PP - (phigh - PP)
R2 := PP + phigh - plow
S2 := PP - (phigh - plow)
R3 := phigh + 2 * (PP - plow)
S3 := plow - 2 * (phigh - PP)
S3
if pp_type == 'Camarilla'
PP := (phigh + plow + pclose) / 3
R1 := pclose + (phigh - plow) * 1.1 / 12
S1 := pclose - (phigh - plow) * 1.1 / 12
R2 := pclose + (phigh - plow) * 1.1 / 6
S2 := pclose - (phigh - plow) * 1.1 / 6
R3 := pclose + (phigh - plow) * 1.1 / 4
S3 := pclose - (phigh - plow) * 1.1 / 4
S3
// Projected levels
prPP = 0.0
prR1 = 0.0
prR2 = 0.0
prR3 = 0.0
prS1 = 0.0
prS2 = 0.0
prS3 = 0.0
if pp_type == 'Traditional'
prPP := (high_cur + low_cur + close) / 3
prR1 := prPP + prPP - low_cur
prS1 := prPP - (high_cur - PP)
prR2 := prPP + high_cur - low_cur
prS2 := prPP - (high_cur - low_cur)
prR3 := phigh + 2 * (prPP - low_cur)
prS3 := plow - 2 * (high_cur - PP)
prS3
//////////////
// PLOTTING //
bars_sinse = 0
bars_sinse := is_newbar(pp_res) ? 0 : bars_sinse[1] + 1
////////////////////////
// PLOT PIVOTS LEVELS //
// Add labels
label_vpp = label.new(bar_index, PP, text=show_level_value ? 'P' + ' ' +
str.tostring(nround(PP)) : 'P', style=label.style_none, textcolor=#b2b5be)
label_vs1 = label.new(bar_index, S1, text=show_level_value ? 'S1' + ' ' +
str.tostring(nround(S1)) : 'S1', style=label.style_none, textcolor=#b2b5be)
label_vs2 = label.new(bar_index, S2, text=show_level_value ? 'S2' + ' ' +
str.tostring(nround(S2)) : 'S2', style=label.style_none, textcolor=#b2b5be)
label_vs3 = label.new(bar_index, S3, text=show_level_value ? 'S3' + ' ' +
str.tostring(nround(S3)) : 'S3', style=label.style_none, textcolor=#b2b5be)
label_vr1 = label.new(bar_index, R1, text=show_level_value ? 'R1' + ' ' +
str.tostring(nround(R1)) : 'R1', style=label.style_none, textcolor=#b2b5be)
label_vr2 = label.new(bar_index, R2, text=show_level_value ? 'R2' + ' ' +
str.tostring(nround(R2)) : 'R2', style=label.style_none, textcolor=#b2b5be)
label_vr3 = label.new(bar_index, R3, text=show_level_value ? 'R3' + ' ' +
str.tostring(nround(R3)) : 'R3', style=label.style_none, textcolor=#b2b5be)
label.delete(label_vpp[1])
label.delete(label_vs1[1])
label.delete(label_vs2[1])
label.delete(label_vs3[1])
label.delete(label_vr1[1])
label.delete(label_vr2[1])
label.delete(label_vr3[1])
// Projected levels
line vpp_pr = na
line vs1_pr = na
line vs2_pr = na
line vs3_pr = na
line vr1_pr = na
line vr2_pr = na
line vr3_pr = na
if show_current_levels
line.delete(vpp_pr[1])
line.delete(vs1_pr[1])
line.delete(vs2_pr[1])
line.delete(vs3_pr[1])
line.delete(vr1_pr[1])
line.delete(vr2_pr[1])
line.delete(vr3_pr[1])
// Get components
rb = 10
prd = 284
ChannelW = 10
label_loc = 55
style1 = lineStyle1 == "Solid" ? line.style_solid : lineStyle1 == "Dotted" ?
line.style_dotted : line.style_dashed
ph = ta.pivothigh(rb, rb)
pl = ta.pivotlow (rb, rb)
sr_levels = array.new_float(21, na)
prdhighest = ta.highest(prd)
prdlowest = ta.lowest(prd)
cwidth = percWidth(prd, ChannelW)
zonePerc = percWidth(300, zoneWidth)
aas = array.new_bool(41, true)
u1 = 0.0, u1 := nz(u1[1])
d1 = 0.0, d1 := nz(d1[1])
highestph = 0.0, highestph := highestph[1]
lowestpl = 0.0, lowestpl := lowestpl[1]
var sr_levs = array.new_float(21, na)
label hlabel = na, label.delete(hlabel[1])
label llabel = na, label.delete(llabel[1])
var sr_lines = array.new_line(21, na)
var sr_linesH = array.new_line(21, na)
var sr_linesL = array.new_line(21, na)
var sr_linesF = array.new_linefill(21, na)
var sr_labels = array.new_label(21, na)
if ph or pl
for x = 0 to array.size(sr_levels) - 1
array.set(sr_levels, x, na)
highestph := prdlowest
lowestpl := prdhighest
countpp = 0
for x = 0 to prd
if na(close[x])
break
if not na(ph[x]) or not na(pl[x])
highestph := math.max(highestph, nz(ph[x], prdlowest), nz(pl[x],
prdlowest))
lowestpl := math.min(lowestpl, nz(ph[x], prdhighest), nz(pl[x],
prdhighest))
countpp += 1
if countpp > 40
break
if array.get(aas, countpp)
upl = (ph[x] ? high[x + rb] : low[x + rb]) + cwidth
dnl = (ph[x] ? high[x + rb] : low[x + rb]) - cwidth
u1 := countpp == 1 ? upl : u1
d1 := countpp == 1 ? dnl : d1
tmp = array.new_bool(41, true)
cnt = 0
tpoint = 0
for xx = 0 to prd
if na(close[xx])
break
if not na(ph[xx]) or not na(pl[xx])
chg = false
cnt += 1
if cnt > 40
break
if array.get(aas, cnt)
if not na(ph[xx])
if high[xx + rb] <= upl and high[xx + rb] >= dnl
tpoint += 1
chg := true
if not na(pl[xx])
if low[xx + rb] <= upl and low[xx + rb] >= dnl
tpoint += 1
chg := true
if chg and cnt < 41
array.set(tmp, cnt, false)
if tpoint >= strengthSR
for g = 0 to 40 by 1
if not array.get(tmp, g)
array.set(aas, g, false)
if ph[x] and countpp < 21
array.set(sr_levels, countpp, high[x + rb])
if pl[x] and countpp < 21
array.set(sr_levels, countpp, low[x + rb])
// Plot
var line highest_ = na, line.delete(highest_)
var line lowest_ = na, line.delete(lowest_)
var line highest_fill1 = na, line.delete(highest_fill1)
var line highest_fill2 = na, line.delete(highest_fill2)
var line lowest_fill1 = na, line.delete(lowest_fill1)
var line lowest_fill2 = na, line.delete(lowest_fill2)
hi_col = close >= highestph ? colorSup : colorRes
lo_col = close >= lowestpl ? colorSup : colorRes
if enableSR
highest_ := line.new(bar_index - 311, highestph, bar_index, highestph,
xloc.bar_index, expandSR ? extend.both : extend.right, hi_col, style1, lineWidth1)
lowest_ := line.new(bar_index - 311, lowestpl , bar_index, lowestpl ,
xloc.bar_index, expandSR ? extend.both : extend.right, lo_col, style1, lineWidth1)
if useHLZones
highest_fill1 := line.new(bar_index - 311, highestph + zonePerc, bar_index,
highestph + zonePerc, xloc.bar_index, expandSR ? extend.both : extend.right, na)
highest_fill2 := line.new(bar_index - 311, highestph - zonePerc, bar_index,
highestph - zonePerc, xloc.bar_index, expandSR ? extend.both : extend.right, na)
lowest_fill1 := line.new(bar_index - 311, lowestpl + zonePerc , bar_index,
lowestpl + zonePerc , xloc.bar_index, expandSR ? extend.both : extend.right, na)
lowest_fill2 := line.new(bar_index - 311, lowestpl - zonePerc , bar_index,
lowestpl - zonePerc , xloc.bar_index, expandSR ? extend.both : extend.right, na)
linefill.new(highest_fill1, highest_fill2, color.new(hi_col, 90))
linefill.new(lowest_fill1 , lowest_fill2 , color.new(lo_col, 90))
if ph or pl
for x = 0 to array.size(sr_lines) - 1
array.set(sr_levs, x, array.get(sr_levels, x))
for x = 0 to array.size(sr_lines) - 1
line.delete(array.get(sr_lines, x))
line.delete(array.get(sr_linesH, x))
line.delete(array.get(sr_linesL, x))
linefill.delete(array.get(sr_linesF, x))
if array.get(sr_levs, x) and enableSR
line_col = close >= array.get(sr_levs, x) ? colorSup : colorRes
array.set(sr_lines, x, line.new(bar_index - 355, array.get(sr_levs, x),
bar_index, array.get(sr_levs, x), xloc.bar_index, expandSR ? extend.both :
extend.right, line_col, style1, lineWidth1))
if useZones
array.set(sr_linesH, x, line.new(bar_index - 355, array.get(sr_levs, x)
+ zonePerc, bar_index, array.get(sr_levs, x) + zonePerc, xloc.bar_index, expandSR ?
extend.both : extend.right, na))
array.set(sr_linesL, x, line.new(bar_index - 355, array.get(sr_levs, x)
- zonePerc, bar_index, array.get(sr_levs, x) - zonePerc, xloc.bar_index, expandSR ?
extend.both : extend.right, na))
array.set(sr_linesF, x, linefill.new(array.get(sr_linesH, x),
array.get(sr_linesL, x), color.new(line_col, 90)))
for x = 0 to array.size(sr_labels) - 1
label.delete(array.get(sr_labels, x))
if array.get(sr_levs, x) and enableSR
lab_loc = close >= array.get(sr_levs, x) ? label.style_label_up :
label.style_label_down
lab_col = close >= array.get(sr_levs, x) ? colorSup : colorRes
import Fontiramisu/fontilab/12 as fontilab
// import Fontiramisu/fontLib/87 as fontilab
if not na(dupIsHighLast)
lineLast := dupLineLast
isHighLast := dupIsHighLast
iPrev := dupIPrev
iLast := dupILast
pLast := dupPLast
pLastHigh := dupPLastHigh
pLastLow := dupPLastLow
isPivotFound := true
labelOffset = rightOffset - 5
if isfib0000
line.delete(fib0000Line)
label.delete(fib0000Label)
fib0000Line := line.new(barLastUpdate - leftOffset, fib0000, bar_index +
rightOffset, fib0000, xloc=xloc.bar_index, color=isColorAll ? colorAll :
colorFib0000, width=1)
fib0000Label := label.new(x=bar_index + labelOffset, y = fib0000,
xloc=xloc.bar_index, text=str.tostring(nFib0000), style=label.style_none,
size=size.small, textcolor=isColorAll ? colorAll : colorFib0000,
textalign=text.align_center)
if isfib0206
line.delete(fib0206Line)
label.delete(fib0206Label)
fib0206Line := line.new(barLastUpdate - leftOffset, fib0206, bar_index +
rightOffset, fib0206, xloc=xloc.bar_index, color=isColorAll ? colorAll :
colorFib0206, width=1)
fib0206Label := label.new(x=bar_index + labelOffset, y = fib0206,
xloc=xloc.bar_index, text=str.tostring(nFib0206), style=label.style_none,
size=size.small, textcolor=isColorAll ? colorAll : colorFib0206,
textalign=text.align_center)
if isfib0382
line.delete(fib0382Line)
label.delete(fib0382Label)
fib0382Line := line.new(barLastUpdate - leftOffset, fib0382, bar_index +
rightOffset, fib0382, xloc=xloc.bar_index, color=isColorAll ? colorAll :
colorFib0382, width=1)
fib0382Label := label.new(x=bar_index + labelOffset, y = fib0382,
xloc=xloc.bar_index, text=str.tostring(nFib0382), style=label.style_none,
size=size.small, textcolor=isColorAll ? colorAll : colorFib0382,
textalign=text.align_center)
if isfib0500
line.delete(fib0500Line)
label.delete(fib0500Label)
fib0500Line := line.new(barLastUpdate - leftOffset, fib0500, bar_index +
rightOffset, fib0500, xloc=xloc.bar_index, color=isColorAll ? colorAll :
colorFib0500, width=1)
fib0500Label := label.new(x=bar_index + labelOffset, y = fib0500,
xloc=xloc.bar_index, text=str.tostring(nFib0500), style=label.style_none,
size=size.small, textcolor=isColorAll ? colorAll : colorFib0500,
textalign=text.align_center)
if isfib0618
line.delete(fib0618Line)
label.delete(fib0618Label)
fib0618Line := line.new(barLastUpdate - leftOffset, fib0618, bar_index +
rightOffset, fib0618, xloc=xloc.bar_index, color=isColorAll ? colorAll :
colorFib0618, width=1)
fib0618Label := label.new(x=bar_index + labelOffset, y = fib0618,
xloc=xloc.bar_index, text=str.tostring(nFib0618), style=label.style_none,
size=size.small, textcolor=isColorAll ? colorAll : colorFib0618,
textalign=text.align_center)
if isfib0786
line.delete(fib0786Line)
label.delete(fib0786Label)
fib0786Line := line.new(barLastUpdate - leftOffset, fib0786, bar_index +
rightOffset, fib0786, xloc=xloc.bar_index, color=isColorAll ? colorAll :
colorFib0786, width=1)
fib0786Label := label.new(x=bar_index + labelOffset, y = fib0786,
xloc=xloc.bar_index, text=str.tostring(nFib0786), style=label.style_none,
size=size.small, textcolor=isColorAll ? colorAll : colorFib0786,
textalign=text.align_center)
if isfib1000
line.delete(fib1000Line)
label.delete(fib1000Label)
fib1000Line := line.new(barLastUpdate - leftOffset, fib1000, bar_index +
rightOffset, fib1000, xloc=xloc.bar_index, color=isColorAll ? colorAll :
colorFib1000, width=1)
fib1000Label := label.new(x=bar_index + labelOffset, y = fib1000,
xloc=xloc.bar_index, text=str.tostring(nFib1000), style=label.style_none,
size=size.small, textcolor=isColorAll ? colorAll : colorFib1000,
textalign=text.align_center)
if isfib1414
line.delete(fib1414Line)
label.delete(fib1414Label)
fib1414Line := line.new(barLastUpdate - leftOffset, fib1414, bar_index +
rightOffset, fib1414, xloc=xloc.bar_index, color=isColorAll ? colorAll :
colorFib1414, width=1)
fib1414Label := label.new(x=bar_index + labelOffset, y = fib1414,
xloc=xloc.bar_index, text=str.tostring(nFib1414), style=label.style_none,
size=size.small, textcolor=isColorAll ? colorAll : colorFib1414,
textalign=text.align_center)
if isfib1618
line.delete(fib1618Line)
label.delete(fib1618Label)
fib1618Line := line.new(barLastUpdate - leftOffset, fib1618, bar_index +
rightOffset, fib1618, xloc=xloc.bar_index, color=isColorAll ? colorAll :
colorFib1618, width=1)
fib1618Label := label.new(x=bar_index + labelOffset, y = fib1618,
xloc=xloc.bar_index, text=str.tostring(nFib1618), style=label.style_none,
size=size.small, textcolor=isColorAll ? colorAll : colorFib1618,
textalign=text.align_center)
if isfib2000
line.delete(fib2000Line)
label.delete(fib2000Label)
fib2000Line := line.new(barLastUpdate - leftOffset, fib2000, bar_index +
rightOffset, fib2000, xloc=xloc.bar_index, color=isColorAll ? colorAll :
colorFib2000, width=1)
fib2000Label := label.new(x=bar_index + labelOffset, y = fib2000,
xloc=xloc.bar_index, text=str.tostring(nFib2000), style=label.style_none,
size=size.small, textcolor=isColorAll ? colorAll : colorFib2000,
textalign=text.align_center)
if isfib2618
line.delete(fib2618Line)
label.delete(fib2618Label)
fib2618Line := line.new(barLastUpdate - leftOffset, fib2618, bar_index +
rightOffset, fib2618, xloc=xloc.bar_index, color=isColorAll ? colorAll :
colorFib2618, width=1)
fib2618Label := label.new(x=bar_index + labelOffset, y = fib2618,
xloc=xloc.bar_index, text=str.tostring(nFib2618), style=label.style_none,
size=size.small, textcolor=isColorAll ? colorAll : colorFib2618,
textalign=text.align_center)
// ]