Professional Documents
Culture Documents
if (crossover(out, out2))
strategy.entry("MacdLE", strategy.long, when=strategy.position_size <= 0,
comment="MacdLE")
ob_period = periods + 1
absmove = ((abs(close[ob_period] - close[1]))/close[ob_period]) * 100
relmove = absmove >= threshold
line.delete(linebull2)
linebull2 := line.new(x1=bar_index, y1=OB_bull_high, x2=bar_index-1,
y2=OB_bull_high, extend=extend.left, color=bullcolor, style=line.style_dashed,
width=1)
line.delete(linebull3)
linebull3 := line.new(x1=bar_index, y1=OB_bull_low, x2=bar_index-1,
y2=OB_bull_low, extend=extend.left, color=bullcolor, style=line.style_dashed,
width=1)
line.delete(linebear2)
linebear2 := line.new(x1=bar_index, y1=OB_bear_high, x2=bar_index-1,
y2=OB_bear_high, extend=extend.left, color=bearcolor, style=line.style_dashed,
width=1)
line.delete(linebear3)
linebear3 := line.new(x1=bar_index, y1=OB_bear_low, x2=bar_index-1,
y2=OB_bear_low, extend=extend.left, color=bearcolor, style=line.style_dashed,
width=1)
if OB_bull_high > 0
latest_bull_high := OB_bull_high
if OB_bull_avg > 0
latest_bull_avg := OB_bull_avg
if OB_bull_low > 0
latest_bull_low := OB_bull_low
if OB_bear_high > 0
latest_bear_high := OB_bear_high
if OB_bear_avg > 0
latest_bear_avg := OB_bear_avg
if OB_bear_low > 0
latest_bear_low := OB_bear_low
panel_text = '\n' + title + '\n' + row0 + '\n' + row1 + '\n' + row2 + '\n' + row3 +
'\n' + row4 + '\n\n' + row5 + '\n' + row6 + '\n' + row7 + '\n'
if info_pan
draw_InfoPanel(panel_text, info_panel_x, info_panel_y, size.normal)
if showdocu
l_docu := label.new(x=time + chper * 35, y=close, text="DOCU OB",
color=color.gray, textcolor=color.white, style=label.style_label_center,
xloc=xloc.bar_time, yloc=yloc.price, size=size.tiny, textalign=text.align_left,
tooltip=vartooltip)