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
Siguiendo fielmente el espíritu TradingView, el autor ha publicado este código Pine como una biblioteca de código abierto, permitiendo que otros programadores de Pine en nuestra comunidad lo utilicen de nuevo. ¡Olé por el autor! Puede utilizar esta biblioteca de forma privada o en otras publicaciones de código abierto, pero tenga en cuenta que la reutilización de este código en una publicación se rige por las Normas internas.
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.