OPEN-SOURCE SCRIPT
💎 ProfittoPath – Glass HUD

//version=5
indicator("💎 ProfittoPath – Glass HUD", overlay=true)
// === Inputs ===
entryPrice = input.float(0.0, "Entry Price", step=0.01)
qty = input.float(1.0, "Position Size", step=1.0)
isLong = input.bool(true, "Long Trade?")
offsetY = input.int(60, "Vertical Offset (ticks)", step=1)
showPercent = input.bool(true, "Show % Change")
// === Calculations ===
inTrade = entryPrice > 0
priceDiff = inTrade ? (close - entryPrice) * (isLong ? 1 : -1) : na
plUsd = inTrade ? priceDiff * qty : na
plPercent = inTrade ? (priceDiff / entryPrice) * 100 : na
isProfit = inTrade ? (plUsd >= 0) : false
// === Colors ===
gold = color.rgb(255,215,0)
lossRed = color.rgb(255,90,90)
txtColor = isProfit ? gold : lossRed
bgGlass = color.new(color.rgb(15,15,15),85)
// === Entry Line ===
var line entryLine = na
if barstate.isfirst
entryLine := line.new(bar_index, entryPrice, bar_index, entryPrice, extend=extend.both, color=color.new(gold,40), style=line.style_dotted)
if inTrade
line.set_color(entryLine, color.new(gold,40))
else
line.set_color(entryLine, color.new(color.black,100))
// === Panel Label ===
var label pnlLabel = na
if barstate.isfirst
pnlLabel := label.new(bar_index, na, "", style=label.style_label_center, textcolor=txtColor, color=bgGlass, size=size.large)
// === Update ===
if inTrade
string pnlText = "💎 ProfittoPath Glass HUD\n"
pnlText += "────────────────────────\n"
pnlText += "Trade: " + (isLong ? "LONG 📈" : "SHORT 📉") + "\n"
pnlText += "Entry: " + str.tostring(entryPrice, format.mintick) + "\n"
pnlText += "Current: " + str.tostring(close, format.mintick) + "\n"
pnlText += "P/L: " + (isProfit ? "+" : "") + str.tostring(plUsd, format.mintick) + " USD"
if showPercent
pnlText += " (" + str.tostring(plPercent, "#.##") + "%)"
pnlText += "\n"
pnlText += "────────────────────────\n"
pnlText += "Status: " + (isProfit ? "PROFIT ✅" : "LOSS ❌")
label.set_text(pnlLabel, pnlText)
label.set_x(pnlLabel, bar_index)
label.set_y(pnlLabel, entryPrice + offsetY * syminfo.mintick)
label.set_color(pnlLabel, bgGlass)
label.set_textcolor(pnlLabel, txtColor)
else
label.set_text(pnlLabel, "💎 Set Entry Price ↑")
label.set_x(pnlLabel, bar_index)
label.set_y(pnlLabel, close)
label.set_color(pnlLabel, bgGlass)
label.set_textcolor(pnlLabel, gold)
indicator("💎 ProfittoPath – Glass HUD", overlay=true)
// === Inputs ===
entryPrice = input.float(0.0, "Entry Price", step=0.01)
qty = input.float(1.0, "Position Size", step=1.0)
isLong = input.bool(true, "Long Trade?")
offsetY = input.int(60, "Vertical Offset (ticks)", step=1)
showPercent = input.bool(true, "Show % Change")
// === Calculations ===
inTrade = entryPrice > 0
priceDiff = inTrade ? (close - entryPrice) * (isLong ? 1 : -1) : na
plUsd = inTrade ? priceDiff * qty : na
plPercent = inTrade ? (priceDiff / entryPrice) * 100 : na
isProfit = inTrade ? (plUsd >= 0) : false
// === Colors ===
gold = color.rgb(255,215,0)
lossRed = color.rgb(255,90,90)
txtColor = isProfit ? gold : lossRed
bgGlass = color.new(color.rgb(15,15,15),85)
// === Entry Line ===
var line entryLine = na
if barstate.isfirst
entryLine := line.new(bar_index, entryPrice, bar_index, entryPrice, extend=extend.both, color=color.new(gold,40), style=line.style_dotted)
if inTrade
line.set_color(entryLine, color.new(gold,40))
else
line.set_color(entryLine, color.new(color.black,100))
// === Panel Label ===
var label pnlLabel = na
if barstate.isfirst
pnlLabel := label.new(bar_index, na, "", style=label.style_label_center, textcolor=txtColor, color=bgGlass, size=size.large)
// === Update ===
if inTrade
string pnlText = "💎 ProfittoPath Glass HUD\n"
pnlText += "────────────────────────\n"
pnlText += "Trade: " + (isLong ? "LONG 📈" : "SHORT 📉") + "\n"
pnlText += "Entry: " + str.tostring(entryPrice, format.mintick) + "\n"
pnlText += "Current: " + str.tostring(close, format.mintick) + "\n"
pnlText += "P/L: " + (isProfit ? "+" : "") + str.tostring(plUsd, format.mintick) + " USD"
if showPercent
pnlText += " (" + str.tostring(plPercent, "#.##") + "%)"
pnlText += "\n"
pnlText += "────────────────────────\n"
pnlText += "Status: " + (isProfit ? "PROFIT ✅" : "LOSS ❌")
label.set_text(pnlLabel, pnlText)
label.set_x(pnlLabel, bar_index)
label.set_y(pnlLabel, entryPrice + offsetY * syminfo.mintick)
label.set_color(pnlLabel, bgGlass)
label.set_textcolor(pnlLabel, txtColor)
else
label.set_text(pnlLabel, "💎 Set Entry Price ↑")
label.set_x(pnlLabel, bar_index)
label.set_y(pnlLabel, close)
label.set_color(pnlLabel, bgGlass)
label.set_textcolor(pnlLabel, gold)
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.