lossBox := box.new(left = bar_index, top = lossTop, right = lineEnd… — TRADING SIGNAL FREE — TG.ME

lossBox := box.new(left = bar_index, top = lossTop, right = lineEnd, bottom = lossBottom, bgcolor = lossFillColor, border_width = 0) // ═══════════════════════════════════════ // TP/SL HIT STATUS & TICK UPDATES // ═══════════════════════════════════════ if tradeDir == 1 if useTp1 and high >= tradeTp1 and not tp1Hit tp1Hit := true if not na(lineTp1) line.set_color(lineTp1, color.green) line.set_style(lineTp1, line.style_solid) if not na(lbTp1) label.set_text(lbTp1, 'TP1 ✓') label.set_color(lbTp1, color.new(color.green, 40)) if useTp2 and high >= tradeTp2 and not tp2Hit tp2Hit := true if not na(lineTp2) line.set_color(lineTp2, color.green) line.set_style(lineTp2, line.style_solid) if not na(lbTp2) label.set_text(lbTp2, 'TP2 ✓') label.set_color(lbTp2, color.new(color.green, 40)) if useTp3 and high >= tradeTp3 and not tp3Hit tp3Hit := true if not na(lineTp3) line.set_color(lineTp3, color.green) line.set_style(lineTp3, line.style_solid) if not na(lbTp3) label.set_text(lbTp3, 'TP3 ✓') label.set_color(lbTp3, color.new(color.green, 40)) if low <= tradeSl and not slHit slHit := true line.set_color(lineSL, color.red) label.set_text(lbSL, 'SL ✕') label.set_color(lbSL, color.new(color.red, 40)) if tradeDir == -1 if useTp1 and low <= tradeTp1 and not tp1Hit tp1Hit := true if not na(lineTp1) line.set_color(lineTp1, color.green) line.set_style(lineTp1, line.style_solid) if not na(lbTp1) label.set_text(lbTp1, 'TP1 ✓') label.set_color(lbTp1, color.new(color.green, 40)) if useTp2 and low <= tradeTp2 and not tp2Hit tp2Hit := true if not na(lineTp2) line.set_color(lineTp2, color.green) line.set_style(lineTp2, line.style_solid) if not na(lbTp2) label.set_text(lbTp2, 'TP2 ✓') label.set_color(lbTp2, color.new(color.green, 40)) if useTp3 and low <= tradeTp3 and not tp3Hit tp3Hit := true if not na(lineTp3) line.set_color(lineTp3, color.green) line.set_style(lineTp3, line.style_solid) if not na(lbTp3) label.set_text(lbTp3, 'TP3 ✓') label.set_color(lbTp3, color.new(color.green, 40)) if high >= tradeSl and not slHit slHit := true line.set_color(lineSL, color.red) label.set_text(lbSL, 'SL ✕') label.set_color(lbSL, color.new(color.red, 40)) // ═══════════════════════════════════════ // AUTO EXPAND LINES // ═══════════════════════════════════════ tradeFinished = (useTp3 ? tp3Hit : (useTp2 ? tp2Hit : (useTp1 ? tp1Hit : false))) or slHit if tradeDir != 0 and not na(lineEntry) dynamicEnd = tradeFinished ? line.get_x2(lineEntry) : bar_index + labelOffset line.set_x2(lineEntry, dynamicEnd) line.set_x2(lineSL, dynamicEnd) if not na(lineTp1) line.set_x2(lineTp1, dynamicEnd) if not na(lineTp2) line.set_x2(lineTp2, dynamicEnd) if not na(lineTp3) line.set_x2(lineTp3, dynamicEnd) labelPos = dynamicEnd + 2 label.set_x(lbEntry, labelPos) label.set_x(lbSL, labelPos) if not na(lbTp1) label.set_x(lbTp1, labelPos) if not na(lbTp2) label.set_x(lbTp2, labelPos) if not na(lbTp3) label.set_x(lbTp3, labelPos) box.set_right(profitBox, dynamicEnd) box.set_right(lossBox, dynamicEnd) alertcondition(buySignal, title='Buy Signal', message='KN Buy Signal') alertcondition(sellSignal, title='Sell Signal', message='KN Sell Signal')

August 14, 2026 37