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’ )
Dengan semangat TradingView yang sesungguhnya, penulis telah menerbitkan Kode Pine ini sebagai pustaka sumber terbuka sehingga programmer Pine lain dari komunitas kami dapat menggunakannya kembali. Hormat untuk penulis! Anda dapat menggunakan pustaka ini secara pribadi atau dalam publikasi sumber terbuka lainnya, namun penggunaan kembali kode ini dalam publikasi diatur oleh Tata Tertib.
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.