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)
ืกืงืจืืคื ืงืื ืคืชืื
ืืจืื TradingView ืืืืชืืช, ืืืืฆืจ ืฉื ืืกืงืจืืคื ืืื ืืคื ืืืชื ืืงืื ืคืชืื, ืื ืฉืกืืืจืื ืืืืืื ืืืืืง ืืืืืช ืืช ืืคืื ืงืฆืืื ืืืืช ืฉืื. ืื ืืืืื ืืืืืจ! ืืืจืืช ืฉืืชื ืืืื ืืืฉืชืืฉ ืื ืืืื ื, ืืืืจ ืฉืคืจืกืื ืืืืฉ ืฉื ืืงืื ืืคืืฃ ืืืืื ืืืืช ืฉืื ื.
ืืชื ืืืชืืจ
ืืืืืข ืืืคืจืกืืืื ืืื ื ืืืืจืื ืืืืืช, ืืืื ื ืืืืืื, ืขืฆืืช ืคืื ื ืกืืืช, ืืฉืงืขืืช, ืืกืืจ ืื ืกืืืื ืืืจืื ืฉื ืขืฆืืช ืื ืืืืฆืืช ืฉืกืืคืงื ืื ืืืืฉืจืื ืขื ืืื TradingView. ืงืจื ืขืื ืืชื ืืื ืืืืืืืืช.
ืกืงืจืืคื ืงืื ืคืชืื
ืืจืื TradingView ืืืืชืืช, ืืืืฆืจ ืฉื ืืกืงืจืืคื ืืื ืืคื ืืืชื ืืงืื ืคืชืื, ืื ืฉืกืืืจืื ืืืืืื ืืืืืง ืืืืืช ืืช ืืคืื ืงืฆืืื ืืืืช ืฉืื. ืื ืืืืื ืืืืืจ! ืืืจืืช ืฉืืชื ืืืื ืืืฉืชืืฉ ืื ืืืื ื, ืืืืจ ืฉืคืจืกืื ืืืืฉ ืฉื ืืงืื ืืคืืฃ ืืืืื ืืืืช ืฉืื ื.
ืืชื ืืืชืืจ
ืืืืืข ืืืคืจืกืืืื ืืื ื ืืืืจืื ืืืืืช, ืืืื ื ืืืืืื, ืขืฆืืช ืคืื ื ืกืืืช, ืืฉืงืขืืช, ืืกืืจ ืื ืกืืืื ืืืจืื ืฉื ืขืฆืืช ืื ืืืืฆืืช ืฉืกืืคืงื ืื ืืืืฉืจืื ืขื ืืื TradingView. ืงืจื ืขืื ืืชื ืืื ืืืืืืืืช.