OPEN-SOURCE SCRIPT

๐Ÿ’Ž ProfittoPath โ€“ Glass HUD

74
//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)

ื›ืชื‘ ื•ื™ืชื•ืจ

ื”ืžื™ื“ืข ื•ื”ืคืจืกื•ืžื™ื ืื™ื ื ืืžื•ืจื™ื ืœื”ื™ื•ืช, ื•ืื™ื ื ืžื”ื•ื•ื™ื, ืขืฆื•ืช ืคื™ื ื ืกื™ื•ืช, ื”ืฉืงืขื•ืช, ืžืกื—ืจ ืื• ืกื•ื’ื™ื ืื—ืจื™ื ืฉืœ ืขืฆื•ืช ืื• ื”ืžืœืฆื•ืช ืฉืกื•ืคืงื• ืื• ืžืื•ืฉืจื™ื ืขืœ ื™ื“ื™ TradingView. ืงืจื ืขื•ื“ ื‘ืชื ืื™ื ื•ื”ื”ื’ื‘ืœื•ืช.