TradingView

Exploring Unicode

7687 views
532
This script demonstrates how to display Unicode characters and symbols, including emoji, in Pine:
 • Part 1 displays multi-line labels on hi/lo pivots .
 • Part 2 displays price/ volume bumps using small up/down arrows plotted with plotchar().
 • Part 3 detects bounces and uses plotshape() to mark them.
  You can use our `f_bounceFrom()` function from this part as confirmation for signals in your strategies.

Note that the labels displayed on pivots with the code in Part 1 are plotted in the past. In realtime, they would only appear where they are after 50 bars have elapsed from that point. The other plots are plotted on the bar where their conditions are detected.

You can display thousands of Unicode characters and symbols using Pine. As you can see with our script, it is very easy to do so. The challenge will often be to find the exact symbols you are looking for. Many websites exist to help you explore Unicode characters or symbols. The PineCoders Resources page contains a section presenting a few of them.

Duyck has a Unicode font function script containing functions to convert strings to monospaced Unicode representations. TradingView uses the Trebuchet font for most of its text, including text displayed with Pine scripts. While its numerals are monospace and will align vertically in labels text, Duyck's functions will be handy when you need to convert characters to a monospaced form, so they also align vertically in multi-line labels.

What is Unicode?
Unicode is to character encoding what Wikipedia is to knowledge; it holds codes to a good proportion of the characters or symbols used by humans, past or present. In the early days of computing, environments from different manufacturers often used different character encoding schemes, making transport between them difficult. Unicode solves that challenge. It is a comprehensive encoding scheme that visionaries from Xerox and Apple came up with in the late 80's. The addition of members from the Research Libraries Group, Sun Microsystems, Microsoft , Next and Metaphor created the "Unicode working group" and later, the Unicode Consortium, which continues to improve and manage the Unicode standard.

Theoretically, Unicode encodes values representing characters or glyphs—not their pictorial representations. The letters "A" or "a", or the blue heart emoji "💙" are each represented by a Unicode value. In practice, however, there are many different versions of the Latin alphabet in Unicode. That is how our low pivot label can display different representations of the letters "ITV". The exact rendition of Unicode symbols on a specific device is left to equipment manufacturers and typeface designers.

The current Unicode space is comprised of 17 planes of 65,536 characters each, which allows for more than one million code points. Planes are further divided into character blocks, which typically hold a character set corresponding to one script—or language. Emoticons are in the character block starting at U+1F600.
Versionshinweise: v1.1
Updated comments.
Open-source Skript

Ganz im Sinne von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es verstehen und überprüfen können. Ein Hoch auf den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Publikation unterliegt den Hausregeln. Sie können das Skript den Favoriten hinzufügen, um es auf dem Chart zu verwenden.

Möchten Sie dieses Skript auf einem Chart verwenden?
Get $30 worth of TradingView Coins for you and a friend: https://www.tradingview.com/share-your-love/

Read more about the new tools and features we're building for you: https://www.tradingview.com/blog/en/

Kommentare

Thanks for sharing with us🔥
100 Coins
+1 Antworten
I actually love this one. Thank you boss!
500 Coins
Antworten
I wanted to learn how to code but just looking at this makes me wonder if it's something I should really learn. I feel like coding is a good skill to have but I'm still trying to learn market psychology and all the different charting tools and techniques so adding this seems like too much at once. I'm a novus to trading period and jumping head first into crypto and margin and then futures. I have an idea for an indicator that would analyze the rolling % change and give indications of it's rate of change and strength of change for multiple time periods . If anyone wants to get together and make it happen I'd be open to working with someone.
+1 Antworten
PineCoders DecoratedQuantum
@DecoratedQuantum, Learning to code your own indicators is certainly empowering for traders—and the reason why we try to keep Pine as easy to learn as possible while continuing to add more powerful features for experienced coders. Your decision to focus on learning the basics of trrading is a sound call, in our opinion. Learning how to manage your risk so you avoid ruin and can continue your learning journey, for example, is paramount. Without that skill set, the rest is irrelevant. When you feel you are ready to learn Pine, this is the best place to start your journey:
https://www.tradingview.com/?solution=43000561836
Antworten
this is great!
Antworten
good job
Antworten
Startseite Aktien-Screener Forex-Screener Krypto-Screener Wirtschaftskalender Über Chartmerkmale Preise Einen Freund empfehlen Hausregeln Hilfe Center Webseite & Brokerlösungen Widgets Charting Lösungen Lightweight Charting Library Blog & News Twitter