Library "key_vals" a set of primitive single-type key/value items, and pseudo-dictionaries The dictionaries are single arrays of items, each item has a key and value. The library is 100% methods. add, remove, get and set items by key. It provides methods to get all the keys, values or items in the dict as arrays. For those familiar with python, it's similar, but typified.. and the brackets are round.
example syntax.. using floats, the same functions exist for Int, Bool and String
new float_item new (‘demo’, 1.0 )
set the key of a float_item float_item.key (‘demo’)
get the key of a float_item float_item.key ()
set the value of a float_item float_item.val (1.5)
get the value of a float_item float_item.val ()
get the number of items in a dict float_dict.count ()
set an item to a dict by key ( add / update) float_dict.set ( ‘demo’, 2.0 )
remove an item from a dict by key (changes index, but this is about keys, not ids) float_dict.remove ( ‘demo’ )
get an item from a dict array array<float_dict>.get (1 )
get an item from a dict by key float_dict.get ( ‘demo’ )
get an item from a dict by id (remember, ids change if removed by key) mainlyy an internal function float_dict.get ( 1)
return all keys as string[] float_dict.get_keys()
return all values as float[] float_dict.get_values()
return all items as float[] float_dict.get_items()
create a new float dict in the multi dict and return the index of it multi_dict.add_float_dict()
get the float dict at index 0 from the multi dict multi_dict.get_float_dict( 0)
set an item in a float dict in a multi dict multi_dict.set_float( ‘demo’, 2.0 )
get an item from a float dict in a multi dict multi_dict.get_float( ‘demo’ )
Dans le plus pur esprit TradingView, l'auteur a publié ce code Pine en tant que bibliothèque open-source afin que d'autres programmeurs Pine de notre communauté puissent le réutiliser. Bravo à l'auteur! Vous pouvez utiliser cette bibliothèque en privé ou dans d'autres publications à code source ouvert, mais la réutilisation de ce code dans une publication est régie par nos Règles.
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.