bar tanımlama kodu..
PHP Code:
//@version=5
indicator(title="T3MA Ribbon R4.2 + SAR + 200 EMA", shorttitle=".", overlay=true, max_bars_back = 4, max_labels_count = 1)
is_outside_bar() => high[1] < high and low[1] > low
is_inside_bar() => high[1] > high and low[1] < low
is_buy_pin_bar() => (not is_inside_bar()) and (high - math.max(open, close)) * 2 < math.min(open,close) - low and (math.max(open,close) - math.min(open,close)) * 2 < math.min(open,close) - low
is_sell_pin_bar() => (not is_inside_bar()) and (math.min(open, close) - low) * 2 < high - math.max(open,close) and (math.max(open,close) - math.min(open,close)) * 2 < high - math.max(open,close)
is_sell_ppr() => open[1] < close[1] and open > close and low[1] > close
is_buy_ppr() => open[1] > close[1] and open < close and high[1] < close
is_sell_fakey() => open[2] > close[2] and open[1] < close[1] and open > close and high[2] > high[1] and low[2] < low[1] and high[1] < high and low[1] >= low
is_buy_fakey() => open[2] < close[2] and open[1] > close[1] and open < close and high[2] > high[1] and low[2] < low[1] and low[1] > low and high[1] <= high
draw_buy_text(message = "") => label.new(bar_index, high, message, style=label.style_label_down,textcolor=color.white, tooltip = message)
draw_sell_text(message = "") => label.new(bar_index, low, message, style=label.style_label_up, color=color.orange, textcolor = color.white, tooltip = message)
draw_text(message = "") => label.new(bar_index, high, message, color=color.gray, textcolor = color.white, tooltip = message)
if is_inside_bar()
draw_text("IB")
if is_outside_bar()
draw_text("OB")
if is_sell_fakey()
draw_sell_text("FS")
if is_buy_fakey()
draw_buy_text("FB")
if is_buy_ppr()
draw_buy_text("B")
if is_sell_ppr()
draw_sell_text("S")
if is_buy_pin_bar()
draw_buy_text("PB")
if is_sell_pin_bar()
draw_sell_text("PS")
///////
Yer İmleri