TradingView
marspumpkin
Dec 20, 2021 4:52 AM

pson 

US SPX 500OANDA

Description

PineScript Object Notation

A workaround not having objects in pinescript.
This is a Json-look-alike interpreter.
Format: "attr=value:attr1=value1:attr2=value2".

You can add new attributes, get the value in those attributes, set new values to existing attributes and check if an attribute exists.

Release Notes

v2 - now you can have psons inside psons

Added:
get_itterable()

Updated:
set()

get()

Release Notes

fixing typo

Release Notes

v4 - fixed issue with the add() function

Release Notes

v5 - added get_values() get_int() get_bool()

Release Notes

v6 added set_values()

Release Notes

v7 added remove()
Comments
RicardoSantos
thank you for making pinescript better for all :)
fromtheFtotheW
I tried a lot, but it didn´t work as expected. The object didn´t keept its values over periods. I also tried different versions, all with the same outcome. So i expect that this issue is may from pine core or from me. Any advice would be highly appreciated. Your code is definitly poetry :-)
marspumpkin
@fromtheFtotheW, how are you trying to use it? maybe I can help you
fromtheFtotheW
Wham baem thank you men! Its chrismas time again ;)
marspumpkin
@fromtheFtotheW, glad to be of help. check out my hashmap library also if interested. cheers!
jcastilla358
@markspumpkin Could you add a push and pop function?
marspumpkin
@jcastilla358, hello. yes :) the add function works like a push. and I will add a pop/remove function soon.
marspumpkin
This library allows you to manage strings as if they were objects.
More