A small method to translate strings to numbers. For example, we have a string:
s = "321"
To check if the last symbol is "1", we might just try to remove (or replace with an empty string) the symbol "1". If the string changed, then there was the symbol "1" in the string:
s2 = str.replace_all (s, "1", "")
now s2 is "32", so
s == s2 returns false.
But we can't find out what the position of the symbol "1" was and if there was only one symbol "1".
To be sure, we just add a special character (I use ';') to the end of the string, and then try to remove not just "1", but the string "1;":
s = "321;" s2 = str.replace_all (s, "1;", "")
Now, if s != s2, then we might be sure, that last symbol of the string was "1". And then we might check for all digits and get information about what digit we have and at what position. Same for additional symbols: decimal point and minus.
Skrypt open-source
W duchu TradingView twórca tego skryptu udostępnił go jako open-source, aby traderzy mogli analizować i weryfikować jego funkcjonalność. Brawo dla autora! Możesz korzystać z niego za darmo, ale pamiętaj, że ponowna publikacja kodu podlega naszym Zasadom Społeczności.
Aby uzyskać szybki dostęp na wykresie, dodaj ten skrypt do ulubionych — więcej informacji tutaj.
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.
W duchu TradingView twórca tego skryptu udostępnił go jako open-source, aby traderzy mogli analizować i weryfikować jego funkcjonalność. Brawo dla autora! Możesz korzystać z niego za darmo, ale pamiętaj, że ponowna publikacja kodu podlega naszym Zasadom Społeczności.
Aby uzyskać szybki dostęp na wykresie, dodaj ten skrypt do ulubionych — więcej informacji tutaj.
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.