l_tp2 :=
line.new(bar_index, tp2Px, bar_index + 1, tp2Px, color=
color.new(#00C853, 0), width=2)
lb_entry :=
label.new(bar_index + 1, close,
" Entry $" + str.tostring(math.round(close, 2)),
style=label.style_label_right, color=
color.new(#1565C0, 10), textcolor=color.white, size=size.small)
lb_sl :=
label.new(bar_index + 1, slPx,
" SL $" + str.tostring(math.round(slPx, 2)),
style=label.style_label_right, color=
color.new(
color.red, 10), textcolor=color.white, size=size.small)
lb_tp1 :=
label.new(bar_index + 1, tp1Px,
" TP1 (" + str.tostring(i_rr1) + "R) $" + str.tostring(math.round(tp1Px, 2)),
style=label.style_label_right, color=
color.new(#00C853, 30), textcolor=color.white, size=size.small)
lb_tp2 :=
label.new(bar_index + 1, tp2Px,
" TP2 (" + str.tostring(i_rr2) + "R) $" + str.tostring(math.round(tp2Px, 2)),
style=label.style_label_right, color=
color.new(#00C853, 10), textcolor=color.white, size=size.small)
awaitBull := false
fvgTop := na
fvgBot := na
cePx := na
// ══════════════════════════════════════════════════════════════════════════════
// ░░ SHORT EXECUTION + LEVEL VISUALISATION
// ══════════════════════════════════════════════════════════════════════════════
if shortEntry
slPx = fvgTop + i_slAtrMult * atr14
risk = slPx - close
tp1Px = close - risk * i_rr1
tp2Px = close - risk * i_rr2
entryPx := close
activeSL := slPx
activeTP1:= tp1Px
activeTP2:= tp2Px
strategy.entry("Short", strategy.short,
comment="FVG Short (" + str.tostring(setupScore) + "/7)")
strategy.exit("Short TP1", from_entry="Short",
qty_percent=i_tp1Pct, limit=tp1Px, stop=slPx,
comment="TP1 $" + str.tostring(math.round(tp1Px, 2)))
strategy.exit("Short TP2", from_entry="Short",
qty_percent=100, limit=tp2Px, stop=slPx,
comment="TP2 $" + str.tostring(math.round(tp2Px, 2)))
if i_showLevels
line.delete(l_entry)
line.delete(l_sl)
line.delete(l_tp1)
line.delete(l_tp2)
label.delete(lb_entry)
label.delete(lb_sl)
label.delete(lb_tp1)
label.delete(lb_tp2)
l_entry :=
line.new(bar_index, close, bar_index + 1, close, color=#1565C0, width=2)
l_sl :=
line.new(bar_index, slPx, bar_index + 1, slPx, color=
color.red, width=1, style=line.style_dashed)
l_tp1 :=
line.new(bar_index, tp1Px, bar_index + 1, tp1Px, color=
color.new(#00C853, 0), width=1, style=line.style_dashed)
l_tp2 :=
line.new(bar_index, tp2Px, bar_index + 1, tp2Px, color=
color.new(#00C853, 0), width=2)
lb_entry :=
label.new(bar_index + 1, close,
" Entry $" + str.tostring(math.round(close, 2)),
style=label.style_label_right, color=
color.new(#1565C0, 10), textcolor=color.white, size=size.small)
lb_sl :=
label.new(bar_index + 1, slPx,
" SL $" + str.tostring(math.round(slPx, 2)),
style=label.style_label_right, color=
color.new(
color.red, 10), textcolor=color.white, size=size.small)
lb_tp1 :=
label.new(bar_index + 1, tp1Px,
" TP1 (" + str.tostring(i_rr1) + "R) $" + str.tostring(math.round(tp1Px, 2)),
style=label.style_label_right, color=
color.new(#00C853, 30), textcolor=color.white, size=size.small)
lb_tp2 :=
label.new(bar_index + 1, tp2Px,
" TP2 (" + str.tostring(i_rr2) + "R) $" + str.tostring(math.round(tp2Px, 2)),
style=label.style_label_right, color=
color.new(#00C853, 10), textcolor=color.white, size=size.small)
awaitBear := false
fvgTop := na
fvgBot := na
cePx := na
// ══════════════════════════════════════════════════════════════════════════════
// ░░ EXTEND LEVEL LINES WHILE TRADE IS LIVE