It's a helpful toolset while designing UDT's as it remains flexible, this helps in not having to remap an entire script while tinkering. Set an object up, and add as man properties as yyou wish. a property can be one of any pine built in types. so a single object can contain sa, ohlc each with a color, a float, an assigned int and those 4 props each have 3 sub-assigned values. as in demo, the alternating table object has 2 different tables it's a pseudo more complex wa to create our own flexible version of a UDT, but that will not ~break~ on library updates so you can update awa without fear, as this libb will no change saving ou the hassle of creating UDT's that continually change.
set(dict, _object, _prop, _item) Add/Updates item to storage. Autoselects subclass dictionary on set Parameters: dict: (dictionary) dict.type subdictionary (req for overload) _object: (string) object name _prop _item: (<any>) item to set Returns: item item wwith column/row
get(typedict, _object, _prop) Get item by object name and property (string) Parameters: typedict: (<any>dict) dict.type subdictionary (req for overload) _object: (string) object name _prop Returns: <type> item from storage
remove(typedict, _object, _prop) Remove a specific property from an object Parameters: typedict: (<any>dict) dict.type subdictionary (req for overload) _object: (string) object name _prop Returns: <type> item from storage
delete(_dict, _object) Remove a complete Object and all props Parameters: _dict _object: (string) object name Returns: <type> item from storage
delete(_dict, _index) Parameters: _dict _index
wipe(_dict, _object, _prop) Remove Property slot for all 10 item types Parameters: _dict: (dictionary) The full dictionary item _object: (string) object name _prop Returns: <type> item from storage
wipe(_dict, _index) Parameters: _dict _index
init(_Objlim, _Proplim) Create New Dictionary ready to use (9999 size limit - (_objlim +_Proplim) for row/column 0) # Full dictionary with all types > start with this Parameters: _Objlim: (int) maximum objects (think horizontal) _Proplim: (int) maximum properties per obj (vertical) Returns: dictionary typoe object
Dalam semangat sebenar TradingView, penulis telah menerbitkan kod Pine ini sebagai satu perpustakaan sumber terbuka supaya pengaturcara Pine lain dari komuniti kami boleh menggunakannya semula. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara peribadi atau dalam penerbitan sumber terbuka lain, tetapi penggunaan semula kod dalam penerbitan ini adalah dikawal oleh Peraturan dalaman.
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.