
WCloseLine := line.new(wFrom, wClose, wTo, wClose, color=f_set_color(wColor), extend=extend.right, width=wWidth, style=f_set_style(wStyle)) WClose = wValue = "Previous Week" ? security(syminfo.tickerid, 'W', close, gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on) : security(syminfo.tickerid, 'W', close, gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on)ĭClose = dValue = "Previous Day" ? security(syminfo.tickerid, 'D', close, gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on) : security(syminfo.tickerid, 'D', close, gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on)į_calc_bar_time(offset) => ret = time + ((time-time) * offset) ShowDaily = input(true, type=input.bool, title="Show Daily?")ĭValue = input("Previous Day", title="Candle Selection", options=)ĭColor = input("blue", title="Daily color", options=)ĭStyle = input("solid", title="Daily style", options=) WStyle = input("solid", title="Weekly style", options=) WColor = input("orange", title="Weekly color", options=) WValue = input("Previous Week", title="Candle Selection", options=) ShowWeekly = input(true, type=input.bool, title="Show Weekly?") lblOffset = input(30, title="Label Offset") I have followed the same procedure but I am probably missing something important.
Xloc keyword code#
I already added a ready code for Labeled Daily and weekly close horizontal lines and tried to use the "same" code for this, but nothing seems to work.

Now I want to label these horizontal EMA lines with 10, 21 EMA etc. Plot(veryslowema, color=show_emas ? color_veryslowema : na, linewidth=2, title="Veryslow EMA") Plot(slowema, color=show_emas ? color_slowema : na, linewidth=2, title="Slow EMA") Plot(mediumema, color=show_emas ? color_mediumema : na, linewidth=2, title="Medium EMA") Plot(fastema, color=show_emas ? color_fastema : na, linewidth=2, title="Fast EMA") Plot(entryema, color=show_emas ? color_entryema : na, linewidth=2, title="Entry EMA") If (hour=0 and minute=0 and year(time)=year(timenow) and month(time)=month(timenow) and dayofmonth(time)=dayofmonth(timenow))į_moveLine(line_entryema, time, entryema)į_moveLine(line_mediumema, time, mediumema)į_moveLine(line_veryslowema, time, veryslowema) Var line_veryslowema = line.new(x1=na, y1=na, x2=na, y2=na, xloc=xloc.bar_time, extend=extend.both, color=show_hlines ? color_veryslowema : na, style=line.style_solid) Var line_slowema = line.new(x1=na, y1=na, x2=na, y2=na, xloc=xloc.bar_time, extend=extend.both, color=show_hlines ? color_slowema : na, style=line.style_solid) Var line_mediumema = line.new(x1=na, y1=na, x2=na, y2=na, xloc=xloc.bar_time, extend=extend.both, color=show_hlines ? color_mediumema : na, style=line.style_solid) Var line_fastema = line.new(x1=na, y1=na, x2=na, y2=na, xloc=xloc.bar_time, extend=extend.both, color=show_hlines ? color_fastema : na, style=line.style_solid) Var line_entryema = line.new(x1=na, y1=na, x2=na, y2=na, xloc=xloc.bar_time, extend=extend.both, color=show_hlines ? color_entryema : na, style=line.style_solid) Var bool show_hlines = input(true, "Show horizontal lines", input.bool) Len3 = input(55, minval=1, title="Length")

Len2 = input(21, minval=1, title="Length") Len1 = input(10, minval=1, title="Length")
