How to Drop Leading Zero from Double

sL.vEr

New member
Heya there,

Looking to see if anyone knows how to remove the Leading Zero from a Double inside of a watchlist.

fzTDczx.png


I've looked through ToS Learning Center, and they state it IS possible to do it,
they do so "oh matter of factly", but never tell you how to do it or code it.

https://tlc.thinkorswim.com/center/reference/thinkScript/Data-Types/double

Above is the link to ToS where they say you can do it.
They're Delta Quote does it automatically,
But if I make a Custom Quote, it tags on the leading 0 by default.

I've tried Round(optionDelta, 0) type coding and it doesn't work.

Thanks in advance
 
Solution
@sL.vEr The definition provided by TOS (to my understanding of it) means that it is possible to write the code without using the zero, i.e.,
def sample = something - .123; - but not that the output of the code can be modified.
One way that the zero might be removed could be to use AddLabel(), multiply your current result by 100, and hard-code in a decimal point. I haven't tried if that will work, but keep in mind if it does that while the visuals might match the original column, using AddLabel() may cause sorting problems. Just some thoughts and ideas.
@sL.vEr The definition provided by TOS (to my understanding of it) means that it is possible to write the code without using the zero, i.e.,
def sample = something - .123; - but not that the output of the code can be modified.
One way that the zero might be removed could be to use AddLabel(), multiply your current result by 100, and hard-code in a decimal point. I haven't tried if that will work, but keep in mind if it does that while the visuals might match the original column, using AddLabel() may cause sorting problems. Just some thoughts and ideas.
 
Solution
@sL.vEr The definition provided by TOS (to my understanding of it) means that it is possible to write the code without using the zero, i.e.,
def sample = something - .123; - but not that the output of the code can be modified.
One way that the zero might be removed could be to use AddLabel(), multiply your current result by 100, and hard-code in a decimal point. I haven't tried if that will work, but keep in mind if it does that while the visuals might match the original column, using AddLabel() may cause sorting problems. Just some thoughts and ideas.
Yea, that makes sense, just really vague on their part.

I tried messing with your idea right now, just to try it
but shifting all of the numbers in the list just doesn't work out unfortunately :(
on top of the fact that as you mentioned, it would ruin the sorting order
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
320 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

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?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top