# NOT have the Percentage Label truncate

#### IHopeToLearn

##### New member
Is there any way to NOT have the Percentage Label truncate?
ex: 0.01% looks alot like 0.1% and in a scalping rush I have at times got out of a trade thinking 0.01% is not big deal but it was more than I thought. *Not sure if this is where I am supposed to post this.

Here is the current code:

# Profit or Loss Current Candle
#Base Code provided by Pensar
#Modified by Therival and DoubleJinx

#THIS CODE FOUND HERE:
plot entryPrice;

input showDetails = yes;

# Entry Price
entryPrice = GetAveragePrice();
#entryPrice.AssignValueColor(if close < entryPrice then Color.DOWNTICK else Color.UPTICK);
#entryPrice.SetLineWeight(2);
#entryPrice.SetStyle(Curve.SHORT_DASH);

#END OF CODE

# Start of PENSAR Code
# defs
def PL = GetOpenPL();
def Entry = if IsNaN(GetAveragePrice()) then Entry[1] else GetAveragePrice();
def LastEntryBar = if Entry != Entry[1] then BarNumber() else LastEntryBar[1];
def PercentChg = if Entry then (close - Entry) / Entry else 0;
def qty = GetQuantity();

# label
AddLabel(showDetails, qty + "@" + AsDollars(entryPrice),
if PL == 0 then Color.WHITE
else if PL > 0.01 then Color.GREEN
else Color.DARK_ORANGE);

" | " + AsPercent(PercentChg) ,
if PL == 0 then Color.WHITE
else if PL > 0.01 then Color.GREEN
else Color.DARK_ORANGE);

Last edited by a moderator:
Is there any way to NOT have the Percentage Label truncate?
ex: 0.01% looks alot like 0.1% and in a scalping rush I have at times got out of a trade thinking 0.01% is not big deal but it was more than I thought. *Not sure if this is where I am supposed to post this.

Here is the current code:

# Profit or Loss Current Candle
#Base Code provided by Pensar
#Modified by Therival and DoubleJinx

#THIS CODE FOUND HERE:
plot entryPrice;

input showDetails = yes;

# Entry Price
entryPrice = GetAveragePrice();
#entryPrice.AssignValueColor(if close < entryPrice then Color.DOWNTICK else Color.UPTICK);
#entryPrice.SetLineWeight(2);
#entryPrice.SetStyle(Curve.SHORT_DASH);

#END OF CODE

# Start of PENSAR Code
# defs
def PL = GetOpenPL();
def Entry = if IsNaN(GetAveragePrice()) then Entry[1] else GetAveragePrice();
def LastEntryBar = if Entry != Entry[1] then BarNumber() else LastEntryBar[1];
def PercentChg = if Entry then (close - Entry) / Entry else 0;
def qty = GetQuantity();

# label
AddLabel(showDetails, qty + "@" + AsDollars(entryPrice),
if PL == 0 then Color.WHITE
else if PL > 0.01 then Color.GREEN
else Color.DARK_ORANGE);

" | " + AsPercent(PercentChg) ,
if PL == 0 then Color.WHITE
else if PL > 0.01 then Color.GREEN
else Color.DARK_ORANGE);

to keep trailing 0's, need to check the number and add a "0" if it is needed

example that adds characters as needed

87k+ Posts
167 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?