OPEN-SOURCE SCRIPT

PnL Crypto with USD to IDR Conversion

Updated

How to Use the Indicator
  1. Input Your Average Buy Price and Position Size:

  • In the indicator settings, input your average buy price (the price at which you entered the position) and your position size (the amount of crypto you hold).

  • These values are used to calculate your PnL.


  1. View the Average Buy Price Line:

*A dotted horizontal line will be plotted on the chart at your average buy price. This helps you visually compare the current price to your entry point.

*Check the Floating Label:
*On the last bar of the chart, a floating label will display:
[**]USDT PnL: Your profit or loss in USDT.
[**]IDR PnL: Your profit or loss converted to Indonesian Rupiah.
*The label will be colored green for profit and red for loss.

*Understand the Calculations:
*PnL in USDT: (Current Price - Average Buy Price) * Position Size
*PnL in IDR: The USDT PnL is converted to IDR using the real-time USD/IDR exchange rate fetched from the FX_IDC:USDIDR ticker.
Release Notes
change color
Release Notes
set number
Release Notes
LIVE PNL
Bands and ChannelsBill Williams IndicatorsBreadth IndicatorsPNL

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer