• This educational script will sort an array of tickers alphabetically and place these values in an table, together with the according current price value next to each ticker.
• the object object_1 consists off: · ticker -> "TICKER" · price -> current Daily close through request.security("TICKER") (non-repainting) • object_1 will be added to the aObjarray • "TICKER" (string ticker part of object) will be added to the sortarray
Alphabetically sorting is case sensitive, just like Java compareTo(String anotherString)! • The comparison is based on the Unicode value of each character in the string, the lowest "Dec" values are sorted first in line. • Comparing the "Dec" values at unicodelookup explains why default CAPITAL lettres will be sorted first, • Default you would get this (A= 65, B= 66, a= 97, b= 98)
• As a side note, should you write "AMZN" as "ÀMZN" this would be placed at the end, even after transforming to lower case the "Dec" values are higher (À= 192, à= 224).
• You can toggle "To Lower Case" to verify.
🔹 V. Values are placed in a table, using these sorted indices.
• With the usage of UDTs and objects, the current price has the same index in the aObj as their ticker, giving the advantage it is fairly easy to place every value correctly next to each other. • The same can be done by make 2 separate arrays, 1 for the current price, the other for "TICKER".
진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.